/* ─────────────────────────────
   CSS CUSTOM PROPERTIES
───────────────────────────── */
:root {
  --navy:        #0d2b5e;
  --navy-dark:   #081c3b;
  --navy-mid:    #1e4d8c;
  --green:       #2ecc71;
  --green-dark:  #1e8449;
  --surface:     #f4f7fb;
  --white:       #ffffff;
  --muted:       #6b7280;
  --border:      #e5e7eb;
  --card-radius: 20px;
  --shadow-sm:   0 2px 12px rgba(0,0,0,0.06);
  --shadow-md:   0 8px 32px rgba(0,0,0,0.10);
  --shadow-lg:   0 20px 50px rgba(0,0,0,0.12);
}



*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--surface);
  font-family: 'DM Sans', system-ui, sans-serif;
  color: #111827;
  padding-top: 75px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

/* ─────────────────────────────
   SHARED SECTION TOKENS
───────────────────────────── */
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-eyebrow {
  display: inline-block;
  color: var(--green);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* ─────────────────────────────
   HERO SECTION
───────────────────────────── */
.hero-section {
  min-height: 92vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  text-align: center;
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-mid) 50%, var(--navy-dark) 100%);
  margin-top: -75px;
  padding: 130px 0 80px;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 1;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  z-index: 0;
  pointer-events: none;
}

.hero-blob-1 {
  width: 450px; height: 450px;
  background: var(--green);
  top: -120px; right: -120px;
}

.hero-blob-2 {
  width: 350px; height: 350px;
  background: #3b82f6;
  bottom: -80px; left: -80px;
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(46,204,113,0.12);
  border: 1px solid rgba(46,204,113,0.3);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -1.5px;
  color: white;
}

.hero-title-accent { color: var(--green); }

.hero-sub {
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  max-width: 580px;
  line-height: 1.7;
}

/* ─────────────────────────────
   SEARCH BAR
───────────────────────────── */
.search-bar-wrapper {
  max-width: 660px;
  width: 100%;
}

.search-form {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 999px;
  padding: 6px 6px 6px 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
  gap: 8px;
}

.search-icon-wrap {
  color: var(--muted);
  font-size: 1.05rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 1rem;
  font-family: inherit;
  color: #111827;
  min-width: 0;
  padding: 8px 0;
}

.search-input::placeholder { color: #9ca3af; }

.search-btn {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-weight: 700;
  font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.search-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.search-btn:active { transform: translateY(0); }

/* ─────────────────────────────
   CAMPUS ROW (below search bar)
───────────────────────────── */
.campus-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  max-width: 700px;
}

.campus-row-label {
  color: rgba(255,255,255,0.5);
  font-size: 0.82rem;
  font-weight: 600;
  flex-shrink: 0;
}

.campus-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.campus-chip:hover {
  background: rgba(46,204,113,0.18);
  border-color: rgba(46,204,113,0.4);
  color: var(--green);
  transform: translateY(-2px);
}

.campus-chip-more {
  font-style: italic;
  opacity: 0.7;
}

/* ─────────────────────────────
   CATEGORY PILLS
───────────────────────────── */
.category-pill-label {
  color: rgba(255,255,255,0.45);
  font-size: 0.82rem;
  font-weight: 600;
  align-self: center;
  flex-shrink: 0;
}

.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.13);
  color: rgba(255,255,255,0.82);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(4px);
}

.category-pill:hover {
  background: rgba(46,204,113,0.18);
  border-color: rgba(46,204,113,0.45);
  color: var(--green);
  transform: translateY(-2px);
}

/* ─────────────────────────────
   HERO STATS
───────────────────────────── */
.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.hero-stat { padding: 0 2rem; text-align: center; }

.hero-stat-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}

/* ─────────────────────────────
   TICKER STRIP (real DB data)
───────────────────────────── */
.ticker-strip {
  background: var(--navy-dark);
  border-top: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 12px 0;
  overflow: hidden;
  position: relative;
}

/* Fade edges */
.ticker-strip::before,
.ticker-strip::after {
  content: '';
  position: absolute;
  top: 0; bottom: 0;
  width: 80px;
  z-index: 2;
  pointer-events: none;
}

.ticker-strip::before {
  left: 0;
  background: linear-gradient(to right, var(--navy-dark), transparent);
}

.ticker-strip::after {
  right: 0;
  background: linear-gradient(to left, var(--navy-dark), transparent);
}

.ticker-track {
  display: inline-flex;
  gap: 3rem;
  animation: ticker-scroll 40s linear infinite;
  white-space: nowrap;
}

