/* =====================================================================
   Notes.UniversityAcademy — design tokens & custom styling on top of Bootstrap 5.
   Palette: "Chalkboard & Marigold" — an academic-notebook identity for
   B.Tech students: deep indigo chalkboard, marigold/saffron accent
   (exam-season marigold garlands + notebook sticky-tabs), warm paper bg.
   ===================================================================== */

:root {
  --nm-ink:        #1E2A4A;   /* deep indigo — headers, primary buttons */
  --nm-ink-dark:   #141D36;
  --nm-marigold:   #E8952E;   /* accent — CTAs, prices, highlights */
  --nm-marigold-dark: #C97A1B;
  --nm-teal:       #2A9D8F;   /* "Free" badges, success states */
  --nm-paper:      #FAF6EE;   /* warm paper background */
  --nm-paper-deep: #F1E9D8;
  --nm-charcoal:   #2B2B2B;
  --nm-muted:      #6B7280;
  --nm-border:     #E7DFCB;
  --nm-radius:     14px;

  --bs-primary: var(--nm-ink);
  --bs-primary-rgb: 30, 42, 74;
  --bs-body-bg: var(--nm-paper);
  --bs-body-color: var(--nm-charcoal);
  --bs-link-color: var(--nm-ink);
  --bs-border-radius: var(--nm-radius);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--nm-paper);
  color: var(--nm-charcoal);
}

h1, h2, h3, h4, .display-heading {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 600;
  color: var(--nm-ink);
  letter-spacing: -0.01em;
}

.text-mono, .price-tag, .subject-code {
  font-family: 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;
}

a { color: var(--nm-ink); }
a:hover { color: var(--nm-marigold-dark); }

/* ---------- Navbar ---------- */
.navbar-nm {
  background-color: var(--nm-ink);
  border-bottom: 3px solid var(--nm-marigold);
}
.navbar-nm .navbar-brand {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 1.5rem;
  color: #fff !important;
}
.navbar-nm .navbar-brand .brand-dot { color: var(--nm-marigold); }
.navbar-nm .nav-link {
  color: rgba(255,255,255,0.85) !important;
  font-weight: 500;
}
.navbar-nm .nav-link:hover,
.navbar-nm .nav-link.active { color: var(--nm-marigold) !important; }

