
/* Global box sizing for better layout control */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* Quiz app wrapper - now responsive and scrollable if needed */
.quiz-app-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start; /* Modal-friendly positioning */
  min-height: calc(100vh - 70px); /* Accounts for navbar (60px) + footer (50px) */
  background: linear-gradient(to top, #e6ffee, #bdd4ff);
  width: 100%;
  padding: 15px 0;
  overflow-y: auto; /* Allows scroll if content is tall */
}

/* Main app container - clean, compact, and responsive */
#app {
  width: 90% !important;
  max-width: 1200px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 25px;
  position: relative;
  margin: 20px auto 10px auto; /* Top margin adjusted */
}

/* Responsive typography and padding for very small screens */
@media (max-width: 360px) {
  #app {
    padding: 15px;
    font-size: 14px;
  }
}

.speak-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  margin-right: 8px;
  color: #007bff;
}

.speak-btn:hover {
  color: #0056b3;
}


/* Responsive title */
h1 {
  text-align: center;
  margin: 5px 0 10px; /* Reduced margins */
  font-size: clamp(14px, 4vw, 20px);
  padding: 5px; /* Reduced padding */
}

/* Compact tracker and timer */
.tracker, .timer {
  position: absolute;
  top: 10px;
  font-size: clamp(14px, 3vw, 18px);
  font-weight: bold;
  color: #555;
}

.tracker {
  left: 15px;
}

.timer {
  right: 15px;
}

/* Question with reduced spacing */
.question {
  font-size: clamp(0.8rem, 2vw, 1.0rem);
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  margin: 20px 0 20px; /* Reduced top margin */
  text-align: left;
  padding: 0 10px;
  line-height: 1.5; /* Adjust this value as needed */
}

/* Options container - now flex row with wrapping */
.options {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap; /* Allow items to wrap */
  gap: 12px;        /* Space between items */
  justify-content: flex-start;
  align-items: flex-start;
}

/* Each option item - auto width and responsive */
.options li {
  background: #f9f9f9;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid #ddd;
  cursor: pointer;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  font-size: clamp(0.8rem, 2vw, 1.0rem);
  text-align: left;
  white-space: normal;
  word-break: break-word;

  /* Flex item behavior */
  flex: 0 1 auto; /* Don't grow, allow shrink, auto width */
  max-width: 100%; /* Avoid overflowing container */
}

/* Option hover */
.options li:hover {
  background-color: #eef4ff;
  border-color: #004aad;
}

/* Submit button - left aligned, auto width */
.quiz-btn {
  display: inline-block;
  padding: 12px 20px;
  font-size: clamp(16px, 2.5vw, 18px);
  background: #004aad;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 20px;
  transition: background 0.3s ease;
  align-self: flex-start;
  white-space: nowrap;
}
.quiz-btn:hover {
  background: #00378f;
}


/* Extra small devices specific adjustments */
@media (max-width: 480px) {
  .quiz-app-wrapper {
    padding: 10px 0;
  }
  
  #app {
    width: 90%;
    padding: 15px;
  }
  
  .question {
    margin: 10px 0 5px; /* Even more compact on small devices */
    text-align: center;
  }
  
  .options li {
    padding: 7px;
    min-height: 15px;
    margin-bottom: 6px;
  }
  
  .quiz-btn {
    padding: 8px;
    margin: 12px 0 5px;
  }
  
  /* Modal adjustments for very small screens */
  .modal {
    width: 90%;
    top: 15%;
    padding: 12px;
    max-height: 55vh;
  }
  
  .modal h2 {
    margin: 5px 0;
    font-size: 20px;
  }
  .modal p {
    font-size: 16px;
  }
  h1 {
    text-align: center;
    padding: 8px; /* Reduced padding */
  }
}


/* ===== MODAL STYLES ===== */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  border-radius: 10px;
  z-index: 1000;
  width: 90%;
  max-width: 900px;
  display: none;
  flex-direction: column;
  padding: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  max-height: 90vh; /* Prevent from overflowing screen */
  overflow-y: auto; /* Allows scrolling if content is too tall */
}

#modal-title {
  font-size: 1.6rem;
  font-weight: bold;
  margin-bottom: 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
}
#modal-title .icon {
  margin-left: 8px;
  font-size: 1.4rem;
}

