/* ======================================================
   ClickAstro – Astrology Themed Styles (FINAL FIXED)
====================================================== */

/* ================= VARIABLES ================= */
:root {
  --primary-color: #912d32;
  --secondary-color: #d4af37;
  --card-bg: #ffffff;
  --text-dark: #1f2937;

  --shadow-subtle: 0 10px 25px rgba(0,0,0,.08);
  --shadow-hover: 0 18px 40px rgba(0,0,0,.15);

  --focus-color: rgba(111,45,145,.6);
  --focus-width: 3px;
  --focus-offset: 4px;
}

/* ================= SECTION HEADER ================= */
/* ================= SECTION HEADER (ENHANCED) ================= */
.section-header-wrapper {
  margin-top: 50px;
  margin-bottom: 20px;
}

/* Header Layout */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 20px 0;
}

/* Title */
.section-header h2 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: .3px;

  /* Gradient Text */
  background: linear-gradient(90deg,#23d716,#db1b4b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ================= ANIMATED UNDERLINE ================= */
.underline {
  position: relative;
  width: 160px;
  height: 4px;
  margin-top: 10px;
  border-radius: 4px;
  overflow: hidden;
  background: rgba(240, 39, 49, 0.933);
}

/* Moving glow line */
.underline::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    #64f141,
    #22d3ee,
    #a855f7,
    transparent
  );
  background-size: 200% 100%;
  animation: underlineMove 2.5s linear infinite;
}

/* Subtitle */
.sub {
  margin-top: 10px;
  font-size: 16px;
  color: #cfcfcf;
  line-height: 1.6;
  max-width: 520px;
}

/* ================= ANIMATION ================= */
@keyframes underlineMove {
  0%   { background-position:   0% 50%; }
  100% { background-position: 200% 50%; }
}

/* ================= SEARCH ================= */
/* ================= DARK SEARCH WRAP ================= */
.search-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(145deg, #0b0e17, #11162a);
  padding: 6px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  box-shadow:
    0 12px 35px rgba(0,0,0,.55),
    inset 0 0 0 1px rgba(255,255,255,.04);
}

/* ================= INPUT ================= */
.search-wrap input {
  width: 340px;
  max-width: 48vw;
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  font-size: 15px;

  background: rgba(255,255,255,.06);
  color: #f2f2f2;

  transition: box-shadow .3s ease, background .3s ease;
}

.search-wrap input::placeholder {
  color: #9ca3af;
}

/* Focus Glow */
.search-wrap input:focus {
  outline: none;
  background: rgba(255,255,255,.1);
  box-shadow:
    0 0 0 2px rgba(111,45,145,.45),
    0 0 25px rgba(111,45,145,.4);
}

/* ================= BUTTON ================= */
.search-wrap button {
  border: none;
  background: linear-gradient(135deg,#6f2d91,#8b3fbf);
  color: #ffd78c;
  cursor: pointer;
  font-size: 18px;
  padding: 10px 12px;
  border-radius: 10px;
  transition: transform .25s ease, box-shadow .25s ease;
}

/* Hover Effect */
.search-wrap button:hover {
  transform: scale(1.08);
  box-shadow:
    0 8px 25px rgba(111,45,145,.65),
    0 0 0 2px rgba(255,215,140,.35);
}

/* Active Click */
.search-wrap button:active {
  transform: scale(.95);
}
.search-wrap input:focus {
  box-shadow:
    0 0 0 2px rgba(100,241,65,.45),
    0 0 25px rgba(100,241,65,.5);
}


/* ================= CAROUSEL WRAPPER ================= */
.carousel-wrapper {
  position: relative;
  margin-top: 12px;
  overflow: visible;
}

/* ================= GRID ================= */
.state-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 20px;
  padding: 20px 0;
}

/* ================= SEARCH MODE (CAROUSEL) ================= */
.search-carousel {
  display: flex !important;
  gap: 20px;
  overflow-x: auto !important;
  padding: 15px 0;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
}

/* 🔥 CRITICAL FIX (NO MORE BARCODE BUG) */
.search-carousel .state-card {
  flex: 0 0 220px;   /* FIXED WIDTH */
  scroll-snap-align: start;
}

/* ================= STATE CARD ================= */
.state-card {
  background: rgba(17, 22, 42, 0.85);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  text-decoration: none;
  color: #f2f2f2;
  border: 1px solid rgba(100, 241, 65, 0.7);
  box-shadow: var(--shadow-subtle);
  overflow: hidden;
  transition: transform .3s ease, box-shadow .3s ease;
}



.state-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-hover);
}

.card-media {
  height: 120px;
  overflow: hidden;
  background: #381a4f;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 12px;
  text-align: center;
}

.state-card p {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

/* ================= NAV ARROWS ================= */
.nav-circle {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;

  background: linear-gradient(135deg,#6f2d91,#8b3fbf);
  color: #d17cdc;
  font-size: 26px;
  display: grid;
  place-items: center;

  z-index: 50;
  box-shadow:
    0 10px 30px rgba(111,45,145,.55),
    0 0 0 4px rgba(71, 181, 240, 0.25);
}

.nav-left { left: -26px; }
.nav-right { right: -26px; }

.nav-circle:disabled {
  opacity: .5;
  cursor: not-allowed;
}

/* ================= PAGINATION ================= */
.pagination-info {
  text-align: center;
  margin: 15px 0;
  font-size: 15px;
  color: #4b5563;
}

/* =========================================================
   ✅ DESKTOP/TABLET ONLY FIXES (DO NOT TOUCH MOBILE STYLES)
   - Add left/right screen spacing (2-tab feel)
   - Prevent arrows from overlapping/intersecting state cards
========================================================= */
@media (min-width: 600px) {

  /* 2-tab-like padding on both sides */
  .section-header-wrapper,
  .pagination-info {
    padding-left: 32px;
    padding-right: 32px;
  }

  /* Add side padding to keep content away from screen corners
     AND reserve space so arrows never sit on top of cards */
  .carousel-wrapper {
    padding-left: 56px;
    padding-right: 56px;
  }

  /* Move arrows inside the reserved padding area */
  .nav-left { left: 16px; }
  .nav-right { right: 16px; }
}

/* ================= TABLET ================= */
@media (max-width: 999px) {
  .state-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ================= MOBILE ================= */
@media (max-width: 599px) {

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-wrap input {
    width: 100%;
    max-width: 100%;
  }

  .state-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .card-media {
    height: 90px;
  }

  .state-card p {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .search-carousel .state-card {
    flex: 0 0 160px;
  }

  .nav-circle {
    width: 38px;
    height: 38px;
    font-size: 18px;
    top: 55%;
  }

  .nav-left { left: 4px; }
  .nav-right { right: 4px; }
}

/* ================= ACCESSIBILITY ================= */
.state-card:focus-visible {
  outline: var(--focus-width) solid var(--focus-color);
  outline-offset: var(--focus-offset);
}
