/* ================================================================
   PrimacyEbooks - Main CSS
   Bootstrap 5 + Custom Design System
   ================================================================ */

/* ── Variables ──────────────────────────────────────────────────── */
:root {
  /* Core palette */
  --primary:       #2563eb;
  --primary-dark:  #1d4ed8;
  --primary-light: #dbeafe;
  --secondary:     #7c3aed;
  --secondary-light: #ede9fe;
  --success:       #16a34a;
  --warning:       #d97706;
  --info:          #0891b2;
  --dark:          #0f172a;

  /* Accent colours — friendly, warm, energetic */
  --accent-orange: #f97316;
  --accent-teal:   #0d9488;
  --accent-pink:   #ec4899;
  --accent-yellow: #facc15;
  --accent-green:  #22c55e;

  /* Surfaces */
  --light-bg:      #f8fafc;
  --soft-bg:       #f0f4ff;
  --border-color:  #e2e8f0;
  --text-muted:    #64748b;

  /* Shape */
  --radius:        14px;
  --radius-sm:     8px;
  --radius-xl:     24px;

  /* Shadows */
  --shadow-sm:     0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow:        0 4px 16px rgba(0,0,0,.08), 0 2px 4px rgba(0,0,0,.06);
  --shadow-lg:     0 12px 32px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.08);
  --shadow-color:  0 8px 24px rgba(37,99,235,.18);

  /* Animation */
  --transition:    all .22s cubic-bezier(.4,0,.2,1);

  /* Typography */
  --font-main:     'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Base ────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.6;
  color: var(--dark);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* ── Typography ─────────────────────────────────────────────────── */
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.3; }
.display-4 { font-size: clamp(2rem, 5vw, 3.5rem); }

/* ── Links ───────────────────────────────────────────────────────── */
a { color: var(--primary); transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
  background: #fff !important;
  border-bottom: 2px solid var(--primary-light);
  padding-top: .6rem;
  padding-bottom: .6rem;
}
.navbar-brand {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.6px;
  color: var(--primary) !important;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.navbar-brand .brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  color: #fff;
  font-size: 1.1rem;
}
.nav-link {
  font-weight: 600;
  font-size: .92rem;
  color: #374151 !important;
  border-radius: 8px;
  padding: .4rem .75rem !important;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active {
  color: var(--primary) !important;
  background: var(--primary-light);
}
.navbar-toggler { border: none; box-shadow: none !important; color: var(--primary); }
.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%232563eb' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}
/* Navbar search */
.navbar-search .form-control {
  border-radius: 50px 0 0 50px !important;
  border: 2px solid var(--border-color);
  border-right: none;
  font-size: .85rem;
  min-width: 180px;
  background: var(--soft-bg);
}
.navbar-search .form-control:focus { border-color: var(--primary); box-shadow: none; }
.navbar-search .btn {
  border-radius: 0 50px 50px 0 !important;
  border: 2px solid var(--primary);
  background: var(--primary);
  color: #fff;
  padding: .3rem .75rem;
}
/* Cart button */
.btn-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--soft-bg);
  color: var(--primary);
  border: 2px solid var(--primary-light);
  font-size: 1rem;
  transition: var(--transition);
}
.btn-cart:hover { background: var(--primary); color: #fff; }
.btn-cart .cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  font-size: .65rem;
  font-weight: 700;
  border-radius: 50px;
  background: var(--accent-orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
/* Announcement bar */
.announcement-bar {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  text-align: center;
  padding: .4rem 1rem;
  letter-spacing: .02em;
}
.announcement-bar a { color: var(--accent-yellow); }

/* ── Hero ────────────────────────────────────────────────────────── */
.bg-gradient-primary {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
}
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 45%, #6d28d9 100%);
  padding: 0;
  min-height: 90vh;
  display: flex;
  align-items: center;
}
/* Make the bootstrap container inside fill and center */
.hero-section > .container {
  padding-top: 5.5rem;
  padding-bottom: 5rem;
  width: 100%;
}
.hero-section::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -80px;
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: rgba(255,255,255,.06);
  pointer-events: none;
}
.hero-section::after {
  content: '';
  position: absolute;
  bottom: -100px;
  left: -60px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(255,255,255,.04);
  pointer-events: none;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 50px;
  padding: .35rem 1rem;
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 1.5rem;
}
.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 800;
  line-height: 1.15;
  color: #fff;
  margin-bottom: 1.25rem;
}
.hero-title .highlight {
  color: var(--accent-yellow);
  position: relative;
}
.hero-desc {
  font-size: 1.1rem;
  color: rgba(255,255,255,.85);
  line-height: 1.7;
  margin-bottom: 2rem;
}
.hero-stats {
  display: flex;
  gap: 2rem;
  margin-top: 2rem;
}
.hero-stat-item { text-align: center; }
.hero-stat-item .stat-num {
  font-size: 1.6rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}
