:root{
  /* ========= Brand / Theme ========= */
  --navy:#0b1b4a;        /* dark blue (header/footer) */
  --navy-2:#0a163c;      /* deeper */
  --navy-3:#102a74;      /* accent */
  --bg:#f6f8ff;          /* app background */
  --surface:#ffffff;     /* cards */
  --surface-2:#f1f4ff;   /* light panels */
  --border:rgba(12, 28, 72, .12);

  --text:#111827;
  --muted:#6b7280;

  /* Accent palette */
  --primary:#2563eb;     /* blue */
  --primary-2:#1d4ed8;

  --accent:#f59e0b;      /* amber */
  --accent-2:#d97706;

  --success:#22c55e;
  --danger:#ef4444;

  /* ========= Shadows ========= */
  --shadow-sm: 0 6px 16px rgba(15, 23, 42, .08);
  --shadow-md: 0 12px 30px rgba(15, 23, 42, .12);
  --shadow-lg: 0 22px 55px rgba(15, 23, 42, .16);

  --radius:16px;
}

/* ================= GLOBAL ================= */

html, body{
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  height: 100%;
  margin: 0;
  overflow: auto;
}
body {
  display: flex;
  flex-direction: column;
}
main{
  flex: 1 0 auto;
  overflow: auto;
}

a{
  color: var(--primary);
  text-decoration: none;
}
a:hover{
  color: var(--primary-2);
}

/* ================= HEADER ================= */

.topbar{
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  border-bottom: 1px solid rgba(255,255,255,.10);
  height: 110px;
  display: flex;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}

.brand img{
  width:88px;
  height:88px;
  border-radius:14px;
  object-fit:cover;
  box-shadow: 0 10px 25px rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.14);
}

.brand .title{
  font-weight:600;
  font-size:20px;
  letter-spacing:.2px;
  color:#fff;
  width: 400px;
}

/* ================= NAV ================= */

.nav-pill a{
  padding:10px 14px;
  border-radius:12px;
  color:#ffffff;
  font-weight:700;
  transition:.18s ease;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(6px);
}

.nav-pill a:hover{
  background: rgba(37, 99, 235, .18);
  border-color: rgba(37, 99, 235, .35);
  color:#fff;
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
}

/* ================= SECTIONS ================= */

.section-title{
  font-weight: 700;
    font-size: 32px;
    margin: 24px 0 10px;
    color: #1c3e87;
}

.muted{ color: var(--muted);font-size: 20px; }

/* ================= CARDS ================= */

.card-book{
  background: var(--surface);
  border:1px solid var(--border);
  border-radius: var(--radius);
  overflow:hidden;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  box-shadow: var(--shadow-sm);
}

.card-book:hover{
  transform: translateY(-6px);
  border-color: rgba(37,99,235,.35);
  box-shadow: var(--shadow-lg);
}

.card-book .cover{
  background: linear-gradient(135deg, #e9efff, #ffffff);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#94a3b8;
  font-weight:900;
  height:100%;
}

.card-book img{
  width:100%;
  height:100%;
  object-fit:cover;
}

.card-book .p{ padding:14px; }

/* ================= BADGES ================= */

.badge-cat{
  display:inline-block;
  padding:8px 14px;
  border-radius:999px;
  background: rgba(37,99,235,.10);
  color: var(--primary-2);
  font-weight:800;
  font-size:13px;
  cursor:pointer;
  white-space:nowrap;
  border:1px solid rgba(37,99,235,.18);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .07);
  transition: .16s ease;
}
.badge-cat:hover{
  background: rgba(245,158,11,.14);
  border-color: rgba(245,158,11,.25);
  color: #7c4a00;
}

/* ================= BOXES ================= */

.stats-box{
  background: rgba(255,255,255,.86);
  border:1px solid var(--border);
  border-radius: var(--radius);
  padding:16px;
}

/* ================= BUTTONS ================= */

/* Primary (blue) */
.btn-orange{
  /* keep class name, change style */
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  border:none;
  color: #fff;
  font-weight:900;
  border-radius:12px;
  padding:10px 18px;
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}
.btn-orange:hover{
  filter: brightness(1.03);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: white;
  background: #08184c;
}
.btn-orange:active{
  transform: translateY(0px);
  box-shadow: var(--shadow-sm);
}

/* Optional extra button styles you can use */
.btn-accent{
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border:none;
  color:#1f2937;
  font-weight:900;
  border-radius:12px;
  padding:10px 18px;
  box-shadow: var(--shadow-sm);
}
.btn-accent:hover{ filter: brightness(1.03); box-shadow: var(--shadow-md); }

.btn-soft{
  background: rgba(37,99,235,.10);
  border:1px solid rgba(37,99,235,.22);
  color: var(--primary-2);
  font-weight:800;
  border-radius:12px;
  padding:10px 16px;
  box-shadow: var(--shadow-sm);
}
.btn-soft:hover{ background: rgba(37,99,235,.14); box-shadow: var(--shadow-md); }