/* ---------- Buttons ---------- */
.btn-marigold {
  background-color: var(--nm-marigold);
  border-color: var(--nm-marigold);
  color: #1E2A4A;
  font-weight: 600;
}
.btn-marigold:hover {
  background-color: var(--nm-marigold-dark);
  border-color: var(--nm-marigold-dark);
  color: #fff;
}
.btn-outline-ink {
  border-color: var(--nm-ink);
  color: var(--nm-ink);
  font-weight: 600;
}
.btn-outline-ink:hover { background-color: var(--nm-ink); color: #fff; }

/* ---------- Hero (signature element: spiral notebook edge) ---------- */
.hero-nm {
  background: linear-gradient(135deg, var(--nm-ink) 0%, var(--nm-ink-dark) 100%);
  color: #fff;
  position: relative;
  padding: 4.5rem 0 6rem;
  overflow: hidden;
}
.hero-nm h1 { color: #fff; }
.hero-nm .lead { color: rgba(255,255,255,0.82); }

/* ---------- Hero search bar (search by subject name or code) ---------- */
.hero-search { max-width: 680px; }
.hero-search-inner {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 999px;
  padding: .4rem .4rem .4rem 1.25rem;
  box-shadow: 0 12px 30px rgba(0,0,0,0.25);
  gap: .5rem;
}
.hero-search-icon { color: var(--nm-muted); font-size: 1.1rem; flex-shrink: 0; }
.hero-search-input {
  flex-grow: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: var(--nm-charcoal);
  min-width: 0;
  padding: .55rem 0;
}
.hero-search-input::placeholder { color: var(--nm-muted); opacity: .85; }
.hero-search-btn {
  border-radius: 999px;
  padding: .6rem 1.5rem;
  font-weight: 700;
  flex-shrink: 0;
}
@media (max-width: 575.98px) {
  .hero-search-inner { padding: .35rem .35rem .35rem .9rem; }
  .hero-search-input { font-size: .9rem; }
  .hero-search-btn { padding: .55rem 1rem; font-size: .85rem; }
}

/* Spiral-notebook binding motif running along the bottom of the hero */
.notebook-spiral {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 34px;
  background-color: var(--nm-paper);
  -webkit-mask-image: radial-gradient(circle 9px at 24px 0, transparent 9px, black 10px);
  mask-image: radial-gradient(circle 9px at 24px 0, transparent 9px, black 10px);
  -webkit-mask-size: 48px 34px;
  mask-size: 48px 34px;
  -webkit-mask-repeat: repeat-x;
  mask-repeat: repeat-x;
}

/* ---------- Category "index-tab" cards (signature element) ---------- */
.tab-card {
  position: relative;
  background: #fff;
  border: 1px solid var(--nm-border);
  border-radius: var(--nm-radius);
  padding: 1.4rem 1.25rem 1.25rem;
  height: 100%;
  transition: transform .15s ease, box-shadow .15s ease;
  text-decoration: none;
  display: block;
}
.tab-card::before {
  content: "";
  position: absolute;
  top: -10px; left: 20px;
  width: 46px; height: 14px;
  background: var(--nm-marigold);
  border-radius: 4px 4px 0 0;
}
.tab-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(30,42,74,0.12);
  border-color: var(--nm-marigold);
}
.tab-card .tab-icon {
  font-size: 1.6rem;
  color: var(--nm-marigold-dark);
  margin-bottom: .5rem;
  display: inline-block;
}
.tab-card h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.tab-card p { color: var(--nm-muted); font-size: .875rem; margin-bottom: 0; }

/* ---------- Item / note cards ---------- */
.item-card {
  background: #fff;
  border: 1px solid var(--nm-border);
  border-radius: var(--nm-radius);
  overflow: hidden;
  height: 100%;
  transition: box-shadow .15s ease, transform .15s ease;
}
.item-card:hover { box-shadow: 0 10px 24px rgba(30,42,74,0.10); transform: translateY(-3px); }
.item-card .cover-wrap {
  aspect-ratio: 3 / 4;
  background: var(--nm-paper-deep);
  overflow: hidden;
}
.item-card .cover-wrap img { width: 100%; height: 100%; object-fit: cover; }
.item-card .card-body { padding: 1rem; }
.item-card .item-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 1rem;
  color: var(--nm-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.badge-free {
  background-color: var(--nm-teal);
  color: #fff;
  font-weight: 600;
  letter-spacing: .02em;
}
.badge-paid {
  background-color: var(--nm-marigold);
  color: var(--nm-ink);
  font-weight: 700;
}
.price-tag { font-weight: 700; color: var(--nm-ink); font-size: 1.05rem; }
.price-strike { text-decoration: line-through; color: var(--nm-muted); font-size: .85rem; }

/* ---------- Free items table (relies on Bootstrap's .table for
   guaranteed correct row/column layout; this only adds polish) ---------- */
.item-table-wrap {
  background: #fff;
  border: 1px solid var(--nm-border);
  border-radius: var(--nm-radius);
  overflow: hidden;
}
.item-table { margin-bottom: 0; }
.item-table thead th {
  background: var(--nm-paper-deep);
  color: var(--nm-ink);
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: none;
  font-weight: 700;
  padding: .75rem 1rem;
}
.item-table tbody td {
  padding: .75rem 1rem;
  vertical-align: middle;
  border-color: var(--nm-border);
}
.item-table-title-link {
  display: flex;
  align-items: center;
  gap: .75rem;
  text-decoration: none;
  color: inherit;
}
.item-table-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--nm-paper-deep);
  color: var(--nm-ink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}
.item-table-title-block { min-width: 0; }
.item-table-title {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  color: var(--nm-ink);
  display: block;
}
.item-table-title-link:hover .item-table-title { color: var(--nm-marigold-dark); }

@media (max-width: 575.98px) {
  .item-table thead th { padding: .6rem .75rem; font-size: .7rem; }
  .item-table tbody td { padding: .6rem .75rem; }
  .item-table-icon { width: 30px; height: 30px; font-size: .85rem; }
  .item-table-title { font-size: .88rem; }
}

/* ---------- Sections ---------- */
.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: .75rem;
  font-weight: 700;
  color: var(--nm-marigold-dark);
}
.section-pad { padding: 3.25rem 0; }
.bg-paper-deep { background-color: var(--nm-paper-deep); }

/* ---------- Footer ---------- */
.footer-nm {
  background-color: var(--nm-ink-dark);
  color: rgba(255,255,255,0.75);
}
.footer-nm a { color: rgba(255,255,255,0.75); text-decoration: none; }
.footer-nm a:hover { color: var(--nm-marigold); }
.footer-nm h6 { color: #fff; font-weight: 700; text-transform: uppercase; font-size: .78rem; letter-spacing: .08em; }

/* ---------- Breadcrumbs ---------- */
.breadcrumb-nm-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--nm-border) transparent;
  margin: 0 -0.25rem;
}
.breadcrumb-nm-wrap::-webkit-scrollbar { height: 5px; }
.breadcrumb-nm-wrap::-webkit-scrollbar-track { background: transparent; }
.breadcrumb-nm-wrap::-webkit-scrollbar-thumb { background: var(--nm-border); border-radius: 999px; }