.hero-stat-item .stat-label {
  font-size: .78rem;
  color: rgba(255,255,255,.7);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.hero-stat-divider {
  width: 1px;
  background: rgba(255,255,255,.25);
  align-self: stretch;
}
.hero-img-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-img-wrap::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  pointer-events: none;
}
.hero-img {
  filter: drop-shadow(0 28px 56px rgba(0,0,0,.4));
  max-height: 480px;
  width: 100%;
  max-width: 520px;
  position: relative;
  z-index: 1;
  animation: floatBob 5s ease-in-out infinite;
}
/* Floating decorative shapes */
.hero-float {
  position: absolute;
  border-radius: 16px;
  font-size: 1.8rem;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  animation: floatBob 3s ease-in-out infinite;
}
.hero-float.f1 { top: 10%; left: 5%; background: #fff; animation-delay: 0s; }
.hero-float.f2 { top: 30%; right: 3%; background: var(--accent-yellow); animation-delay: .8s; }
.hero-float.f3 { bottom: 20%; left: 8%; background: #fff; animation-delay: 1.6s; }
@keyframes floatBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* ── Cards ───────────────────────────────────────────────────────── */
.card {
  border-radius: var(--radius) !important;
  border: 1px solid var(--border-color) !important;
  transition: var(--transition);
}
.hover-lift:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg) !important;
}
.card-book .card-img-top {
  border-radius: var(--radius) var(--radius) 0 0;
  transition: var(--transition);
}
.card-book:hover .card-img-top { opacity: .92; }
/* Section headers */
.section-header { margin-bottom: 2.5rem; }
.section-eyebrow {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--primary);
  margin-bottom: .4rem;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--dark);
  margin-bottom: .5rem;
}
.section-subtitle { color: var(--text-muted); font-size: 1rem; }
/* Book card price chip */
.price-chip {
  display: inline-flex;
  align-items: center;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: .82rem;
  border-radius: 50px;
  padding: .15rem .7rem;
}
/* Course level badge */
.level-badge {
  font-size: .72rem;
  font-weight: 700;
  border-radius: 50px;
  padding: .2rem .7rem;
  background: var(--secondary-light);
  color: var(--secondary);
}
/* CTA Banner */
.cta-banner {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #f43f5e 100%);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
}
.cta-banner::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
}
/* Trust icon items */
.trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}
.trust-icon {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: .25rem;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn {
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: .01em;
  transition: var(--transition);
}
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
}
.btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,.4);
}
.btn-warning { font-weight: 700; }

/* ── Forms ───────────────────────────────────────────────────────── */
.form-control, .form-select {
  border-radius: 8px;
  border: 1.5px solid var(--border-color);
  font-size: .9rem;
  transition: var(--transition);
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}
.form-label { font-weight: 600; font-size: .875rem; }