.ticker-track:hover { animation-play-state: paused; }

.ticker-item {
  display: inline-flex;
  align-items: center;
  font-size: 0.875rem;
  color: rgba(255,255,255,0.65);
  flex-shrink: 0;
  gap: 6px;
}

.ticker-title { color: white; font-weight: 600; }
.ticker-dot   { color: rgba(255,255,255,0.25); }
.ticker-campus { color: rgba(255,255,255,0.55); }
.ticker-price  { color: var(--green); font-weight: 700; }

@keyframes ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ─────────────────────────────
   HOW IT WORKS
───────────────────────────── */
.hiw-section {
  padding: 5rem 0;
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.hiw-card {
  background: var(--surface);
  border-radius: var(--card-radius);
  padding: 2.5rem 2rem;
  height: 100%;
  text-align: center;
  border: 1px solid var(--border);
  position: relative;
  transition: all 0.3s ease;
}

.hiw-card:hover {
  border-color: rgba(46,204,113,0.4);
  box-shadow: var(--shadow-md);
  transform: translateY(-5px);
}

.hiw-number {
  position: absolute;
  top: -16px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hiw-icon {
  font-size: 2.5rem;
  color: var(--green);
  margin-top: 0.5rem;
}

/* ─────────────────────────────
   TRENDING LISTINGS (card grid)
───────────────────────────── */
.trending-section {
  padding: 5rem 0;
  background: var(--surface);
}

.listing-card {
  background: white;
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.listing-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}

.listing-campus-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(15,15,15,0.75);
  backdrop-filter: blur(6px);
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  z-index: 2;
  white-space: nowrap;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  background-color: #f8f9fa;
  padding: 10px;
  transition: transform 0.4s ease;
}

@media (min-width: 768px) {
  .listing-img { height: 210px; }
}

/* Hover Zoom Effect for Book Covers */
.listing-card:hover .listing-img {
  transform: scale(1.05);
}

.listing-img-placeholder {
  width: 100%;
  height: 180px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #d1d5db;
  font-size: 3rem;
}

.listing-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.listing-title {
  font-weight: 700;
  font-size: 0.9rem;
  line-height: 1.35;
  color: #111827;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2; 
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-cat {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  flex: 1;
}

.listing-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.listing-price {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--green-dark);
}

.listing-btn {
  
  background: #111827;
  color: white;
  border: none;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
}

.listing-btn:hover { background: var(--navy); color: white; }

/* ─────────────────────────────
   SELLER CTA
───────────────────────────── */
.seller-cta-section {
  padding: 5rem 0;
  background: #eef6f0;
}

.seller-cta-card {
  background: white;
  border-radius: 28px;
  padding: 3.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid #d1f0df;
}

.seller-cta-heading {
  color: var(--navy);
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  letter-spacing: -0.5px;
}

.seller-cta-sub {
  font-size: 1.05rem;
  line-height: 1.7;
}

.perk-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(46,204,113,0.12);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.cta-btn-primary {
  display: inline-flex;
  align-items: center;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  text-decoration: none;
  font-weight: 700;
  font-size: 1rem;
  padding: 14px 32px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 20px rgba(46,204,113,0.25);
}

.cta-btn-primary:hover { opacity: 0.9; transform: translateY(-2px); color: white; }

.cta-btn-ghost {
  display: inline-flex;
  align-items: center;
  background: transparent;
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 24px;
  border-radius: 999px;
  border: 2px solid var(--border);
  transition: border-color 0.2s;
}

.cta-btn-ghost:hover { border-color: var(--navy); color: var(--navy); }

/* Floating books illustration */
.books-illustration {
  position: relative;
  width: 240px; height: 240px;
}

.float-book {
  position: absolute;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.4s ease;
}

.book-blue  { width:110px;height:120px; background:linear-gradient(135deg,var(--navy),var(--navy-mid)); color:white; top:0; left:0; transform:rotate(-8deg); }
.book-green { width:105px;height:115px; background:linear-gradient(135deg,var(--green),var(--green-dark)); color:white; top:16px; right:0; transform:rotate(6deg); }
.book-amber { width:100px;height:110px; background:linear-gradient(135deg,#f59e0b,#d97706); color:white; bottom:10px; left:35px; transform:rotate(3deg); }

.books-illustration:hover .book-blue  { transform: rotate(-12deg) translateY(-8px); }
.books-illustration:hover .book-green { transform: rotate(10deg)  translateY(-10px); }
.books-illustration:hover .book-amber { transform: rotate(6deg)   translateY(-5px); }

.rand-badge {
  position: absolute;
  bottom: -5px; right: -10px;
  background: var(--navy);
  color: var(--green);
  font-weight: 800;
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(13,43,94,0.3);
  z-index: 5;
}

/* ─────────────────────────────
   SAFETY SECTION
───────────────────────────── */
.safety-section {
  padding: 5rem 0;
  background: white;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.safety-card {
  padding: 2rem;
  border-radius: var(--card-radius);
  background: #f8fffe;
  border: 1px solid #d1fae5;
  height: 100%;
  text-align: center;
  transition: all 0.3s ease;
}

.safety-card:hover {
  border-color: var(--green);
  box-shadow: 0 8px 24px rgba(46,204,113,0.1);
  transform: translateY(-4px);
}

.safety-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--green), var(--green-dark));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin: 0 auto 1rem;
}

/* ─────────────────────────────
   TESTIMONIAL SECTION
───────────────────────────── */
.testimonial-section {
  padding: 6rem 0;
  background: var(--navy-dark);
  position: relative;
  overflow: hidden;
}

.testimonial-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 28px;
  padding: 4rem 3rem;
  text-align: center;
  max-width: 860px;
  box-shadow: var(--shadow-lg);
}