/* Give bootstrap buttons consistent shadows */
.btn{
  box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease, filter .14s ease;
}
.btn:hover{ box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn:active{ transform: translateY(0); box-shadow: var(--shadow-sm); }

/* ================= FOOTER ================= */

.footer{
  margin-top:50px;
  padding:28px 0;
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  border-top: 1px solid rgba(255,255,255,.10);
  color: white;
  box-shadow: var(--shadow-md);
  
}
.footer a{ color: rgba(255,255,255,.92); }
.footer a:hover{ color: var(--accent); }

/* ================= ADMIN ================= */

.admin-shell{ min-height:100vh; }

.admin-sidebar{
  background: linear-gradient(180deg, var(--navy), var(--navy-2));
  border-right:3px solid rgba(245,158,11,.55);
  box-shadow: var(--shadow-md);
}

.admin-sidebar a{
  display:flex;
  align-items: center;
  gap: 10px;
  padding:10px 14px;
  border-radius:6px;
  color:#fff;
  font-weight:700;
  background: rgba(255,255,255,.06);
  border:1px solid rgba(255,255,255,.12);
  margin-bottom:8px;
}
.admin-sidebar a:hover{
  background: rgba(245,158,11,.18);
  border-color: rgba(245,158,11,.28);
  color:#fff;
  box-shadow: 0 14px 30px rgba(0,0,0,.18);
}

/* ================= TABLES ================= */

.table{
  --bs-table-bg: transparent;
  --bs-table-color: var(--text);
  --bs-table-border-color: var(--border);
}
.table-striped>tbody>tr:nth-of-type(odd){
  background-color: rgba(37,99,235,.04);
}

/* ================= INDEX PAGE HELPERS ================= */

.full-bleed{
  width:100%;
  margin-left:calc(50% - 50vw);
  margin-right:calc(50% - 50vw);
}

.media-hero{
  position:relative;
  overflow:hidden;
  border:1px solid var(--border);
  border-radius:18px;
  width: 100%;
}
.media-hero--full{
  border-radius:0;
  border-left:0;
  border-right:0;
  height: 600px;
}
.media-hero-img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.media-hero-ph{
  height:420px;
  background:#eef2ff;
}
.media-hero-grad{
  position:absolute;
  inset:0;
  background: linear-gradient(90deg, rgba(11,27,74,.72), rgba(11,27,74,.18));
}
.media-hero-content{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
}
.media-quote{
  font-size:35px;
  font-weight:600;
  color:#fff;
  text-shadow: 0 10px 30px rgba(0,0,0,.35);
}

.news-thumb{
  width:100%;
  height:320px;
  object-fit:cover;
  border-radius:14px;
  display:block;
  box-shadow: var(--shadow-md);
}
.news-thumb-ph{
  height:180px;
  background:#e5e7eb;
  border-radius:14px;
}

.clamp-3{
  display:-webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}

.books-scroll{
  max-height:640px;
  overflow-y:auto;
  padding-right:6px;
}
.news-nav {
  margin-top: 30px;
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
}
/* Swiper arrows with shadow */
.news-nav .swiper-button-prev,
.news-nav .swiper-button-next{
  position:static;
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid var(--border);
  background:#fff;
}

.news-nav .swiper-button-prev:after,
.news-nav .swiper-button-next:after{
  font-size:16px;
  font-weight:900;
  color:var(--text);
}

/* ===== Category tabs page ===== */
.cat-pill{
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
  color:var(--text);
  box-shadow: var(--shadow-sm);
}
.cat-pill.active{
  background: rgba(37,99,235,.10);
  border-color: rgba(37,99,235,.22);
  color: var(--text);
  box-shadow: var(--shadow-md);
}

/* ===== Recommended books ===== */
.rec-books-grid .card-book .p{ min-height: 92px; }

/* ===== Full page PDF view ===== */
.pdf-fullwrap{
  width:100%;
  background:#fff;
  border:1px solid var(--border);
  border-radius:18px;
  overflow:hidden;
  box-shadow: var(--shadow-lg);
}
.pdf-full{
  width:100%;
  height: calc(100vh - 220px);
  border:0;
  display:block;
}
@media (max-width: 576px){
  .pdf-full{ height: calc(100vh - 260px); }
}

/* Cover helpers */
.cover-h200{ height:200px; }
.cover-h240{ height:240px; }
.cover-h200 img, .cover-h240 img{ width:100%; height:100%; object-fit:cover; }


/* ================= COMPONENT FIXES (UNIFIED) ================= */

.card-book{
  height: 100%;
  display: flex;
  flex-direction: column;
}

.card-book .cover{
  flex: 0 0 auto;
}

.card-book .p{
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.no-cover{
  padding: 14px;
  font-size: 12px;
  letter-spacing: .6px;
}

.input-wrap{ min-width: 260px; }
@media (max-width: 520px){
  .input-wrap{ min-width: 100%; }
}
footer {
  margin-top: 30px;
}
/* Footer tweaks */
.footer .footer-logo{ width:36px; height:36px; border-radius:10px; object-fit:cover; }
.footer a{ color: rgba(255,255,255,.86); }
.footer a:hover{ color: #fff; }
/* Books swiper nav */
.books-sw-nav{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  margin-top:16px;
}

/* Card cover uniform */
.card-book .cover{
  width:100%;
  aspect-ratio: 3 / 4;
  background:#f3f4f6;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}
.card-book .cover img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.card-book .cover .no-cover{
  font-size:12px;
  opacity:.6;
  font-weight:700;
}
