/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

a {
  text-decoration: none;
  color: #2a4a70;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
  /* Use CSS custom properties for theming */
  background-color: var(--bg-color, #ffffff);
  color: var(--text-color, #333333);
}

/* Fraction Font Fix */
mn {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Layout */
header {
  background: linear-gradient(135deg, #4a6fa5 0%, #3a5a80 100%);
  color: white;
  padding: 1rem;
  text-align: center;
}

nav {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.nav-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  margin: 0 1rem;
  padding: 0.5rem 1rem;
  position: relative;
}

.nav-btn:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background: white;
  left: 0;
  bottom: 0;
  transition: width 0.3s;
}

.nav-btn.active:after,
.nav-btn:hover:after {
  width: 100%;
}

main {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.logo-img {
  height: 50px;
  width: auto;
  max-width: 120px;
  transition: opacity 0.3s ease;
}

.logo-img:hover {
  opacity: 0.9;
}

/* Footer */
footer {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  color: white;
  padding: 3rem 0 1rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.footer-main {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-brand h3 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.footer-brand p {
  color: #ecf0f1;
  line-height: 1.6;
}

.footer-section h4 {
  margin-bottom: 1rem;
  color: #ecf0f1;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section ul li a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid #34495e;
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-link {
  color: #bdc3c7;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: white;
}

/* Page Sections */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* Buttons */
.primary-btn, .secondary-btn {
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
  margin: 0.5rem;
  padding: 0.75rem 1.5rem;
  transition: background-color 0.3s;
}

.primary-btn {
  background-color: var(--accent-color, #4a6fa5);
  color: white;
}

.primary-btn:hover {
  filter: brightness(0.9);
}

.secondary-btn {
  background-color: #cdd4e1;
  color: var(--text-color, #333);
}

.secondary-btn:hover {
  filter: brightness(0.95);
}

.action-btns {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

/* Test Container */
#test-container {
  background-color: var(--secondary-bg, #f9f9f9);
  border: 1px solid var(--border-color, #dddddd);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 2rem;
  margin-bottom: 2rem;
}

#progress-bar {
  background-color: var(--border-color, #e1e7f0);
  border-radius: 10px;
  height: 10px;
  margin-bottom: 1rem;
  overflow: hidden;
  width: 100%;
}

#progress-fill {
  background-color: var(--accent-color, #4a6fa5);
  height: 100%;
  transition: width 0.5s;
  width: 10%;
}

#question-counter {
  color: var(--text-color, #666);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  text-align: right;
}

/* Question Styles */
.question {
  margin-bottom: 2rem;
}

.question-text {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--text-color, #333);
}

/* Question Images */
.question-image-container {
  margin: 1rem 0 1.5rem 0;
  text-align: center;
}

.question-image {
  border-radius: 8px;
  height: auto;
  max-height: 400px;
  max-width: 100%;
  width: auto;
}

.question-image.loading {
  background-color: var(--secondary-bg, #f5f5f5);
  min-height: 200px;
  position: relative;
}

.question-image.error {
  background-color: var(--secondary-bg, #f8f9fa);
  border: 2px dashed var(--error-color, #dc3545);
  color: var(--error-color, #dc3545);
  padding: 2rem;
}

/* Image loading placeholder */
.image-placeholder {
  align-items: center;
  background-color: var(--secondary-bg, #f5f5f5);
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  color: var(--text-color, #666);
  display: flex;
  height: 200px;
  justify-content: center;
  width: 100%;
}

.image-placeholder::before {
  content: "Loading image...";
}

/* Option images */
.option-image {
  border-radius: 4px;
  height: auto;
  margin-right: 0.75rem;
  max-height: 180px;
  max-width: 300px;
  width: auto;
}

.option-with-image {
  align-items: flex-start;
  padding: 1rem 0.75rem;
}

.option-content {
  align-items: center;
  display: flex;
  flex: 1;
}

.option-text {
  flex: 1;
}

/* Drag item images */
.drag-item-image {
  border-radius: 4px;
  height: auto;
  margin-bottom: 0.5rem;
  max-height: 40px;
  max-width: 60px;
  width: auto;
}

.drag-item-with-image {
  align-items: center;
  display: flex;
  flex-direction: column;
  min-width: 80px;
  padding: 0.75rem;
  text-align: center;
}

.drag-item-with-image .drag-item-text {
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

/* Multiple Choice & Multiple Select */
.options-container {
  display: flex;
  flex-direction: column;
}

.option {
  align-items: center;
  background-color: var(--input-bg, white);
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  margin-bottom: 0.5rem;
  padding: 0.75rem;
  transition: background-color 0.2s;
}

.option:hover {
  background-color: var(--secondary-bg, #f0f5fa);
}

.option input {
  margin-right: 1rem;
}

.option.selected {
  background-color: var(--secondary-bg, #e1e7f0);
  border-color: var(--accent-color, #4a6fa5);
}

.option.correct {
  background-color: var(--success-color, #d4edda);
  border-color: var(--success-color, #28a745);
}

.option.incorrect {
  background-color: var(--error-color, #f8d7da);
  border-color: var(--error-color, #dc3545);
}

/* Drag and Drop */
.drag-items-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2rem;
}

.drag-item {
  background-color: var(--accent-color, #4a6fa5);
  border-radius: 4px;
  color: white;
  cursor: grab;
  padding: 0.5rem 1rem;
  user-select: none;
}

.drag-item.dragging {
  opacity: 0.5;
}

.drop-zones-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drop-zone {
  background-color: var(--secondary-bg, #f5f5f5);
  border: 2px dashed var(--border-color, #ddd);
  border-radius: 4px;
  min-height: 60px;
  padding: 1rem;
}

.drop-zone.highlight {
  border-color: var(--accent-color, #4a6fa5);
}

.drop-zone.correct {
  background-color: var(--success-color, #d4edda);
  border-color: var(--success-color, #28a745);
}

.drop-zone.incorrect {
  background-color: var(--error-color, #f8d7da);
  border-color: var(--error-color, #dc3545);
}

/* Free Response */
.response-input {
  background-color: var(--input-bg, white);
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  color: var(--text-color, #333);
  font-family: inherit;
  font-size: 1rem;
  padding: 0.75rem;
  resize: vertical;
  width: 100%;
}

/* Point Select Question Styles */
.point-select-container {
  position: relative;
  display: inline-block;
  margin: 1rem 0;
  border: 2px solid var(--border-color, #ddd);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.point-select-image {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 500px;
  user-select: none;
}

.point-select-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  background: transparent;
}

.point-select-instructions {
  text-align: center;
  padding: 0.75rem;
  background-color: var(--secondary-bg, #f0f5fa);
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  margin-bottom: 1rem;
  color: var(--text-color, #333);
  font-size: 0.9rem;
}

.selected-point {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: var(--accent-color, #4a6fa5);
  border: 2px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.selected-point.correct {
  background-color: var(--success-color, #28a745);
}

.selected-point.incorrect {
  background-color: var(--error-color, #dc3545);
}

.correct-point {
  position: absolute;
  width: 16px;
  height: 16px;
  background-color: var(--success-color, #28a745);
  border: 3px solid white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Feedback Container */
#feedback-container {
  background-color: var(--secondary-bg, #f9f9f9);
  border: 1px solid var(--border-color, #dddddd);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-top: 1rem;
  padding: 1.5rem;
}

#feedback-message {
  font-size: 1.1rem;
  font-weight: bold;
  margin-bottom: 1rem;
}

#feedback-message.correct {
  color: var(--success-color, #28a745);
}

#feedback-message.incorrect {
  color: var(--error-color, #dc3545);
}

#explanation {
  background-color: var(--secondary-bg, #f0f5fa);
  border-left: 4px solid var(--accent-color, #4a6fa5);
  color: var(--text-color, #333);
  padding: 1rem;
}

/* Notification Animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* Enhanced Results Styling */
.results-saved-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
}

.notification-content {
  background-color: var(--success-color, #28a745);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notification-icon {
  font-size: 1.2rem;
  font-weight: bold;
}

.no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-color, #666);
}

.no-results h3 {
  margin-bottom: 1rem;
  color: var(--text-color, #333);
}

.result-summary-text {
  text-align: left;
  margin-top: 1rem;
}

.result-summary-text p {
  margin-bottom: 0.5rem;
  color: var(--text-color, #333);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border-color, #eee);
}

.results-controls {
  display: flex;
  gap: 0.5rem;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.result-item {
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.result-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.result-item.excellent {
  border-left: 4px solid var(--success-color, #28a745);
}

.result-item.good {
  border-left: 4px solid #ffc107;
}

.result-item.needs-improvement {
  border-left: 4px solid var(--error-color, #dc3545);
}

.result-header {
  display: flex;
  align-items: center;
  padding: 1rem;
  background-color: var(--secondary-bg, #f8f9fa);
}

.result-score {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-color, #4a6fa5);
  min-width: 60px;
}

.result-info {
  flex: 1;
  margin-left: 1rem;
}

.result-date {
  font-weight: 500;
  color: var(--text-color, #333);
}

.result-details {
  font-size: 0.9rem;
  color: var(--text-color, #666);
  margin-top: 0.25rem;
}

.result-actions {
  display: flex;
  gap: 0.5rem;
}

.view-details-btn,
.delete-result-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 4px;
  background-color: white;
  color: var(--text-color, #333);
  cursor: pointer;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.view-details-btn:hover {
  background-color: var(--secondary-bg, #f0f5fa);
}

.delete-result-btn:hover {
  background-color: var(--error-color, #dc3545);
  color: white;
  border-color: var(--error-color, #dc3545);
}

.result-details-expanded {
  padding: 1rem;
  border-top: 1px solid var(--border-color, #eee);
  background-color: var(--input-bg, white);
}

.question-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.5rem;
}

.question-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.85rem;
}

.question-result.correct {
  background-color: #d4edda;
  color: #155724;
}

.question-result.incorrect {
  background-color: #f8d7da;
  color: #721c24;
}

.question-number {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.question-status {
  font-size: 0.8rem;
}

/* Performance trends placeholder */
.performance-trends {
  padding: 2rem;
  text-align: center;
  color: var(--text-color, #666);
}

/* Export/Import styling */
.export-section {
  margin-top: 2rem;
  padding: 1rem;
  border: 1px dashed var(--border-color, #ddd);
  border-radius: 8px;
  text-align: center;
}

.export-section h4 {
  margin-bottom: 1rem;
  color: var(--text-color, #333);
}

/* Performance Trends Styling */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-item {
  text-align: center;
  padding: 1.5rem;
  background-color: var(--secondary-bg, #f8f9fa);
  border-radius: 8px;
  border: 1px solid var(--border-color, #eee);
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  color: var(--accent-color, #4a6fa5);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-color, #666);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.improvement-indicator {
  text-align: center;
  padding: 1rem;
  margin: 1rem 0;
  border-radius: 8px;
  font-size: 1.1rem;
}

.improvement-indicator.positive {
  background-color: var(--success-color, #d4edda);
  color: var(--success-color, #155724);
  border: 1px solid var(--success-color, #c3e6cb);
}

.improvement-indicator.negative {
  background-color: var(--error-color, #f8d7da);
  color: var(--error-color, #721c24);
  border: 1px solid var(--error-color, #f5c6cb);
}

.recent-scores {
  margin-top: 2rem;
}

.recent-scores h4 {
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-color, #333);
}

.score-timeline {
  display: flex;
  justify-content: space-around;
  align-items: end;
  padding: 1rem;
  background-color: var(--secondary-bg, #f8f9fa);
  border-radius: 8px;
  border: 1px solid var(--border-color, #eee);
  flex-wrap: wrap;
  gap: 1rem;
}

.score-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.score-circle-small {
  background-color: var(--accent-color, #4a6fa5);
  color: white;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
}

.score-date {
  font-size: 0.75rem;
  color: var(--text-color, #666);
  white-space: nowrap;
}

/* Settings Section */
.settings-group {
  background-color: var(--secondary-bg, #f9f9f9);
  border: 1px solid var(--border-color, #dddddd);
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  padding: 1.5rem;
}

.settings-group h3 {
  color: var(--text-color, #333);
  margin-bottom: 1rem;
}

.theme-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 1rem;
}

.theme-btn {
  border: 2px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

.theme-btn[data-theme="black-on-white"] {
  background-color: #FFFFFF;
  color: #333333;
}

.theme-btn[data-theme="black-on-cream"] {
  background-color: #FFFACD;
  color: #000000;
}

.theme-btn[data-theme="black-on-light-blue"] {
  background-color: #ADD8E6;
  color: #000000;
}

.theme-btn[data-theme="black-on-light-magenta"] {
  background-color: #EE82EF;
  color: #000000;
}

.theme-btn[data-theme="white-on-black"] {
  background-color: #000000;
  color: #ffffff;
}

.theme-btn[data-theme="yellow-on-blue"] {
  background-color: #1800CC;
  color: #F5E728;
}

.theme-btn[data-theme="gray-on-green"] {
  background-color: #A3AE9E;
  color: #6E6E6E;
}

.theme-btn.active {
  border-color: var(--accent-color, #4a6fa5);
  box-shadow: 0 0 0 2px var(--accent-color, #4a6fa5);
}

.font-size-controls {
  align-items: center;
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

#font-size-value {
  color: var(--text-color, #333);
  font-weight: bold;
  min-width: 100px;
  text-align: center;
}

.font-btn {
  background-color: var(--accent-color, #4a6fa5);
  border: none;
  border-radius: 4px;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  height: 40px;
  width: 40px;
}

.font-btn:hover {
  filter: brightness(0.9);
}

.checkbox-option {
  margin-top: 1rem;
}

.checkbox-option label {
  color: var(--text-color, #333);
  cursor: pointer;
  margin-left: 0.5rem;
}

/* Responsive Design */
@media (max-width: 600px) {
  nav {
    flex-wrap: wrap;
  }
  
  .nav-btn {
    margin: 0.5rem;
  }
  
  #test-container, 
  #feedback-container, 
  #results-summary, 
  #results-details, 
  .settings-group {
    padding: 1rem;
  }
  
  .action-btns {
    flex-direction: column;
  }
  
  .primary-btn, 
  .secondary-btn {
    width: 100%;
  }

  .theme-options {
    flex-direction: column;
  }

  .theme-btn {
    width: 100%;
  }
}

.nav-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1rem;
  margin: 0 1rem;
  padding: 0.5rem 1rem;
  position: relative;
  transition: opacity 0.3s, color 0.3s;
}

/* Disabled state tooltip */
.nav-btn:disabled,
.nav-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  color: #ccc;
  position: relative;
}

.nav-btn:disabled:hover::before,
.nav-btn.disabled:hover::before {
  content: attr(title);
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.8rem;
  white-space: nowrap;
  z-index: 1000;
  pointer-events: none;
}

.nav-btn:disabled:hover,
.nav-btn.disabled:hover {
  opacity: 0.5;
}

.nav-btn:after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background: white;
  left: 0;
  bottom: 0;
  transition: width 0.3s;
}

.nav-btn.active:after,
.nav-btn:hover:after {
  width: 100%;
}

.nav-btn:disabled:after,
.nav-btn.disabled:after {
  background: #ccc;
}

.nav-btn:disabled:hover:after,
.nav-btn.disabled:hover:after {
  width: 0;
}

/* Hide footer when in test mode */
body.test-mode footer {
  display: none;
  transform: translateY(100%);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

footer {
  transition: opacity 0.3s ease, transform 0.3s ease;
  transform: translateY(0);
  opacity: 1;
}

.calculator-container {
      position: fixed;
      top: 20px;
      right: 20px;
      width: 320px;
      height: 400px;
      background: white;
      border: 2px solid var(--accent-color, #4a6fa5);
      border-radius: 8px;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
      z-index: 1000;
      display: none;
      flex-direction: column;
      overflow: hidden;
      user-select: none;
    }
    
    .calculator-container.dragging {
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
      transition: none;
    }
    
    .calculator-header {
      background: var(--accent-color, #4a6fa5);
      color: white;
      padding: 8px 12px;
      font-size: 0.9rem;
      font-weight: bold;
      display: flex;
      justify-content: space-between;
      align-items: center;
      cursor: move;
      position: relative;
    }

    .calculator-header:hover {
      background: #3a5a80;
    }

    .calculator-header::before {
      position: absolute;
      left: 4px;
      top: 50%;
      transform: translateY(-50%);
      font-size: 0.8rem;
      opacity: 0.7;
      letter-spacing: -2px;
    }
    
    .calculator-title {
      flex: 1;
      text-align: center;
      margin-left: 12px;
    }
    
    .calculator-toggle {
      background: none;
      border: none;
      color: white;
      cursor: pointer;
      font-size: 1.2rem;
      padding: 2px 6px;
      border-radius: 3px;
      z-index: 10;
    }
    
    .calculator-toggle:hover {
      background: rgba(255, 255, 255, 0.2);
    }
    
    .calculator-iframe {
      flex: 1;
      border: none;
      width: 100%;
      pointer-events: auto;
    }
    
    .calculator-container.minimized .calculator-iframe {
      display: none;
    }
    
    .calculator-note {
      background-color: #e8f4f8;
      border: 1px solid #bee5eb;
      border-radius: 4px;
      padding: 0.75rem;
      margin: 1rem 0;
      font-size: 0.9rem;
      color: #0c5460;
    }
    
    .calculator-note.hidden {
      display: none;
    }
    
    /* Snap zones for better UX */
    .snap-zone {
      position: fixed;
      background: rgba(74, 111, 165, 0.2);
      border: 2px dashed var(--accent-color, #4a6fa5);
      border-radius: 8px;
      display: none;
      z-index: 999;
      pointer-events: none;
    }
    
    /* Mobile responsiveness */
    @media (max-width: 768px) {
      .calculator-container {
        width: 280px;
        height: 350px;
      }
      
      .calculator-container.mobile-bottom {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 50vh;
        border-radius: 12px 12px 0 0;
        border-bottom: none;
        transform: none !important;
      }
      
      .calculator-container.minimized {
        height: 50px;
      }
      
      .calculator-header::before {
        content: '☰';
        letter-spacing: normal;
      }
    }
    /* Resize handles */
.resize-handle {
  position: absolute;
  background: transparent;
  z-index: 11;
}

.resize-handle-n {
  top: 0;
  left: 8px;
  right: 8px;
  height: 4px;
  cursor: n-resize;
}

.resize-handle-s {
  bottom: 0;
  left: 8px;
  right: 8px;
  height: 4px;
  cursor: s-resize;
}

.resize-handle-e {
  top: 8px;
  bottom: 8px;
  right: 0;
  width: 4px;
  cursor: e-resize;
}

.resize-handle-w {
  top: 8px;
  bottom: 8px;
  left: 0;
  width: 4px;
  cursor: w-resize;
}

.resize-handle-ne {
  top: 0;
  right: 0;
  width: 8px;
  height: 8px;
  cursor: ne-resize;
}

.resize-handle-nw {
  top: 0;
  left: 0;
  width: 8px;
  height: 8px;
  cursor: nw-resize;
}

.resize-handle-se {
  bottom: 0;
  right: 0;
  width: 8px;
  height: 8px;
  cursor: se-resize;
}

.resize-handle-sw {
  bottom: 0;
  left: 0;
  width: 8px;
  height: 8px;
  cursor: sw-resize;
}

.calculator-container.resizing {
  user-select: none;
}

.calculator-container.resizing .calculator-iframe {
  pointer-events: none;
}

.calculator-container.minimized {
  height: 40px !important;
  min-height: 40px;
}

.calculator-container.minimized .calculator-iframe {
  display: none;
}

.calculator-container.minimized .resize-handle {
  display: none; /* Hide resize handles when minimized */
}