/* Title Colors */
.title-correct {
  color: #2e7d32; /* Green */
}

.title-incorrect {
  color: #d32f2f; /* Red */
}

.title-complete {
  color: #004aad; /* Blue */
}

#modal-text {
  display: flex;
  flex-direction: column;
  gap: 15px;
  font-size: 1rem;
  line-height: 1.5;
  color: #333;
}

/* Answer sections */
.answer-section {
  display: block;
  padding: 10px;
  border-radius: 5px;
}

.your-answer {
  background-color: #ffebee; /* Light red */
  border-left: 4px solid #d32f2f;
}

.correct-answer {
  background-color: #e8f5e9; /* Light green */
  border-left: 4px solid #2e7d32;
}

.explanation {
  background-color: #e3f2fd; /* Light blue */
  border-left: 4px solid #1565c0;
}

/* Section labels */
.answer-section::before {
  display: block;
  font-weight: bold;
  margin-bottom: 5px;
}

.your-answer::before {
  content: "Your answer:";
  color: #d32f2f;
}

.correct-answer::before {
  content: "Correct answer:";
  color: #2e7d32;
}

.explanation::before {
  content: "Explanation:";
  color: #1565c0;
}

/* Next button */
#modal-close {
  display: inline-block;   /* shrink to fit text */
  width: auto;             /* remove full width */
  padding: 10px 16px;      /* keep some padding around text */
  background: #0077cc;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 20px;
  transition: background 0.3s;
  align-self: flex-start;  /* push it to bottom-left inside flex modal */
}


#modal-close:hover {
  background: #003b8e;
}

/* Overlay */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 600px) {
  .modal {
    width: 95%;
    padding: 20px;
  }
  
  #modal-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
  }
  
  .answer-section {
    padding: 8px;
  }
  
  #modal-close {
    padding: 10px;
  }
}

@media (max-width: 480px) {
  .modal {
    width: 90%;
    padding: 15px;
  }
  
  #modal-title {
    font-size: 1.1rem;
  }
  
  #modal-text {
    font-size: 0.9rem;
    gap: 10px;
  }
  
  .answer-section::before {
    font-size: 0.9rem;
  }
}
.final-summary {
  text-align: center;
  font-size: 1.1rem;
  line-height: 1.6;
  margin-top: 10px;
  padding: 15px;
  background-color: #f1f8e9; /* soft green background */
  border-left: 4px solid #689f38; /* professional green accent */
  border-radius: 8px;
  color: #2e7d32;
}

.final-summary div {
  margin: 5px 0;
}

.options li:hover {
  background: #f1f1f1;
  border-color: #ccc;
}

.options li.selected {
  background: #dbeeff;
  border-color: #3399ff;
}

.options li.correct {
  background: #d4edda;
  border-color: #28a745;
  color: #155724;
}

.options li.wrong {
  background: #f8d7da;
  border-color: #dc3545;
  color: #721c24;
}

.quiz-btn:disabled {
  background: #c0c0c0;
  cursor: not-allowed;
}

#loader {
  text-align: center;
  font-size: clamp(16px, 4vw, 20px);
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  z-index: 15;
  display: none;
}

.disabled {
  pointer-events: none;
  opacity: 1;
}

/* Social media buttons styling */
.social-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.social-buttons a {
  display: inline-block;
  /*padding: 10px 20px;*/
  padding: 7.5px 7.5px;
  border-radius: 5px;
  color: white;
  text-decoration: none;
  font-size: 16px;
  text-align: center;
}

.social-buttons .home-btn {
  background-color: #3b5998;
}

.social-buttons .dashboard-btn {
  background-color: #1da1f2;
}

.social-buttons .back-btn {
  background-color: #25d366;
}


/* Sorting question styles */
.sorting-section {
  margin-bottom: 20px;
  padding: 15px;
  border-radius: 8px;
  background: #f8f9fa;
}

.sorting-section h4 {
  margin-top: 0;
  margin-bottom: 10px;
  color: #495057;
}

.tangled {
  border: 2px dashed #adb5bd;
}

.sorted {
  border: 2px solid #dee2e6;
}

