
/* 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 bottom, #25d36550, #38b6ff48);
  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: 1024px;
  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 */
}

#app #quiz-title {
  display: none;
}

/* 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(1rem, 2vw, 1.1rem);
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  margin: 20px 0 20px; /* Reduced top margin */
  text-align: left;
  padding: 0 10px;
  line-height: 1.7; /* Adjust this value as needed */
}


.question-text {
  font-family: "Verdana", sans-serif;
  font-weight: 500;
  font-size: clamp(1rem, 2vw, 1.1rem);
  margin-top: 0.5rem;
  color: #004aad;
}

/* 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: 1rem;
  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: 15%;                 /* start ~15% from top */
  left: 50%;
  transform: translateX(-50%); /* center horizontally only */
  background: white;
  border-radius: 10px;
  z-index: 1000;
  width: 90%;
  max-width: 1024px;
  display: none;
  flex-direction: column;
  padding: 25px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  max-height: 80vh;          /* shrink height to fit new layout */
  overflow-y: auto;          /* scroll if 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;
}

.answer-section.question {
  margin-bottom: 1em;
  padding: 10px;
  background: #f9f9f9;
  border-left: 4px solid #007bff;
}


.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;
}





/* 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);
}


.img-200 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 200px;
  width: 100%;
  margin: 0.5rem 0;
  text-align: left;
  font-size: clamp(0.75rem, 2.2vw, 1rem);
}

.img-200 img {
  display: block;
  width: 100%; 
  height: auto;
  object-fit: contain;
}
@media (max-width: 512px) {
  .img-max {
    text-align: center;   /* center image on mobile */
    margin-left: auto;
    margin-right: auto;
  }
}

.img-350 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 350px;
  width: 100%;
  margin: 0.5rem 0;
  text-align: left;
  font-size: clamp(0.75rem, 2.2vw, 1rem);
}

.img-350 img {
  display: block;
  width: 100%; 
  height: auto;
  object-fit: contain;
}


.img-512 {
  display: flex;               /* Flexbox layout */
  flex-wrap: wrap;             /* Allow wrapping */
  gap: 0.5rem;                 /* Space between images */
  width: clamp(350px, 80vw, 512px); /* <- control overall width range */
  max-width: 100%;             /* never exceed screen */
  margin: 0.5rem 0;
  text-align: left;
  font-size: clamp(0.75rem, 2.2vw, 1rem);
}

.img-512 img {
  display: block;
  width: auto;        /* natural size */
  max-width: 100%;    /* shrink to fit container */
  height: auto;       /* keep aspect ratio */
  object-fit: contain;
}

.img-768 {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  width: clamp(350px, 80vw, 768px);
  max-width: 100%;
  margin: 0.5rem 0;
  text-align: left;
  font-size: clamp(0.75rem, 2.2vw, 1rem);
}

.img-768 img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.option-512-img {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  margin: 0px;

  width: min(25vw, 10rem);       
  aspect-ratio: 1 / 1;          

  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;
}


/* Main question styling */
.question-text {
  font-size: 16px;
  color: #004080; /* dark blue for readability */
  margin-bottom: 20px;
  font-weight: 500;
}

/* Just to display two numbers as a fraction - start */
.fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;  /* centers numerator & denominator */
  font-size: 1em;
  margin: 0 0.3em;
  vertical-align: middle;   /* keeps fraction aligned with text */
  line-height: 1;           /* removes extra spacing */
}

.fraction .top,
.fraction .bottom {
  font-size: 1em;
  line-height: 1;
}

.fraction .line {
  width: 100%;
  height: 1px;
  background: #000;
  margin: 2px 0;
}
/* Just to display two numbers as a fraction - end */

/* Fractions operations */
.fraction-container {
  display: flex;
  align-items: center;
  justify-content: left;
  gap: 20px; /* space between fractions and operators */
  margin: 20px 0;
  flex-wrap: wrap;            /* ✅ allows wrapping on small screens */
  max-width: 100%;            /* ✅ prevent overflow */
  overflow-x: auto;           /* ✅ allow horizontal scroll if very complex */
  padding: 10px;
  box-sizing: border-box;
}

/* Wrapper for each fraction */
.fraction-wrapper {
  display: flex;
  align-items: center;
  gap: 8px; /* space between whole number and stacked fraction */
  flex-shrink: 0;             /* ✅ prevents fractions from squishing too much */
  margin: 5px 0;
}

/* Stacked numerator/denominator */
.fraction-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 40px;
  position: relative;
  padding: 0 4px;
}

/* Fraction line */
.fraction-line {
  width: 100%;
  height: 2px;
  background: #004080; /* dark blue for consistency */
  margin: 4px 0;
}

/* Input boxes */
.fraction-input {
  width: 42px;
  height: 34px;
  text-align: center;
  font-size: 16px;
  border: 2px solid #66b3ff; /* light blue border */
  border-radius: 6px;
  outline: none;
  transition: 0.2s ease;
}

