/* Root Variable Definitions */
:root {
  --ink: #0f172a;
  --muted: #475569;
  --accent: #10b981;
  --bg: #ffffff;
  --card: #f8fafc;
  --border: #e2e8f0;
  --shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
  --fs-body: clamp(14px, 3.2vw, 16px);
  --fs-small: clamp(12px, 2.6vw, 14px);
  --fs-h1: clamp(22px, 5vw, 30px);
  --fs-h2: clamp(18px, 4vw, 24px);
  --radius: 14px;
}

/* General Layout */
body, html {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.wrap, .container, .content-area, .sidebar, .right-panel {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Header Styling */
header {
  padding: 14px 16px;
  text-align: center;
  background: linear-gradient(90deg, #10b98122, #06b6d422);
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-size: var(--fs-h1);
  margin: 0 0 6px;
  color: #0f172a;
  font-weight: 700;
}

/* Main Content Layout */
main {
  max-width: 900px;
  margin: auto;
  padding: 1.5rem;
}

/* Section Styling */
section {
  background: #fff;
  margin-bottom: 1.5rem;
  padding: 1.2rem;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

h2 {
  font-size: 1.2rem;
  color: #0f172a;
  margin-bottom: 0.5rem;
}

.question {
  font-weight: bold;
  margin-top: 1rem;
}

/* Button Options */
.options button {
  display: block;
  width: 100%;
  margin: 0.4rem 0;
  padding: 0.6rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f8f9fa;
  cursor: pointer;
  text-align: left;
  transition: background 0.3s ease;
}

.options button:hover {
  background: #eef2ff;
}

.options button.correct {
  background: #d1fae5;
  border-color: #10b981;
  color: #065f46;
  font-weight: bold;
}

.options button.wrong {
  background: #fee2e2;
  border-color: #dc2626;
  color: #991b1b;
}

/* Answer Box */
.answer {
  display: none;
  margin-top: 0.8rem;
  padding: 0.8rem;
  border-left: 4px solid #10b981;
  background: #ecfdf5;
  border-radius: 6px;
}

/* Footer Styling */
footer {
  text-align: center;
  padding: 1rem;
  background: #0f172a;
  color: #fff;
  margin-top: 2rem;
}

/* Media Queries for Mobile View */
@media (max-width: 768px) {
  /* Adjust main container padding */
  main {
    padding: 1rem;
  }

  /* Adjust section padding */
  section {
    padding: 1rem;
  }

  /* Ensure the answer box fits and doesn't get cut off */
  .answer {
    padding: 0.6rem; /* Slightly reduce padding for mobile */
    font-size: 0.9rem; /* Slightly smaller text for mobile */
  }

  /* Ensure buttons are well spaced on mobile */
  .options button {
    padding: 0.5rem;
  }

  /* Adjust header font size for mobile */
  header h1 {
    font-size: 1.6rem; /* Slightly smaller font for smaller screens */
  }

  /* Footer text scaling for smaller devices */
  footer {
    font-size: 0.9rem;
  }
}

/* For Very Small Screens */
@media (max-width: 480px) {
  .answer {
    padding: 0.5rem; /* Further reduce padding */
  }

  header h1 {
    font-size: 1.4rem; /* Ensure header fits on small screens */
  }

  footer {
    font-size: 0.8rem; /* Smaller footer text */
  }
}

/* MathJax / LaTeX */
.eq {
  overflow-x: auto;   /* Enable horizontal scrolling if needed */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
  padding: 0.5rem 0;
  margin: 0.5rem 0;
  text-align: center; /* Center by default */
  max-width: 100%;
  /*word-wrap: break-word;  */
}

.eq mjx-container {
  max-width: 100% !important;
  overflow-x: auto !important;
  display: inline-block;
  white-space: nowrap;
  word-wrap: break-word;  /* Prevent text from overflowing */
  word-break: normal;
  overflow-wrap: normal;

}


/* Mobile-Specific Styles for Equations */
@media (max-width: 768px) {
  /* For small screens, allow scrolling of equations and adjust font size */
  .eq {
    font-size: 0.85rem;  /* Scale down font size for mobile */
  }

  .eq mjx-container {
    font-size: 0.85rem;  /* Scale down font size for mobile */
  }

  /* Allow horizontal scrolling if equation overflows */
  .eq {
    overflow-x: auto;  /* Enable horizontal scrolling for large content */
  }
}

/* For Very Small Screens */
@media (max-width: 480px) {
  .eq {
    padding: 0.5rem;  /* Reduce padding on smaller screens */
    font-size: 0.8rem; /* Smaller font size for very small screens */
  }

  .eq mjx-container {
    font-size: 0.8rem; /* Adjust the font size for smaller devices */
  }
}

/* Mobile Compatibility for Footer */
.site-footer, .footer-wrap, .footer-legal {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/*dropdown menu css */
/* Position dropdowns properly */
.dropdown {
  position: relative;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  padding: 0.5rem 0;
  z-index: 2000;
}

/* Show dropdown on hover (desktop) */
.dropdown:hover > .dropdown-menu {
  display: block;
}

/* Style dropdown links */
.dropdown-menu li {
  list-style: none;
}
.dropdown-menu li a {
  display: block;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: var(--ink);
  font-size: 0.95rem;
  transition: background 0.2s ease;
}
.dropdown-menu li a:hover {
  background: rgba(16,185,129,0.08);
  color: var(--accent);
}