.draggable-item {
  display: inline-block;
  padding: 8px 12px;
  margin: 5px;
  background: #e9ecef;
  border-radius: 4px;
  cursor: move;
  user-select: none;
  border: 1px solid #ced4da;
}

.draggable-item.dragging {
  opacity: 0.5;
  background: #dee2e6;
}

.drop-slot {
  display: inline-block;
  position: relative;
  align-items: center;
  justify-content: center;
  min-width: 100px;
  min-height: 40px;
  margin: 5px;
  padding: 8px 12px;
  background: white;
  border-radius: 4px;
  border: 2px dashed #adb5bd;
  overflow: hidden;
}


/* Watermark number rendered by CSS, not the DOM */
.drop-slot::before {
  content: attr(data-number);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 700;
  color: rgba(0,0,0,0.1);
  pointer-events: none;
  user-select: none;
}

/* Hide the number when the slot has an item */
.drop-slot.has-item::before {
  display: none;
}

/* Optional: hover/drag-over visuals */
.drop-slot.drag-over {
  border-color: #999;
}

/* Dragging states */
.dragging { opacity: 0.5; }
.dragging-clone {
  z-index: 9999;
  pointer-events: none;
}

/* Helps prevent page from scrolling while dragging on touch devices */
.draggable-item { touch-action: none; }

.drop-slot.drag-over {
  background: #e9ecef;
  border-color: #495057;
}

.drop-slot .dropped-item {
  background: #d1e7dd;
  border-color: #a3cfbb;
  cursor: default;
}


/* Input question styles */
.input-container {
  width: 100%;
  margin-top: 15px;
}

.answer-input {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #dee2e6;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
  max-width: 300px;
}

.answer-input:focus {
  outline: none;
  border-color: #86b7fe;
  box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.math-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.equation-display {
    font-size: 2em;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: monospace;
    color: #004aad;
}

.math-input {
    font-size: 1em;
    width: 80px;
    text-align: center;
    padding: 5px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    font-family: inherit;
}

.math-input:focus {
    border-color: #86b7fe;
    outline: none;
}
.math-input.empty {
    border-color: #ff9999; /* Red border when empty */
}

.math-input:focus {
    border-color: #66ccff; /* Blue border when focused */
    box-shadow: 0 0 5px rgba(102, 204, 255, 0.5);
}



.blank-container {
    display: block; /* Changed from flex to block */
    justify-content: center;
    margin: 20px 0;
}

.blank-display {
    font-size: clamp(16px, 4vw, 21px);
    display: block; /* Changed from flex to block */
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    color: #004aad;
    text-align: left;
    line-height: 1.5; /* Added for better spacing */
}

.blank-input {
    font-size: 1em;
    width: 80px;    
    text-align: left;
    padding: 5px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    font-family: inherit;
    margin: 0 5px; /* Added margin for spacing */
    display: inline-block; /* Changed to inline-block */
    vertical-align: middle; /* Align with text */
}

.blank-input.empty {
    border-color: #ff4d4d; /* Red border when empty */
}

.blank-input:focus {
    border-color: #66ccff; /* Blue border when focused */
    box-shadow: 0 0 5px rgba(102, 204, 255, 0.5);
    outline: none;
}


/* Sorting improvements */
.draggable-item.used {
  opacity: 0.5;
  background: #e9ecef;
  text-decoration: line-through;
}

.draggable-item.dropped {
  background: #d1e7dd;
  border-color: #a3cfbb;
  cursor: default;
}

/* Error state for submit button */
button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}


.listen-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 70px;
  height: 70px;
  margin: 16px 0;   /* no auto centering */
  border: none;
  border-radius: 50%;
  background: #2196f3;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: background 0.3s, transform 0.2s;
  position: relative;
}

.listen-btn::before {
  content: '';
  display: block;
  width: 0;
  height: 0;
  border-left: 20px solid white;  /* triangle */
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  margin-left: 6px; /* keep triangle centered inside */
}

.listen-btn:hover {
  background: #1976d2;
  transform: scale(1.08);
}

.listen-btn:active {
  background: #0d47a1;
  transform: scale(0.95);
}