.breadcrumb-nm {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: .15rem;
  margin: 0;
  padding: .25rem;
  list-style: none;
  white-space: nowrap;
  width: max-content;
  min-width: 100%;
}
.breadcrumb-nm li {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.breadcrumb-nm li:not(:first-child)::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-top: 2px solid var(--nm-border);
  border-right: 2px solid var(--nm-border);
  transform: rotate(45deg);
  margin: 0 .4rem;
  flex-shrink: 0;
}
.breadcrumb-nm .breadcrumb-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--nm-paper-deep);
  color: var(--nm-ink);
  flex-shrink: 0;
  transition: background .15s ease, color .15s ease;
}
.breadcrumb-nm .breadcrumb-home:hover {
  background: var(--nm-marigold);
  color: #fff;
}
.breadcrumb-nm a:not(.breadcrumb-home) {
  display: inline-block;
  color: var(--nm-muted);
  text-decoration: none;
  font-size: .85rem;
  font-weight: 500;
  padding: .3rem .65rem;
  border-radius: 999px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background .15s ease, color .15s ease;
}
.breadcrumb-nm a:not(.breadcrumb-home):hover {
  background: var(--nm-paper-deep);
  color: var(--nm-ink);
}
.breadcrumb-nm .breadcrumb-current {
  display: inline-block;
  color: var(--nm-ink);
  font-weight: 600;
  font-size: .85rem;
  padding: .3rem .65rem;
  white-space: nowrap;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 575.98px) {
  .breadcrumb-nm .breadcrumb-home { width: 26px; height: 26px; font-size: .8rem; }
  .breadcrumb-nm a:not(.breadcrumb-home) { font-size: .78rem; padding: .25rem .5rem; max-width: 130px; }
  .breadcrumb-nm .breadcrumb-current { font-size: .78rem; padding: .25rem .5rem; max-width: 160px; }
  .breadcrumb-nm li:not(:first-child)::before { margin: 0 .25rem; }
}

/* ---------- Rich text editor (admin) ---------- */
.rich-editor-toolbar .btn { padding: .3rem .55rem; }
.rich-editor-content {
  border-radius: var(--nm-radius);
  min-height: 200px;
  max-height: 420px;
  overflow-y: auto;
}
.rich-editor-content:focus {
  outline: none;
  border-color: var(--nm-marigold);
  box-shadow: 0 0 0 .25rem rgba(232,149,46,.25);
}
.rich-editor-content p { margin-bottom: .75rem; }
.rich-editor-content ul, .rich-editor-content ol { margin-bottom: .75rem; padding-left: 1.5rem; }
.rich-editor-content blockquote {
  border-left: 3px solid var(--nm-marigold);
  padding-left: 1rem;
  color: var(--nm-muted);
  margin: .75rem 0;
}
.rich-editor-content:empty::before {
  content: attr(data-placeholder);
  color: var(--nm-muted);
}

/* ---------- Rendered rich description (public item page) ---------- */
.prose { color: var(--nm-charcoal); line-height: 1.7; }
.prose p { margin-bottom: 1rem; }
.prose h3 { font-size: 1.25rem; margin-top: 1.5rem; margin-bottom: .75rem; color: var(--nm-ink); }
.prose h4 { font-size: 1.05rem; margin-top: 1.25rem; margin-bottom: .5rem; color: var(--nm-ink); }
.prose ul, .prose ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.prose li { margin-bottom: .35rem; }
.prose blockquote {
  border-left: 3px solid var(--nm-marigold);
  padding-left: 1rem;
  color: var(--nm-muted);
  font-style: italic;
  margin: 1rem 0;
}
.prose a { color: var(--nm-ink); text-decoration: underline; }
.prose a:hover { color: var(--nm-marigold-dark); }

/* ---------- View count badge ---------- */
.view-count-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  color: var(--nm-muted);
  font-size: .85rem;
}
.view-count-badge i { color: var(--nm-muted); }

/* ---------- Misc ---------- */
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; padding: .55rem 1rem; border-radius: 10px;
  border: 1px solid var(--nm-border); background: #fff; font-weight: 600;
  color: var(--nm-charcoal); text-decoration: none; font-size: .92rem;
}
.social-btn:hover { border-color: var(--nm-ink); color: var(--nm-ink); }

.dashboard-sidebar .list-group-item.active {
  background-color: var(--nm-ink); border-color: var(--nm-ink);
}

.skip-link:focus {
  position: fixed; top: 8px; left: 8px; z-index: 2000;
  background: #fff; padding: .5rem 1rem; border-radius: 8px;
}