/* ── Alerts ──────────────────────────────────────────────────────── */
.alert { border-radius: 10px; border: none; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger  { background: #fee2e2; color: #991b1b; }
.alert-warning { background: #fef9c3; color: #854d0e; }
.alert-info    { background: #e0f2fe; color: #075985; }

/* ── Breadcrumb ──────────────────────────────────────────────────── */
.breadcrumb { font-size: .85rem; background: transparent; margin-bottom: 1rem; }
.breadcrumb-item a { color: var(--text-muted); text-decoration: none; }
.breadcrumb-item a:hover { color: var(--primary); }

/* ── Upload Zone ─────────────────────────────────────────────────── */
.upload-zone {
  background: #f8faff;
  border-style: dashed !important;
  transition: var(--transition);
  cursor: pointer;
}
.upload-zone:hover, .upload-zone.border-success {
  background: #f0fdf4;
  border-color: #16a34a !important;
}

/* ── Progress ────────────────────────────────────────────────────── */
.progress {
  border-radius: 50px;
  background: #e2e8f0;
}
.progress-bar { border-radius: 50px; }

/* ── Pagination ──────────────────────────────────────────────────── */
.pagination .page-link {
  border-radius: 8px !important;
  margin: 0 2px;
  color: var(--primary);
  border: none;
  background: #f1f5f9;
}
.pagination .page-item.active .page-link {
  background: var(--primary);
  color: #fff;
}
.pagination .page-link:hover { background: #dbeafe; }

/* ── Blog Content ────────────────────────────────────────────────── */
.blog-content { line-height: 1.8; font-size: 1.05rem; }
.blog-content h2 { font-size: 1.6rem; margin: 2rem 0 1rem; }
.blog-content h3 { font-size: 1.3rem; margin: 1.5rem 0 .75rem; }
.blog-content p  { margin-bottom: 1.2rem; }
.blog-content img { max-width: 100%; border-radius: var(--radius); }
.blog-content blockquote {
  border-left: 4px solid var(--primary);
  padding: 1rem 1.5rem;
  background: #eff6ff;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5rem 0;
}
.blog-content pre, .blog-content code {
  background: #1e293b;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
}
.blog-content pre { padding: 1.25rem; overflow-x: auto; }
.blog-content code { padding: .15em .4em; font-size: .9em; }

/* ── Star Rating ─────────────────────────────────────────────────── */
.rating-stars .bi-star-fill  { color: #f59e0b; }
.rating-stars .bi-star-half  { color: #f59e0b; }
.rating-stars .bi-star       { color: #d1d5db; }

/* ── Course Viewer ───────────────────────────────────────────────── */
.lesson-sidebar {
  height: calc(100vh - 70px);
  overflow-y: auto;
  border-right: 1px solid var(--border-color);
}
.lesson-item {
  padding: .6rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}
.lesson-item:hover { background: #eff6ff; }
.lesson-item.active { background: #dbeafe; color: var(--primary); font-weight: 600; }
.lesson-item.completed::before {
  content: '✓ ';
  color: var(--success);
  font-weight: 700;
}

/* ── KPI Cards (Admin) ───────────────────────────────────────────── */
.kpi-card { border-radius: var(--radius) !important; }
.kpi-icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Payment Option ──────────────────────────────────────────────── */
.payment-option { cursor: pointer; transition: var(--transition); }
.payment-option:hover { border-color: var(--primary) !important; }

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
  background: linear-gradient(160deg, #0f172a 0%, #1e1b4b 100%);
  color: #e2e8f0;
  padding-top: 4rem;
  padding-bottom: 0;
}
.footer-brand-name {
  font-size: 1.35rem;
  font-weight: 800;
  color: #fff;
}
.footer-brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 10px;
  color: #fff;
  font-size: 1.1rem;
}
.footer-tagline { color: #94a3b8; font-size: .9rem; line-height: 1.6; }
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,.08);
  color: #94a3b8;
  font-size: 1rem;
  transition: var(--transition);
  text-decoration: none;
}
.footer-social a:hover { background: var(--primary); color: #fff; transform: translateY(-2px); }
.footer-heading {
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: #94a3b8;
  margin-bottom: 1rem;
}
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .4rem; }
.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: .88rem;
  transition: var(--transition);
}
.footer-links a:hover { color: #fff; padding-left: 4px; }
.footer-newsletter-input {
  border-radius: 50px 0 0 50px !important;
  border: none;
  background: rgba(255,255,255,.1);
  color: #fff;
  font-size: .85rem;
  padding: .5rem 1rem;
}
.footer-newsletter-input::placeholder { color: rgba(255,255,255,.45); }
.footer-newsletter-input:focus { outline: none; background: rgba(255,255,255,.15); box-shadow: none; }
.footer-newsletter-btn {
  border-radius: 0 50px 50px 0 !important;
  background: var(--primary);
  border: none;
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  padding: .5rem 1.1rem;
  transition: var(--transition);
}
.footer-newsletter-btn:hover { background: var(--primary-dark); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 3rem;
  padding: 1.2rem 0;
  font-size: .82rem;
  color: #64748b;
}
.footer-bottom a { color: #64748b; }
.footer-bottom a:hover { color: #94a3b8; }
footer a:hover { color: #fff !important; }

/* ── Sidebar Labels ──────────────────────────────────────────────── */
.sidebar-label {
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: .1em;
  color: #94a3b8;
  padding: .5rem .75rem .25rem;
  text-transform: uppercase;
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 992px) {
  .navbar-search { margin: .5rem 0; }
  .navbar-search .form-control { min-width: 100%; }
}
@media (max-width: 768px) {
  .hero-section { min-height: auto; }
  .hero-section > .container { padding-top: 4rem; padding-bottom: 3rem; }
  .hero-title { font-size: 2rem; }
  .hero-stats { gap: 1.2rem; }
  .hero-float { display: none; }
  .card-book { margin-bottom: 0; }
}

/* ── Utilities ───────────────────────────────────────────────────── */
.rounded-4  { border-radius: 16px !important; }
.rounded-5  { border-radius: 24px !important; }
.cursor-pointer { cursor: pointer; }
.text-truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bg-gradient-secondary {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}
.bg-gradient-info {
  background: linear-gradient(135deg, #0891b2, #06b6d4);
}

