/* ==========================================================================
   NoteGov Exam Directory & Dashboard Styles
   Matches the 3-Column SaaS Layout with Left Vertical Sidebar
   ========================================================================== */

:root {
  --dir-bg: #faf8f5;
  --dir-sidebar-bg: #ffffff;
  --dir-card-bg: #ffffff;
  --dir-text: #1e293b;
  --dir-heading: #0f172a;
  --dir-muted: #64748b;
  --dir-border: #ebe6df;
  --dir-card-border: #e7e2da;
  --dir-orange: #ea580c;
  --dir-orange-hover: #c2410c;
  --dir-peach: #ffefe5;
  --dir-spine-blue: #5b9bd5;
  --dir-spine-amber: #e69a28;
}

body:has(.notegov-app-shell) {
  background-color: var(--dir-bg);
  color: var(--dir-text);
  color-scheme: light;
  margin: 0;
  padding: 0;
}

/* -------------------------------------------------------------
   1. App Shell Architecture (3-Column Desktop Layout)
   ------------------------------------------------------------- */
.notegov-app-shell {
  display: flex;
  min-height: 100vh;
  background: var(--dir-bg);
  color: var(--dir-text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  box-sizing: border-box;
}

/* -------------------------------------------------------------
   2. Left Vertical Sidebar Navigation
   ------------------------------------------------------------- */
.dir-sidebar-left {
  width: 215px;
  flex-shrink: 0;
  background: var(--dir-sidebar-bg);
  border-right: 1px solid var(--dir-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1.5rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  box-sizing: border-box;
  z-index: 50;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--dir-heading);
  margin-bottom: 1.75rem;
  padding: 0 0.35rem;
}

.brand-icon-wrap {
  width: 34px;
  height: 34px;
  background: #0b1434;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-icon-wrap img {
  width: 22px;
  height: 22px;
  display: block;
}

.brand-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--dir-heading);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  width: 100%;
  text-align: left;
  box-sizing: border-box;
}

.sidebar-nav-item svg {
  flex-shrink: 0;
  color: #475569;
  transition: color 0.15s ease;
}

.sidebar-nav-item:hover {
  background: #f4efe9;
  color: var(--dir-heading);
}

.sidebar-nav-item:hover svg {
  color: var(--dir-heading);
}

.sidebar-nav-item.active {
  background: var(--dir-peach);
  color: var(--dir-heading);
  font-weight: 700;
}

.sidebar-nav-item.active svg {
  color: var(--dir-orange);
}

.sidebar-bottom {
  border-top: 1px solid var(--dir-border);
  padding-top: 1.15rem;
  margin-top: auto;
}

.sidebar-lang-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0 0.35rem;
}

.lang-btn {
  background: none;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  font-family: inherit;
  transition: color 0.15s ease;
}

.lang-btn.active {
  color: var(--dir-orange);
}

.lang-btn:hover {
  color: var(--dir-orange-hover);
}

.lang-slash {
  color: #cbd5e1;
  font-size: 0.88rem;
  user-select: none;
}

/* -------------------------------------------------------------
   3. Main Content & Right Sidebar Container
   ------------------------------------------------------------- */
.dir-main-wrapper {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 2rem;
  padding: 1.75rem 2.25rem 3.5rem 2.25rem;
  max-width: 1380px;
  box-sizing: border-box;
}

/* -------------------------------------------------------------
   4. Middle Center Column (Explore exams, Boards, Competitive)
   ------------------------------------------------------------- */
.dir-center-col {
  display: flex;
  flex-direction: column;
}

.page-title {
  font-family: Georgia, 'Playfair Display', 'Times New Roman', serif;
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--dir-heading);
  margin: 0 0 1.5rem 0;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.exam-section {
  margin-bottom: 2.25rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.section-head h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dir-heading);
  margin: 0;
  letter-spacing: -0.015em;
}

.view-all-link {
  color: var(--dir-orange);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
  transition: transform 0.15s ease, color 0.15s ease;
}

.view-all-link:hover {
  color: var(--dir-orange-hover);
  transform: translateX(2px);
}

/* Grid Layouts */
.board-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.competitive-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.15rem;
}

/* -------------------------------------------------------------
   5. Exam Card Component with Colored Spine & Dog-Ear Fold
   ------------------------------------------------------------- */
