/* ==========================================================================
   STUDY MENU OVERLAY - SaveMyExams Style (Pixel-Close Match)
   Wide sheet overlay, NOT a centered modal
   ========================================================================== */

/* Overlay Backdrop - Dimmed background */
.study-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.study-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   MAIN PANEL - Wide Sheet (NOT a small centered modal)
   ========================================================================== */
.study-menu-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 24px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.study-menu-panel.active {
  opacity: 1;
  visibility: visible;
}

/* The actual white sheet */
.study-menu-sheet {
  background: #ffffff;
  width: 100%;
  max-width: 1140px;
  min-height: 520px;
  border-radius: 12px;
  box-shadow: 
    0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 10px 40px -5px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  position: relative;
  animation: studyMenuSlideIn 0.25s ease-out;
}

@keyframes studyMenuSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   HEADER - Breadcrumb + Close Button
   ========================================================================== */
.study-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

/* Breadcrumb: GCSE > Maths */
.study-menu-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
}

.study-menu-breadcrumb-link {
  color: #6b7280;
  text-decoration: none;
  transition: color 0.15s ease;
}

.study-menu-breadcrumb-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

.study-menu-breadcrumb-separator {
  color: #9ca3af;
  font-size: 11px;
}

.study-menu-breadcrumb-current {
  color: #111827;
  font-weight: 600;
}

/* Close Button - Simple circular with subtle border */
.study-menu-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.15s ease;
  color: #6b7280;
  flex-shrink: 0;
}

.study-menu-close:hover {
  background: #f9fafb;
  border-color: #d1d5db;
  color: #374151;
}

.study-menu-close svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   BODY - Two Column Layout with Vertical Divider
   ========================================================================== */
.study-menu-body {
  display: flex;
  flex: 1;
  min-height: 0;
}

/* ==========================================================================
   LEFT COLUMN - All Subjects
   ========================================================================== */
.study-menu-subjects {
  width: 240px;
  min-width: 240px;
  padding: 28px 0;
  border-right: 1px solid #e5e7eb; /* Vertical divider */
  overflow-y: auto;
  flex-shrink: 0;
}

/* "All subjects" title - Large bold */
.study-menu-subjects-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  padding: 0 24px;
  margin: 0 0 20px 0;
}

/* "Most popular" subtitle - Small bold */
.study-menu-subjects-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #6b7280;
  padding: 0 24px;
  margin: 0 0 12px 0;
}

/* Subject list */
.study-menu-subjects-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 12px;
}

/* Individual subject item - NO emojis, minimal styling */
.study-menu-subject-item {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  transition: all 0.12s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  line-height: 1.4;
}

.study-menu-subject-item:hover {
  background: #f3f4f6;
  color: #111827;
}

/* Selected subject - Light grey rounded bar (NOT blue) */
.study-menu-subject-item.active {
  background: #f3f4f6;
  color: #111827;
  font-weight: 600;
}

/* ==========================================================================
   RIGHT COLUMN - Boards (AQA, Edexcel, etc.)
   ========================================================================== */
.study-menu-content {
  flex: 1;
  padding: 28px 32px;
  overflow-y: auto;
}

/* Board Section (e.g., "AQA") */
.study-menu-board {
  margin-bottom: 40px;
}

.study-menu-board:last-child {
  margin-bottom: 0;
}

/* Board Title - Large bold with subtle underline */
.study-menu-board-title {
  font-size: 18px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 24px 0;
  padding-bottom: 16px;
  border-bottom: 1px solid #e5e7eb;
}

/* ==========================================================================
   TIER GRID - Foundation / Higher Columns
   ========================================================================== */
.study-menu-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.study-menu-tier {
  min-width: 0;
}

/* Tier Header: "Maths" + Pill */
.study-menu-tier-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
}

.study-menu-tier-name {
  font-size: 15px;
  font-weight: 600;
  color: #374151;
  margin: 0;
}

/* Pills - Small capsules like SaveMyExams */
.study-menu-tier-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: capitalize;
  letter-spacing: 0.02em;
}

.study-menu-tier-pill.foundation {
  background: #dcfce7;
  color: #166534;
}

.study-menu-tier-pill.higher {
  background: #fee2e2;
  color: #b91c1c;
}

/* ==========================================================================
   LINKS - Grey text, blue hover with underline
   ========================================================================== */
.study-menu-links {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.study-menu-link {
  display: block;
  padding: 9px 0;
  font-size: 14px;
  font-weight: 500;
  color: #4b5563;
  text-decoration: none;
  transition: color 0.12s ease;
  border-bottom: 1px solid transparent;
}

.study-menu-link:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* Last link - no extra spacing */
.study-menu-link:last-child {
  padding-bottom: 0;
}

/* ==========================================================================
   BODY SCROLL LOCK
   ========================================================================== */
body.study-menu-open {
  overflow: hidden !important;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   MOBILE RESPONSIVE - Full Screen Sheet
   ========================================================================== */
@media (max-width: 900px) {
  .study-menu-panel {
    padding: 0;
    align-items: stretch;
  }

  .study-menu-sheet {
    max-width: 100%;
    border-radius: 0;
    min-height: 100%;
  }

  .study-menu-tiers {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .study-menu-body {
    flex-direction: column;
  }

  .study-menu-subjects {
    width: 100%;
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
    padding: 20px 0;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
  }

  .study-menu-subjects-title {
    font-size: 16px;
    padding: 0 20px;
    margin-bottom: 12px;
  }

  .study-menu-subjects-section-title {
    padding: 0 20px;
    margin-bottom: 10px;
  }

  .study-menu-subjects-list {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 16px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .study-menu-subjects-list::-webkit-scrollbar {
    display: none;
  }

  .study-menu-subject-item {
    flex-shrink: 0;
    padding: 8px 16px;
    white-space: nowrap;
    border-radius: 100px;
    border: 1px solid #e5e7eb;
    background: #fff;
  }

  .study-menu-subject-item.active {
    background: #f3f4f6;
    border-color: #d1d5db;
  }

  .study-menu-content {
    flex: 1;
    padding: 24px 20px;
    overflow-y: auto;
  }

  .study-menu-header {
    padding: 16px 20px;
  }

  .study-menu-board-title {
    font-size: 16px;
    margin-bottom: 20px;
    padding-bottom: 12px;
  }

  .study-menu-tier-header {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .study-menu-breadcrumb {
    font-size: 12px;
  }

  .study-menu-tier-name {
    font-size: 14px;
  }

  .study-menu-link {
    font-size: 13px;
    padding: 8px 0;
  }
}