@media (prefers-reduced-motion: reduce) {
  .tab-card, .item-card { transition: none; }
}


/* ---------- Ratings & Reviews ----------
   Add this block to assets/css/style.css (e.g. near the end, before the
   "Misc" section). Covers: star display, the compact summary badge near
   the title, the interactive star-picker input on the review form, and
   review cards in the list at the bottom of the item page. */

.text-ink { color: var(--nm-ink); }

.rating-stars { color: var(--nm-marigold); letter-spacing: 1px; }
.rating-stars-sm { font-size: .8rem; }
.rating-stars i { margin-right: 1px; }

.rating-summary-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  color: var(--nm-charcoal);
}
.rating-summary-badge:hover { color: var(--nm-marigold-dark); }

/* Interactive 5-star picker: radios reversed + drawn right-to-left so a
   pure-CSS :hover/:checked sibling selector can light up "this star and
   everything before it" without any JavaScript. */
.star-rating-input {
  display: inline-flex;
  flex-direction: row-reverse;
  font-size: 1.8rem;
}
.star-rating-input input { position: absolute; opacity: 0; width: 0; height: 0; }
.star-rating-input label {
  color: var(--nm-border);
  cursor: pointer;
  padding: 0 .1rem;
  transition: color .1s ease;
}
.star-rating-input input:checked ~ label,
.star-rating-input label:hover,
.star-rating-input label:hover ~ label {
  color: var(--nm-marigold);
}
.star-rating-input input:focus-visible ~ label {
  outline: 2px solid var(--nm-marigold-dark);
  outline-offset: 2px;
  border-radius: 4px;
}

.review-list {
  max-height: 520px;
  overflow-y: auto;
  padding-right: .25rem;
}
.review-card {
  background: #fff;
  border: 1px solid var(--nm-border);
  border-radius: var(--nm-radius);
  padding: 1rem;
  margin-bottom: .85rem;
}
.review-card p { color: var(--nm-charcoal); font-size: .92rem; }

/* ---------- Item type accents (Notes / Question Bank / Book / Lab Manual) ----------
   Add this block to assets/css/style.css. Gives each item type a
   distinct color (top border + badge) so students can visually
   segregate types in a mixed grid, not just by reading text. */
.item-card { border-top: 4px solid transparent; }
.item-type-notes { border-top-color: #1E2A4A; }
.item-type-question-bank { border-top-color: #C0392B; }
.item-type-book { border-top-color: #2A9D8F; }
.item-type-lab-manual { border-top-color: #7C5CBF; }
.item-type-other { border-top-color: #9CA3AF; }

.item-type-badge { background: #F1E9D8; color: #2B2B2B; text-transform: uppercase; font-size: .68rem; font-weight: 700; letter-spacing: .03em; }
.item-type-notes .item-type-badge { background: rgba(30,42,74,.1); color: #1E2A4A; }
.item-type-question-bank .item-type-badge { background: rgba(192,57,43,.12); color: #C0392B; }
.item-type-book .item-type-badge { background: rgba(42,157,143,.12); color: #2A9D8F; }
.item-type-lab-manual .item-type-badge { background: rgba(124,92,191,.12); color: #7C5CBF; }

/* Section headings used when items are grouped by type (category.php,
   aktu-notes.php, aktu-question-bank.php) */
.type-group-heading { display: flex; align-items: center; gap: .5rem; margin-bottom: 1rem; }
.type-group-heading .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.type-group-heading.tg-notes .dot { background: #1E2A4A; }
.type-group-heading.tg-question-bank .dot { background: #C0392B; }
.type-group-heading.tg-book .dot { background: #2A9D8F; }
.type-group-heading.tg-lab-manual .dot { background: #7C5CBF; }
.type-group-heading.tg-other .dot { background: #9CA3AF; }

/* ---------- Filter bar (AKTU Notes / Question Bank pages) ---------- */
.filter-bar .form-label { font-weight: 600; }
.filter-bar .form-select { border-color: var(--nm-border); }

/* ---------- Static AKTU homepage hero branch cards ----------
   Layout uses Bootstrap's own row/col grid (see index.php markup) —
   this just styles each card; no custom CSS grid involved. */
.aktu-branch-card {
  display: block;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  padding: 1rem .75rem;
  text-align: center;
  color: #fff;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.aktu-branch-card:hover { background: rgba(232,149,46,.25); transform: translateY(-3px); color: #fff; }
.aktu-branch-card i { font-size: 1.5rem; color: #E8952E; display: block; margin-bottom: .4rem; }
.aktu-branch-card span { font-size: .82rem; font-weight: 600; }