.exam-card {
  position: relative;
  background: var(--dir-card-bg);
  border-radius: 12px;
  border: 1px solid var(--dir-card-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.025);
  padding: 1.25rem 1.15rem 1.25rem 2.1rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 120px;
  box-sizing: border-box;
}

.exam-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
  border-color: #d8d2c8;
}

/* Left Colored Spine */
.exam-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 12px;
  background: var(--spine-color, var(--dir-spine-blue));
  border-top-left-radius: 11px;
  border-bottom-left-radius: 11px;
}

.exam-card.board {
  --spine-color: var(--dir-spine-blue);
}

.exam-card.competitive {
  --spine-color: var(--dir-spine-amber);
}

/* Dog-Ear Corner Fold */
.card-dogear {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 18px;
  height: 18px;
  background: linear-gradient(135deg, transparent 50%, #d4cec4 50%, #eae6de 65%, #dfdad2 100%);
  border-top-left-radius: 3px;
  box-shadow: -1px -1px 2px rgba(0, 0, 0, 0.05);
  pointer-events: none;
}

/* Card Top Row */
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.card-icon-wrap {
  color: #1e293b;
  display: inline-flex;
}

.card-icon-wrap svg {
  display: block;
}

.card-bookmark-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 2px;
  display: inline-flex;
  transition: color 0.15s ease, transform 0.15s ease;
}

.card-bookmark-btn:hover {
  color: var(--dir-heading);
  transform: scale(1.1);
}

.card-bookmark-btn.saved,
.card-bookmark-btn[aria-pressed="true"] {
  color: var(--dir-orange);
}

.card-body h3 {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--dir-heading);
  margin: 0 0 0.35rem 0;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--dir-muted);
  margin: 0;
  line-height: 1.4;
}

/* -------------------------------------------------------------
   6. Right Sidebar Column (Search & Widgets)
   ------------------------------------------------------------- */
.dir-right-col {
  display: flex;
  flex-direction: column;
}

/* Search Box Wrap */
.search-box-wrap {
  position: relative;
  width: 100%;
  margin-bottom: 1.35rem;
}

.mobile-search-only {
  display: none;
}

.search-box-wrap svg.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}

.search-box-wrap input {
  width: 100%;
  padding: 0.65rem 0.85rem 0.65rem 2.45rem;
  border-radius: 8px;
  border: 1px solid var(--dir-card-border);
  background: #ffffff;
  font-size: 0.88rem;
  color: var(--dir-heading);
  box-sizing: border-box;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box-wrap input:focus {
  border-color: var(--dir-orange);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.12);
}

.search-box-wrap .clear-search-btn {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  display: none;
}

.search-box-wrap .clear-search-btn:hover {
  color: var(--dir-heading);
}

/* Widget 1: Exam updates Card */
.widget-card {
  background: var(--dir-card-bg);
  border-radius: 12px;
  border: 1px solid var(--dir-card-border);
  padding: 1.15rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.025);
}

.widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.widget-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.widget-title-wrap svg {
  color: var(--dir-heading);
}

.widget-title-wrap h2 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--dir-heading);
  margin: 0;
  letter-spacing: -0.015em;
}

.badge-sample {
  background: #f1f5f9;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Updates Tabs */
.updates-tabs {
  display: flex;
  gap: 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.75rem;
}

.update-tab-btn {
  background: none;
  border: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: #64748b;
  padding: 0 0 0.5rem 0;
  cursor: pointer;
  position: relative;
  font-family: inherit;
  transition: color 0.15s ease;
}

.update-tab-btn:hover {
  color: var(--dir-heading);
}

.update-tab-btn.active {
  color: var(--dir-heading);
  font-weight: 700;
}

.update-tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--dir-orange);
  border-radius: 2px 2px 0 0;
}

/* Updates List */
.updates-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.update-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.4rem;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease;
  box-sizing: border-box;
}

.update-row:hover {
  background: #fdfaf7;
}

.update-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.update-icon-box {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.update-icon-box.orange-box {
  background: #ffeedb;
  color: #d97706;
}

.update-icon-box.purple-box {
  background: #f3e8ff;
  color: #9333ea;
}

.update-icon-box.blue-box {
  background: #eff6ff;
  color: #2563eb;
}

.update-icon-box.green-box {
  background: #f0fdf4;
  color: #16a34a;
}

.update-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.update-item-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--dir-heading);
  line-height: 1.25;
}