.fraction-input:focus {
  border-color: #004080;
  box-shadow: 0 0 6px rgba(0, 64, 128, 0.3);
}

/* Operator (+, −, ×, ÷) */
.fraction-operator {
  font-size: 20px;
  font-weight: bold;
  color: #004080;
  margin: 0 10px;
}

/* Smooth spacing for mixed numbers */
.fraction-wrapper span {
  font-size: clamp(1rem, 2vw, 1.1rem);
  font-weight: 500;
  color: #004080;
}

/* Mobile adjustments */
@media (max-width: 600px) {
  .fraction-container {
    gap: 12px;                /* smaller spacing */
  }

  .fraction-input {
    width: 32px;              /* ✅ smaller inputs on mobile */
    height: 28px;
    font-size: 14px;
  }

  .fraction-operator {
    font-size: 18px;
    margin: 0 6px;
  }
}


/* Container remains right-aligned overall */
.operation-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end; /* keep numbers right-aligned */
  font-family: Verdana, Geneva, Tahoma, sans-serif;
  margin: 10px 0;
  padding-left: 0;
}

/* Each row keeps operator and number aligned to the right */
.operation-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Operator column (keeps +,- aligned) */
.operation-operator {
  width: 1.5em;         /* fixed column for the operator */
  text-align: right;
  font-weight: 700;
  color: #004080;
  margin-right: 6px;    /* space between operator and number column */
}

/* Number column: width comes from JS via --number-width */
.stack-number {
  text-align: right;
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  white-space: pre;
  letter-spacing: 6px;
  min-width: var(--number-width, auto);  /* JS will set this variable */
}

/* Horizontal line spans the rest of the block */
.operation-line-row {
  width: 100%;
  display: flex;
  align-items: center;
}
.operation-line {
  height: 2px;
  background: #004080;
  flex: 1;
  margin-top: 4px;
  margin-bottom: 4px;
}

/* Answer area right-aligned like the numbers above */
.operation-answer-wrapper {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

/* Input: no left-margin (was moving whole container). 
   Right edge of typed digits will align with the digits above. */
.operation-input {
  border: 2px solid #66b3ff;
  border-radius: 6px;
  text-align: right;
  font-family: inherit;
  font-size: 1.1rem;
  letter-spacing: 6px;

  /* keep box-sizing as content-box so JS-set width matches measured text width */
  box-sizing: content-box;

  /* We set width from JS. Keep reasonable fallback */
  width: auto;
  min-width: 3ch;

  /* Important: right padding = 0 so digits align to the right edge;
     left padding just gives breathing room */
  padding: 2px 0 2px 6px;

  /* small vertical spacing so it doesn't touch the line */
  margin-top: 4px;
  margin-bottom: 2px;

  line-height: 1.2;
}

.operation-input:focus {
  border-color: #004080;
  box-shadow: 0 0 4px rgba(0,64,128,0.25);
}



.operation-input[disabled] {
  background: #f5f5f5;
  color: #555;
  border-color: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}
/* ✅ Ensure operation question in feedback modal aligns left */
.modal .operation-container {
  align-items: flex-end;    /* keep numbers aligned to the right edge */
  margin: 10px 0;           /* remove auto-centering */
  display: inline-flex;     /* keep stack structure */
  justify-content: flex-start; /* ensure it's left aligned in modal */
}


.division-container {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.division-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.division-quotient-row {
  display: flex;
  justify-content: flex-end;
  width: 100%;
}

.division-row {
  display: flex;
  align-items: center;
  gap: 10px; 
  padding-bottom: 5px;
}

.division-divisor,
.division-dividend {
  text-align: center;
  font-size: 1.2em;
  font-weight: bold;
  min-width: var(--number-width);
}

.division-symbol {
  font-size: 1.5em;
  font-weight: normal;
  transform: scale(1.5);
  margin: 0 -10px;
}

.division-remainder-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.remainder-label {
  font-weight: bold;
  color: #666;
}

.division-input {
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 1.1em;
  text-align: center;
  font-family: inherit;
}

.division-input:focus {
  border-color: #4A90E2;
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.division-input.disabled {
  background-color: #f5f5f5;
  color: #333;
  cursor: not-allowed;
}

/* ✅ Ensure division question in feedback modal aligns left */
.modal .division-container {
  display: inline-flex;          
  flex-direction: column;        
  align-items: flex-start;      
  justify-content: flex-start;  
  margin: 10px 0;               
  text-align: left !important;   /* override modal centering text */
}

/* Keep numbers neat inside */
.modal .division-row,
.modal .division-answer-row {
  justify-content: flex-start;
  text-align: left;
}

/* Ensure inputs stay visible and aligned left */
.modal .division-container input {
  text-align: center;
  opacity: 1;
  background-color: #f9f9f9;
  color: #333;
}


  

.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.9rem, 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);
}

    
.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;
}