.emoji {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 15px;
  width: min(36vw, 12rem);       /* Responsive width: 12% of screen, max 3rem */
  aspect-ratio: 1 / 1;          /* Keeps it square */

  font-size: min(15vw, 5rem);  /* Emoji scales with screen size */
  border: 2px solid #ccc;
  border-radius: 0.4em;
  background-color: #f9f9f9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.img-800-200 {
  width: 100%;               /* Increase width */
  max-width: 800px;        /* Allow it to grow a bit beyond 800px */
  aspect-ratio: 4 / 1;  
  margin: 0.5rem 0;
  text-align: left;         /* Ensures left alignment of content */
}

.img-800-200 img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.img-1000-100 {
  width: 100%;          
  max-width: 800px;         
  margin: 0.5rem 0;
  text-align: left;       
}

.img-1000-100 img {
  height: clamp(30px, 5vw, 80px); 
  width: auto;              
  object-fit: contain;      
  display: block;
}

.img-1000-100 img:hover {
  transform: scale(1.03);    /* Slight zoom on hover */
  transition: transform 0.3s ease;
}

.img-500-100 {
  display: flex;               /* Add Flexbox */
  flex-wrap: wrap;             /* Allow wrapping */
  gap: 0.5rem;                 /* Optional: space between images */
  width: 100%;
  max-width: 1200px;
  margin: 0.5rem 0;
  text-align: left;
  font-size: 24px;
}

.img-500-100 img {
  height: clamp(60px, 5vw, 100px);
  width: auto;
  object-fit: contain;
  display: block;
}

.img-500-100 img:hover {
  transform: scale(1.03);
  transition: transform 0.3s ease;
}

.img-500-200 {
  display: flex;               /* Add Flexbox */
  flex-wrap: wrap;             /* Allow wrapping */
  gap: 0.5rem;                 /* Optional: space between images */
  width: 100%;
  max-width: 1200px;
  margin: 0.5rem 0;
  text-align: left;
  font-size: 24px;
}

.img-500-200 img {
  max-width: 100%;     /* Ensures image doesn’t overflow its container */
  height: auto;
  object-fit: contain;
  display: block;
}


.img-512-256 {
  display: flex;               /* Add Flexbox */
  flex-wrap: wrap;             /* Allow wrapping */
  gap: 0.5rem;                 /* Optional: space between images */
  width: 100%;
  max-width: 800px;
  margin: 0.5rem 0;
  text-align: left;
  font-size: 24px;
}

.img-512-256 img {
  height: clamp(100px, 15vw, 256px);
  width: auto;
  object-fit: contain;
  display: block;
}

.img-512-256 img:hover {
  transform: scale(1.03);
  transition: transform 0.3s ease;
}

.single-512-img {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 15px;

  width: min(36vw, 12rem);        /* Responsive: max 8rem or 30% of screen */
  aspect-ratio: 1 / 1;           /* Keeps square shape */

  padding: 0.5rem;
  background-color: #ffffff;
  border: 2px solid #e0e0e0;
  border-radius: 1rem;           /* Soft, kid-friendly corners */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;

  transition: transform 0.2s ease;
}

.single-512-img:hover {
  transform: scale(1.03);        /* Slight zoom on hover for interactivity */
}

.single-512-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (prefers-color-scheme: dark) {
  .single-512-img {
    background-color: #1e1e1e;
    border-color: #333;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.05);
  }
}

.option-512-img {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0px;

  width: min(25vw, 10rem);        /* Responsive: max 8rem or 30% of screen */
  aspect-ratio: 1 / 1;           /* Keeps square shape */

  padding: 0rem;
  background-color: #ffffff;
  border: 2px solid #ffffff;
  border-radius: 1rem;           /* Soft, kid-friendly corners */
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
  overflow: hidden;

  transition: transform 0.2s ease;
}

.option-512-img:hover {
  transform: scale(1.03);        /* Slight zoom on hover for interactivity */
}

.option-512-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

@media (prefers-color-scheme: dark) {
  .option-512-img {
    background-color: #1e1e1e;
    border-color: #333;
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.05);
  }
}

.count-image {
  display: flex;
  flex-wrap: wrap;
  justify-content: left;
  gap: 0.5rem; /* spacing between images */
}

.count-image img {
  width: min(15vw, 5rem);
  aspect-ratio: 1 / 1;
  object-fit: contain;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  padding: 0.1rem;
  background-color: #fff;
  border-radius: 0.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.count-image img:hover {
  transform: scale(1.05) translateY(-4px); /* zoom + lift */
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15); /* more lift shadow */
}