.quote-mark {
  font-family: Georgia, serif;
  font-size: 5rem;
  color: var(--green);
  line-height: 0.4;
  margin-bottom: 1.2rem;
}

.testimonial-text {
  max-width: 700px;
  margin: 0 auto;
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  line-height: 1.85;
  font-style: italic;
  color: rgba(255,255,255,0.88);
}

.testimonial-user {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2.5rem;
}

.testimonial-user img {
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2px solid var(--green);
  object-fit: cover;
}

/* ─────────────────────────────
   MOBILE RESPONSIVENESS
───────────────────────────── */
@media (max-width: 991px) {
  .seller-cta-card { padding: 2.5rem 2rem; }

  /* Mobile menu glassmorphism dropdown */
  .navbar-collapse {
    background: rgba(13, 43, 94, 0.85); 
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 15px;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
}

@media (max-width: 767px) {
  body { padding-top: 65px; }

  .hero-section { padding: 105px 0 60px; min-height: auto; }

  .hero-title { letter-spacing: -0.8px; }

  /* Stack search btn full width on small screens */
  .search-form {
    flex-wrap: wrap;
    border-radius: 20px;
    padding: 12px;
    gap: 10px;
  }

  .search-icon-wrap { display: none; }

  .search-input {
    width: 100%;
    padding: 8px 4px;
    font-size: 0.95rem;
  }

  .search-btn {
    width: 100%;
    padding: 14px;
    border-radius: 14px;
    font-size: 1rem;
  }

  /* Campus chips scroll horizontally */
  .campus-row {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .campus-row::-webkit-scrollbar { display: none; }
  .campus-row-label { display: none; }

  /* Category pills scroll horizontally */
  .d-flex.flex-wrap.gap-2.mb-5 {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    justify-content: flex-start !important;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .d-flex.flex-wrap.gap-2.mb-5::-webkit-scrollbar { display: none; }
  .category-pill-label { display: none; }

  /* Stats: 3 across even on mobile */
  .hero-stats { gap: 0; }
  .hero-stat { padding: 0 1rem; }
  .hero-stat h3 { font-size: 1.5rem; }
  .hero-stat-divider { height: 30px; }

  /* How it works: 1 column */
  .hiw-card { padding: 2rem 1.5rem; }

  /* Listing cards: 2 column grid */
  .listing-img, .listing-img-placeholder { height: 155px; }
  .listing-body { padding: 0.75rem; }
  .listing-title { font-size: 0.82rem; }
  .listing-price { font-size: 0.95rem; }
  .listing-btn { padding: 5px 12px; font-size: 0.75rem; }

  /* Seller CTA */
  .seller-cta-card { padding: 2rem 1.5rem; border-radius: 20px; }
  .cta-btn-primary, .cta-btn-ghost { width: 100%; justify-content: center; }

  /* Safety cards: 1 column */
  .safety-card { padding: 1.5rem; }

  /* Testimonial */
  .testimonial-card { padding: 2.5rem 1.5rem; border-radius: 20px; }
  .quote-mark { font-size: 3.5rem; }

  /* Sections padding */
  .hiw-section,
  .trending-section,
  .seller-cta-section,
  .safety-section,
  .testimonial-section { padding: 3.5rem 0; }
}

@media (max-width: 400px) {
  .hero-title { font-size: 1.9rem; }
  .hero-stat { padding: 0 0.6rem; }
  .hero-stat h3 { font-size: 1.3rem; }
}