.update-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  width: fit-content;
}

.update-tag.tag-orange {
  background: #ffedd5;
  color: #9a3412;
}

.update-tag.tag-purple {
  background: #f3e8ff;
  color: #7e22ce;
}

.update-tag.tag-blue {
  background: #e0f2fe;
  color: #0369a1;
}

.update-tag.tag-green {
  background: #dcfce7;
  color: #15803d;
}

.update-chevron {
  color: #94a3b8;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1;
}

.view-all-updates-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.85rem;
  color: var(--dir-orange);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
  transition: transform 0.15s ease;
}

.view-all-updates-link:hover {
  color: var(--dir-orange-hover);
  transform: translateX(2px);
}

/* Widget 2: Upcoming Dates Card */
.upcoming-dates-card {
  margin-top: 1.15rem;
  background: var(--dir-card-bg);
  border-radius: 12px;
  border: 1px solid var(--dir-card-border);
  padding: 1.15rem;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.025);
}

.upcoming-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff4ec;
  color: var(--dir-orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.upcoming-content {
  display: flex;
  flex-direction: column;
}

.upcoming-content h2 {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--dir-heading);
  margin: 0 0 0.2rem 0;
}

.upcoming-desc {
  font-size: 0.8rem;
  color: var(--dir-muted);
  margin: 0 0 0.5rem 0;
}

.open-calendar-cta {
  color: var(--dir-orange);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  transition: transform 0.15s ease;
}

.open-calendar-cta:hover {
  color: var(--dir-orange-hover);
  transform: translateX(2px);
}

/* -------------------------------------------------------------
   7. Empty Search State
   ------------------------------------------------------------- */
.directory-empty {
  text-align: center;
  padding: 3rem 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid var(--dir-card-border);
  margin-top: 1.5rem;
}

.directory-empty h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dir-heading);
  margin: 0 0 0.5rem 0;
}

.directory-empty p {
  color: var(--dir-muted);
  font-size: 0.9rem;
  margin: 0 0 1.25rem 0;
}

.btn-clear-search-pill {
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 0.65rem 1.45rem;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
  font-family: inherit;
}

.btn-clear-search-pill:hover {
  background: #1e293b;
}

/* -------------------------------------------------------------
   8. Exam Calendar Modal
   ------------------------------------------------------------- */
.calendar-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.calendar-modal-backdrop.active {
  display: flex;
}

.calendar-modal-box {
  background: #ffffff;
  border-radius: 16px;
  max-width: 650px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  padding: 1.75rem;
  position: relative;
}

.calendar-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--dir-border);
}

.calendar-modal-head h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--dir-heading);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-close-modal {
  background: none;
  border: none;
  cursor: pointer;
  color: #64748b;
  font-size: 1.5rem;
  line-height: 1;
  padding: 4px;
}

.calendar-dates-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.calendar-dates-table th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  border-bottom: 1px solid var(--dir-border);
}

.calendar-dates-table td {
  padding: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  color: #1e293b;
}

.calendar-dates-table tr:hover td {
  background: #fafafa;
}

/* -------------------------------------------------------------
   9. Responsive Breakpoints
   ------------------------------------------------------------- */
@media (max-width: 1180px) {
  .dir-main-wrapper {
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 1.5rem;
    padding: 1.5rem 1.25rem;
  }

  .competitive-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .notegov-app-shell {
    flex-direction: column;
  }

  .dir-sidebar-left {
    width: 100%;
    height: auto;
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--dir-border);
    padding: 1rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .sidebar-top {
    flex-direction: row;
    align-items: center;
    gap: 1.25rem;
  }

  .sidebar-brand {
    margin-bottom: 0;
  }

  .sidebar-nav {
    flex-direction: row;
    gap: 0.35rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav-item span {
    display: none;
  }

  .sidebar-nav-item {
    padding: 0.5rem;
    width: auto;
  }

  .sidebar-bottom {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
  }

  .dir-main-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1.25rem 1rem 3rem 1rem;
  }

  .dir-center-col {
    order: 1;
  }

  .dir-right-col {
    order: 2;
  }

  .mobile-search-only {
    display: block;
    margin-bottom: 1.25rem;
  }

  .desktop-search-only {
    display: none;
  }

  .board-grid,
  .competitive-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 1.85rem;
  }

  .exam-card {
    padding: 1rem 1rem 1rem 1.8rem;
  }
}