@media (prefers-color-scheme: dark) {
  .count-image img {
    background-color: #1e1e1e;
    border: 1px solid #333;
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.05);
  }

  .count-image img:hover {
    box-shadow: 0 6px 12px rgba(255, 255, 255, 0.1);
  }
}

.number-sequence {
  display: flex;
  gap: 10px;
  justify-content: left;
  flex-wrap: wrap;
  margin: 1em 0;
}

.number {
  font-size: 1.5rem;  
  color: #004aad;     /* Smaller text */
  padding: 0.2em 0.5em;    /* Less space inside the box */
  min-width: 40px;         /* Smaller minimum width */
  text-align: center;
  display: inline-block;
  border: 2px solid #38b6ff;
  border-radius: 6px;
}

.number.blank {
  border-style: dashed;
  color: #aaa;
}

.fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    font-size: 1.2em;
    margin: 0 0.5em;
  }

  .fraction .top {
    font-size: 0.8em;
    line-height: 1;
  }

  .fraction .line {
    width: 100%;
    height: 1px;
    background: #000;
    margin: 1px 0;
  }

  .fraction .bottom {
    font-size: 0.8em;
    line-height: 1;
  }



  .math-stack {
    display: inline-block;
    font-family: monospace;
    line-height: 1.4;
    text-align: right;
    margin: 0.5em 0;
    white-space: pre;
    font-size: 1.5rem; 
  }

  .math-stack .line-item {
    padding-right: 0.5em;
  }

  .math-stack .operator::before {
    content: attr(data-op);
    margin-right: 0.3em;
  }

  .math-line {
    border-bottom: 2px solid #000;
    width: 100%;
    margin-top: 2px;
    margin-bottom: 2px;
  }
  
  .math-stack .result {
  padding-right: 0.5em;
  }

.text-block {
  background-color: #f5f3f3;
  border: 1px solid #ddd;
  border-radius: 0.75rem;
  padding: 1rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  font-family: "Verdana", serif;
  font-size: clamp(0.8rem, 2vw, 1.0rem);
  line-height: 1.6;

  display: inline-block;  /* ✅ shrink & grow to text */
  max-width: 100%; 
  overflow: hidden;
}

/* Float the image to the left to allow text to wrap around it */
.text-block img {
  float: left;
  margin-right: 1rem;
  /*width: clamp(150px, 30vw, 300px);*/
  max-width: 100%;   /* shrink to fit container on small screens */
  height: auto;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.text-block img {
  float: left;
  margin-right: 1rem;
  max-width: 100%;   /* shrink to fit container on small screens */
  height: auto;      /* keep aspect ratio */
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Question text below the text */
.question-text {
  font-family: "Verdana", sans-serif;
  font-weight: 500;
  font-size: clamp(0.8rem, 2.2vw, 1.0rem);
  margin-top: 0.5rem;
  color: #004aad;
}

    
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

.my-breadcrumbs {
  background-color: #ffffff;
  padding: 8px 12px;
  font-size: 14px;
  font-family: Arial, sans-serif;
  color: #333;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.my-breadcrumbs a {
  text-decoration: none;
  color: #007BFF;
}

.my-breadcrumbs a:hover {
  text-decoration: underline;
}

.my-breadcrumbs > *::after {
  content: ">";
  margin: 0 6px;
  color: #888;
}

.my-breadcrumbs > *:last-child::after {
  content: "";
}

@media (max-width: 600px) {
  .my-breadcrumbs {
    font-size: 12px;
    padding: 4px 8px;
  }
}

 /* Add this new style to handle the visibility toggling */
.section-toggle {
    display: none;
}
.section-toggle.active {
    display: block;
}

.section-switch {
  padding: 10px 20px;
  text-align: center;
  font-size: clamp(0.75rem, 2.2vw, 1rem);
  font-weight: 500;
}
.section-switch a {
  color: #0077cc;
  text-decoration: none;
  font-weight: bold;
}
.section-switch a:hover {
  text-decoration: underline;
}

.study-page {
    max-width: 1200px;
    margin: 0 auto;
    margin-bottom: 20px;
    margin-top: 20px;
    padding: 10px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.study-page .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

    
.study-page header {
    background-color: #e8f4fc;
    color: rgb(0, 0, 0);
    padding: 30px 0;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 8px;
}

.study-page h1 {
    font-size: 2.0rem;
    margin-bottom: 10px;
}

.study-page h2 {
    color: #2c3e50;
    margin: 25px 0 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eaecef;
}

.study-page h3 {
    color: #3498db;
    margin: 20px 0 10px;
}

.study-page p {
    margin-bottom: 15px;
    font-size: 1.1rem;
    line-height: 1.5;
    padding: 10px;
}


.study-page .definition-box {
    background-color: #e8f4fc;
    border-left: 5px solid #3498db;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.study-page .example-box {
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto; /* Allows horizontal scrolling if needed */
}

.study-page .example-title {
    font-weight: bold;
    color: #27ae60;
    margin-bottom: 10px;
}

.study-page .example-box pre {
  font-family: "Courier New", Courier, monospace;
  font-size: 1.3rem;
  line-height: 1.3;
  color: #333;
  background-color: #ffffff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 16px;
  margin: 10px 0;
  white-space: pre;
}


.study-page .highlight {
    background-color: #fffcd7;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: bold;
}

.study-page ul, 
.study-page ol {
    margin-left: 20px;
    margin-bottom: 20px;
    padding-left: 10px;
}

.study-page li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.study-page .note {
    background-color: #fff8e1;
    border-left: 5px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 8px 8px 0;
}

.study-page .note-title {
    font-weight: bold;
    color: #f39c12;
    margin-bottom: 8px;
}

.study-page .comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    min-width: 300px; /* Minimum width before scrolling */
}

.study-page .comparison-table th, 
.study-page .comparison-table td {
    border: 1px solid #ddd;
    padding: 10px;
    text-align: left;
}

.study-page .comparison-table th {
    background-color: #f2f2f2;
}

.study-page .comparison-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.study-page .quote-box {
    font-style: italic;
    padding: 15px;
    margin: 15px 0;
    border-left: 3px solid #3498db;
    background-color: #f8f9fa;
}

/* Mobile-specific styles */
@media (max-width: 768px) {
    .study-page .container {
        padding: 15px;
        width: 90%;
    }
    
    .study-page header {
        padding: 20px 0;
        margin-bottom: 20px;
    }
    
    .study-page h1 {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    
    .study-page h2 {
        font-size: 1.5rem;
        margin: 20px 0 12px;
    }
    
    .study-page h3 {
        font-size: 1.3rem;
        margin: 18px 0 10px;
    }
    
    .study-page p {
        font-size: 1rem;
    }
    
    .study-page .definition-box,
    .study-page .note {
        padding: 15px;
        margin: 15px 0;
    }
    
    .study-page ul,
    .study-page ol {
        margin-left: 15px;
    }
    
    /* Make tables scroll horizontally on mobile */
    .study-page .example-box {
        padding: 10px;
        -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    }
    
    .study-page .comparison-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .study-page .comparison-table th,
    .study-page .comparison-table td {
        min-width: 120px; /* Ensure cells are wide enough */
        padding: 8px 10px;
    }
}

/* Extra small devices (phones, 480px and down) */
@media (max-width: 480px) {
    .study-page {
        width: 90%;
    }
    .study-page h1 {
        font-size: 1.5rem;
    }
    
    .study-page h2 {
        font-size: 1.3rem;
    }
    
    .study-page h3 {
        font-size: 1.1rem;
    }
    
    .study-page .comparison-table th,
    .study-page .comparison-table td {
        font-size: 0.9rem;
        padding: 6px 8px;
    }
}


.contact-section .contact-link {
    color: #0077cc;
    margin-right: 10px;
}

.contact-section .contact-link:hover {
    color: #005299;
    text-decoration: underline;
}

.word-grid-container {
  display: flex;
  gap: 20px;
  margin: 15px 0;
}

.word-group {
    flex: 1;
}

.word-group h3 {
    margin: 0 0 8px 0;
    font-size: 1rem;
    color: #555;
}

.word-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.word-grid span {
    background-color: #f0f7ff;
    padding: 8px 12px;
    border-radius: 4px;
    text-align: center;
    font-size: 1.1rem;
}
