/* =============================================
   TeacherPlatform — Global Styles
   Logo-derived warm rustic palette
   ============================================= */

:root {
  /* Core brand (from Schoolhouse Stock logo) */
  --brand: #917D62;           /* Saddle Tan */
  --brand-dark: #6B5B45;      /* Deep Saddle — hover */
  --brand-light: rgba(145,125,98,0.15);
  --brand-soft: #B8A688;      /* Soft Saddle */

  /* Surfaces */
  --bg: #F5F1E6;              /* Parchment — page background */
  --bg-dark: #1C1A17;         /* Ink — dark mode base */
  --cream: #E8E3D3;           /* text on dark backgrounds */
  --card: #FFFFFF;            /* white card surfaces */
  --border: #E0D9C5;          /* warm border, not cold gray */

  /* Text */
  --text: #1C1A17;            /* Ink — primary text */
  --text-muted: #6B5B45;      /* Deep saddle — secondary text */

  /* Accents */
  --clay: #A8542E;            /* Clay Rust — CTA */
  --clay-dark: #8E3F1D;
  --moss: #5C6B4A;            /* Moss Green — success/category */
  --moss-dark: #455237;

  --radius: 12px;
}

/* ---- Keyframe Animations ---- */

@keyframes blob-drift-1 {
  0%,100%{transform:translate(0px) scale(1);}
  33%{transform:translate(60px,-80px) scale(1.12);}
  66%{transform:translate(-40px,40px) scale(0.92);}
}
@keyframes blob-drift-2 {
  0%,100%{transform:translate(0px) scale(1);}
  33%{transform:translate(-70px,35px) scale(1.08);}
  66%{transform:translate(80px,-25px) scale(0.88);}
}
@keyframes blob-drift-3 {
  0%,100%{transform:translate(0px) scale(1.08);}
  33%{transform:translate(35px,70px) scale(0.93);}
  66%{transform:translate(-55px,-40px) scale(1.06);}
}
@keyframes grain-shift {
  0%,100%{transform:translate(0px);}
  20%{transform:translate(-4%,4%);}
  40%{transform:translate(4%,-3%);}
  60%{transform:translate(-3%,-4%);}
  80%{transform:translate(3%,3%);}
}
@keyframes shimmer-text {
  0%{background-position:200% center;}
  100%{background-position:-200% center;}
}
@keyframes shimmer {
  0%{background-position:-200% 0;}
  100%{background-position:200% 0;}
}
@keyframes fade-up {
  0%{opacity:0;transform:translateY(24px);}
  100%{opacity:1;transform:translateY(0);}
}
@keyframes float {
  0%,100%{transform:translateY(0px);}
  50%{transform:translateY(-8px);}
}
@keyframes scroll-pulse {
  0%,100%{opacity:1;transform:translateY(0);}
  50%{opacity:0.3;transform:translateY(6px);}
}
@keyframes ping {
  75%,100%{opacity:0;transform:scale(2);}
}
@keyframes loadBar {
  from{transform:scaleX(0);transform-origin:left;}
  to{transform:scaleX(1);transform-origin:left;}
}
@keyframes marquee {
  from{transform:translateX(0);}
  to{transform:translateX(calc(-50% - var(--gap,16px)/2));}
}
@keyframes border-beam-spin {
  100%{transform:rotate(360deg);}
}

/* ---- Utility Classes ---- */

.animate-blob-1{animation:blob-drift-1 18s ease-in-out infinite;}
.animate-blob-2{animation:blob-drift-2 22s ease-in-out infinite;}
.animate-blob-3{animation:blob-drift-3 26s ease-in-out infinite;}
.animate-grain{animation:grain-shift 0.4s steps(1) infinite;}
.animate-fade-up{animation:fade-up 0.5s ease forwards;}
.animate-float{animation:float 3s ease-in-out infinite;}
.animate-marquee{animation:marquee var(--duration,32s) linear infinite;}
.animate-load-bar{animation:loadBar 0.7s ease-out forwards;}
.animate-ping{animation:ping 1s cubic-bezier(0,0,0.2,1) infinite;}

.shimmer-text {
  background:linear-gradient(90deg,#f97316,#fbbf24,#f97316);
  background-size:200% auto;
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
  background-clip:text;
  animation:shimmer-text 3s linear infinite;
}

.skeleton {
  background:linear-gradient(90deg,#f0f0f0 0%,#e0e0e0 40%,#f0f0f0 80%) 0/200% 100%;
  animation:shimmer 1.4s ease-in-out infinite;
  border-radius:var(--radius);
}

/* ---- Glass Card ---- */
.glass-card {
  background:rgba(255,255,255,0.8);
  border:1px solid rgba(255,255,255,0.6);
  box-shadow:0 2px 20px rgba(0,0,0,0.08);
  backdrop-filter:blur(12px);
  border-radius:var(--radius);
}
.glass-card-dark {
  background:rgba(18,18,18,0.7);
  border:1px solid rgba(255,255,255,0.08);
  box-shadow:0 2px 20px rgba(0,0,0,0.4);
  backdrop-filter:blur(12px);
  border-radius:var(--radius);
}

/* ---- Glow ---- */
.glow-brand{box-shadow:0 0 20px rgba(249,115,22,0.4);}
.glow-brand-sm{box-shadow:0 0 12px rgba(249,115,22,0.25);}

/* ---- Buttons ---- */
.btn-primary {
  background:var(--brand);
  color:#fff;
  padding:0.6rem 1.4rem;
  border-radius:8px;
  font-weight:600;
  font-size:0.9rem;
  border:none;
  cursor:pointer;
  transition:background 0.2s,box-shadow 0.2s,transform 0.15s;
  display:inline-flex;align-items:center;gap:6px;
}
.btn-primary:hover{background:var(--brand-dark);box-shadow:0 4px 16px rgba(249,115,22,0.35);transform:translateY(-1px);}
.btn-primary:active{transform:translateY(0);}

.btn-secondary {
  background:transparent;
  color:var(--brand);
  padding:0.6rem 1.4rem;
  border-radius:8px;
  font-weight:600;
  font-size:0.9rem;
  border:1.5px solid var(--brand);
  cursor:pointer;
  transition:all 0.2s;
  display:inline-flex;align-items:center;gap:6px;
}
.btn-secondary:hover{background:var(--brand-light);}

.btn-ghost {
  background:transparent;
  color:var(--text);
  padding:0.6rem 1.2rem;
  border-radius:8px;
  font-weight:500;
  font-size:0.9rem;
  border:1px solid var(--border);
  cursor:pointer;
  transition:all 0.2s;
  display:inline-flex;align-items:center;gap:6px;
}
.btn-ghost:hover{background:#f5f5f5;border-color:#ccc;}

/* ---- Product Card ---- */
.product-card {
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
  transition:transform 0.25s ease,box-shadow 0.25s ease;
  cursor:pointer;
}
.product-card:hover{transform:translateY(-4px);box-shadow:0 12px 32px rgba(0,0,0,0.12);}
.product-card .cover{aspect-ratio:4/3;overflow:hidden;background:#f5f5f5;}
.product-card .cover img{width:100%;height:100%;object-fit:cover;transition:transform 0.4s ease;}
.product-card:hover .cover img{transform:scale(1.05);}

/* ---- Form inputs ---- */
.form-input {
  width:100%;
  padding:0.65rem 1rem;
  border:1.5px solid var(--border);
  border-radius:8px;
  font-size:0.9rem;
  background:#fff;
  color:var(--text);
  transition:border-color 0.2s,box-shadow 0.2s;
  outline:none;
}
.form-input:focus{border-color:var(--brand);box-shadow:0 0 0 3px rgba(249,115,22,0.12);}

/* ---- Custom cursor ---- */
@media(pointer:fine){
  body *{cursor:none!important;}
  #cur-dot,#cur-ring{display:block;}
}
@media(pointer:coarse){
  #cur-dot,#cur-ring{display:none;}
}
#cur-dot{
  position:fixed;width:8px;height:8px;
  background:var(--brand);border-radius:50%;
  pointer-events:none;z-index:99999;
  transform:translate(-50%,-50%);
  transition:transform 0.05s;
}
#cur-ring{
  position:fixed;width:30px;height:30px;
  border:1.5px solid rgba(249,115,22,0.6);
  border-radius:50%;pointer-events:none;z-index:99998;
  transform:translate(-50%,-50%);
  transition:transform 0.12s ease,width 0.2s,height 0.2s,border-color 0.2s;
}

/* ---- Page load bar ---- */
#load-bar{
  position:fixed;top:0;left:0;right:0;height:2px;
  background:var(--brand);z-index:9999;
  transform:scaleX(0);transform-origin:left;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar{width:6px;}
::-webkit-scrollbar-track{background:#f1f1f1;}
::-webkit-scrollbar-thumb{background:#d4d4d4;border-radius:3px;}
::-webkit-scrollbar-thumb:hover{background:#a3a3a3;}

/* ---- Toast notifications ---- */
.toast{
  position:fixed;bottom:24px;right:24px;z-index:9999;
  background:#1a1a1a;color:#fff;padding:0.75rem 1.25rem;
  border-radius:10px;font-size:0.875rem;font-weight:500;
  box-shadow:0 8px 24px rgba(0,0,0,0.2);
  animation:fade-up 0.3s ease;
  display:flex;align-items:center;gap:8px;
}
.toast.success{border-left:3px solid #22c55e;}
.toast.error{border-left:3px solid #ef4444;}
.toast.info{border-left:3px solid var(--brand);}

/* ---- Star rating ---- */
.stars{color:#fbbf24;letter-spacing:1px;}

/* ---- Badge ---- */
.badge{
  display:inline-flex;align-items:center;
  padding:2px 8px;border-radius:999px;
  font-size:0.7rem;font-weight:700;letter-spacing:0.04em;text-transform:uppercase;
}
.badge-orange{background:rgba(249,115,22,0.12);color:#c2410c;}
.badge-green{background:rgba(34,197,94,0.12);color:#15803d;}
.badge-blue{background:rgba(59,130,246,0.12);color:#1d4ed8;}
.badge-gray{background:#f5f5f5;color:#737373;}

/* ---- Selects — global modern style (covers all selects site-wide) ---- */
select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  padding: 0.6rem 2.5rem 0.6rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: Inter, sans-serif;
  font-weight: 500;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' viewBox='0 0 24 24'%3E%3Cpath stroke='%23737373' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.2' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  line-height: 1.4;
}
select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(249,115,22,0.12);
  background-color: #fff;
}
select:hover {
  border-color: #c4c4c4;
}
/* select-wrapper — legacy wrapper still supported, ::after removed (bg-image handles chevron) */
.select-wrapper {
  position: relative;
  display: inline-block;
  width: 100%;
}
/* pod-input selects inherit global select styles, just need size override */
select.pod-input {
  padding: 0.625rem 2.5rem 0.625rem 0.875rem;
}
/* Compact inline variant (sort dropdowns, filter bars) */
.select-compact {
  width: auto;
  padding: 0.45rem 2.2rem 0.45rem 0.8rem;
  font-size: 0.8rem;
  background-position: right 0.6rem center;
  background-size: 14px;
}

/* ---- Sidebar link (dashboard) ---- */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #525252;
  transition: background-color 0.15s, color 0.15s;
}
.sidebar-link:hover { background: #f5f5f5; }
.sidebar-link.active { background: #fff7ed; color: #ea580c; }


/* ---- Dark Mode ---- */

/* Auto-detect system preference */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b;
    --bg-dark: #09090b;
    --card: #0f0f11;
    --border: #27272a;
    --text: #fafafa;
    --text-muted: #a1a1aa;
    --radius: 12px;
    color-scheme: dark;
  }
}

/* Manual dark mode */
[data-theme="dark"] {
  --bg: #09090b;
  --bg-dark: #09090b;
  --card: #0f0f11;
  --border: #27272a;
  --text: #fafafa;
  --text-muted: #a1a1aa;
  color-scheme: dark;
}

/* --- Base --- */
[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

/* --- Surfaces (layered depth) --- */
[data-theme="dark"] .bg-white { background: #0f0f11 !important; }
[data-theme="dark"] .bg-gray-50 { background: #0c0c0e !important; }
[data-theme="dark"] .bg-gray-100 { background: #18181b !important; }
[data-theme="dark"] .bg-gray-200 { background: #27272a !important; }

/* Elevated surface (cards, modals, dropdowns) */
[data-theme="dark"] .glass-card,
[data-theme="dark"] .co-card,
[data-theme="dark"] .product-card {
  background: #0f0f11 !important;
  border-color: #27272a !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.03) !important;
}
[data-theme="dark"] .product-card:hover {
  border-color: #3f3f46 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05) !important;
}
[data-theme="dark"] .glass-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.05) !important;
}

/* --- Navigation --- */
[data-theme="dark"] nav.sticky {
  background: rgba(9,9,11,0.85) !important;
  border-color: #27272a !important;
  box-shadow: 0 1px 12px rgba(0,0,0,0.5) !important;
  backdrop-filter: blur(12px) !important;
}

/* --- Dropdowns & Popovers --- */
[data-theme="dark"] [x-transition][class*="bg-white"],
[data-theme="dark"] [class*="w-48"][class*="bg-white"],
[data-theme="dark"] [class*="w-[620px]"],
[data-theme="dark"] [class*="w-72"][class*="bg-white"] {
  background: #18181b !important;
  border-color: #3f3f46 !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.05) !important;
}
[data-theme="dark"] [x-transition] a:hover,
[data-theme="dark"] [class*="w-48"] a:hover { background: #27272a !important; }

/* --- Text hierarchy --- */
[data-theme="dark"] .text-gray-900 { color: #fafafa !important; }
[data-theme="dark"] .text-gray-800 { color: #e4e4e7 !important; }
[data-theme="dark"] .text-gray-700 { color: #d4d4d8 !important; }
[data-theme="dark"] .text-gray-600 { color: #a1a1aa !important; }
[data-theme="dark"] .text-gray-500 { color: #71717a !important; }
[data-theme="dark"] .text-gray-400 { color: #52525b !important; }
[data-theme="dark"] [style*="color:#737373"] { color: #a1a1aa !important; }
[data-theme="dark"] [style*="color:#a3a3a3"] { color: #71717a !important; }
[data-theme="dark"] [style*="color:#9ca3af"] { color: #71717a !important; }
[data-theme="dark"] [style*="color:#374151"] { color: #d4d4d8 !important; }
[data-theme="dark"] [style*="color:#0f0f0f"],
[data-theme="dark"] [style*="color:#111"],
[data-theme="dark"] [style*="color:#1a1a1a"] { color: #fafafa !important; }

/* --- Borders --- */
[data-theme="dark"] .border-gray-50 { border-color: #18181b !important; }
[data-theme="dark"] .border-gray-100 { border-color: #27272a !important; }
[data-theme="dark"] .border-gray-200 { border-color: #3f3f46 !important; }
[data-theme="dark"] hr { border-color: #27272a !important; }
[data-theme="dark"] .divide-gray-50 > * + * { border-color: #18181b !important; }
[data-theme="dark"] .divide-gray-100 > * + * { border-color: #27272a !important; }

/* --- Accent backgrounds (warm tints, not flat) --- */
[data-theme="dark"] .bg-orange-50 { background: rgba(249,115,22,0.08) !important; }
[data-theme="dark"] .bg-orange-100 { background: rgba(249,115,22,0.12) !important; }
[data-theme="dark"] .bg-green-50 { background: rgba(22,163,74,0.08) !important; }
[data-theme="dark"] .bg-green-100 { background: rgba(22,163,74,0.12) !important; }
[data-theme="dark"] .bg-blue-50 { background: rgba(37,99,235,0.08) !important; }
[data-theme="dark"] .bg-blue-100 { background: rgba(37,99,235,0.12) !important; }
[data-theme="dark"] .bg-red-50 { background: rgba(220,38,38,0.08) !important; }
[data-theme="dark"] .bg-purple-50 { background: rgba(124,58,237,0.08) !important; }
[data-theme="dark"] .bg-yellow-100 { background: rgba(234,179,8,0.1) !important; }
[data-theme="dark"] [style*="background:#fff7ed"],
[data-theme="dark"] [style*="background: #fff7ed"] { background: rgba(249,115,22,0.06) !important; }
[data-theme="dark"] [style*="background:#ffedd5"] { background: rgba(249,115,22,0.1) !important; }
[data-theme="dark"] [style*="background:#f0fdf4"] { background: rgba(22,163,74,0.06) !important; }
[data-theme="dark"] [style*="background:#eff6ff"] { background: rgba(37,99,235,0.06) !important; }

/* Accent borders */
[data-theme="dark"] .border-orange-100 { border-color: rgba(249,115,22,0.2) !important; }
[data-theme="dark"] .border-orange-200 { border-color: rgba(249,115,22,0.3) !important; }
[data-theme="dark"] .border-orange-400 { border-color: #f97316 !important; }
[data-theme="dark"] .border-green-100 { border-color: rgba(22,163,74,0.2) !important; }
[data-theme="dark"] .border-green-200 { border-color: rgba(22,163,74,0.3) !important; }
[data-theme="dark"] .border-blue-100 { border-color: rgba(37,99,235,0.2) !important; }

/* --- Forms (recessed feel) --- */
[data-theme="dark"] .form-input,
[data-theme="dark"] select,
[data-theme="dark"] textarea,
[data-theme="dark"] input[type="text"],
[data-theme="dark"] input[type="email"],
[data-theme="dark"] input[type="number"],
[data-theme="dark"] input[type="password"],
[data-theme="dark"] input[type="url"],
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="search"] {
  background: #09090b !important;
  border-color: #3f3f46 !important;
  color: #fafafa !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3) !important;
}
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] input:focus {
  border-color: #f97316 !important;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.3), 0 0 0 3px rgba(249,115,22,0.15) !important;
}
[data-theme="dark"] input::placeholder,
[data-theme="dark"] textarea::placeholder { color: #52525b !important; }

/* --- Sidebar --- */
[data-theme="dark"] aside { background: #0c0c0e !important; border-color: #27272a !important; }
[data-theme="dark"] .sidebar-link { color: #a1a1aa !important; }
[data-theme="dark"] .sidebar-link:hover { background: #18181b !important; color: #d4d4d8 !important; }
[data-theme="dark"] .sidebar-link.active { background: rgba(249,115,22,0.1) !important; color: #f97316 !important; }

/* Dashboard mobile bar + drawer */
[data-theme="dark"] .fixed.top-16 { background: #0c0c0e !important; border-color: #27272a !important; }
[data-theme="dark"] [x-show="mobileMenuOpen"] { background: #0f0f11 !important; border-color: #27272a !important; }

/* Dashboard background */
[data-theme="dark"] [style*="background:#f9f9f8"] { background: #09090b !important; }

/* --- Footer --- */
[data-theme="dark"] footer { background: #09090b !important; border-color: #27272a !important; }

/* --- Buttons --- */
[data-theme="dark"] .btn-primary {
  box-shadow: 0 1px 3px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1) !important;
}
[data-theme="dark"] .btn-ghost {
  color: #d4d4d8 !important;
  border-color: #3f3f46 !important;
}
[data-theme="dark"] .btn-ghost:hover { background: #18181b !important; border-color: #52525b !important; }

/* --- Hover states --- */
[data-theme="dark"] .hover\:bg-gray-50:hover { background: #18181b !important; }
[data-theme="dark"] .hover\:bg-gray-100:hover { background: #27272a !important; }
[data-theme="dark"] .hover\:shadow-md:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.5) !important; }

/* --- Badges --- */
[data-theme="dark"] .badge-orange { background: rgba(249,115,22,0.15) !important; }
[data-theme="dark"] .badge-green { background: rgba(22,163,74,0.15) !important; }
[data-theme="dark"] .badge-gray { background: #27272a !important; color: #a1a1aa !important; }

/* --- Skeleton loading --- */
[data-theme="dark"] .skeleton,
[data-theme="dark"] .co-skeleton {
  background: linear-gradient(90deg, #18181b 0%, #27272a 40%, #18181b 80%) !important;
  background-size: 200% 100%;
}

/* --- Checkout --- */
[data-theme="dark"] .co-wrap { background: linear-gradient(135deg, #09090b 0%, #0f0f11 50%, #09090b 100%) !important; }
[data-theme="dark"] .co-card-header { border-color: #27272a !important; }
[data-theme="dark"] .co-card-header h2 { color: #fafafa !important; }
[data-theme="dark"] .co-card-icon { background: linear-gradient(135deg, rgba(249,115,22,0.15), rgba(249,115,22,0.08)) !important; }
[data-theme="dark"] .co-item-title { color: #fafafa !important; }
[data-theme="dark"] .co-item-price { color: #fafafa !important; }
[data-theme="dark"] .co-item { border-color: #18181b !important; }
[data-theme="dark"] .co-total-amount { color: #fafafa !important; }
[data-theme="dark"] .co-total-row { border-color: #27272a !important; }
[data-theme="dark"] .co-summary-row span:last-child { color: #d4d4d8 !important; }
[data-theme="dark"] .co-breadcrumb-active { color: #fafafa !important; }
[data-theme="dark"] .co-guarantee { background: rgba(22,163,74,0.08) !important; border-color: rgba(22,163,74,0.2) !important; }
[data-theme="dark"] .co-trust-item { color: #52525b !important; }
[data-theme="dark"] .co-powered { color: #3f3f46 !important; }
[data-theme="dark"] .co-brand-pill { background: #18181b !important; border-color: #3f3f46 !important; }

/* --- Section backgrounds --- */
[data-theme="dark"] section[style*="background:#f9f9f8"],
[data-theme="dark"] section[style*="background:#f5f5f5"],
[data-theme="dark"] section[style*="border-top:1px solid #e5e5e5"],
[data-theme="dark"] section[style*="border-bottom:1px solid #e5e5e5"] {
  background: #0c0c0e !important;
  border-color: #27272a !important;
}

/* --- Value prop section --- */
[data-theme="dark"] [style*="border-top:1px solid #e5e5e5"] { border-color: #27272a !important; }
[data-theme="dark"] [style*="border-bottom:1px solid #e5e5e5"] { border-color: #27272a !important; }

/* --- Toast messages --- */
[data-theme="dark"] .toast { background: #18181b !important; border-color: #3f3f46 !important; color: #fafafa !important; }

/* --- Tables --- */
[data-theme="dark"] table { color: #d4d4d8 !important; }
[data-theme="dark"] th { color: #71717a !important; border-color: #27272a !important; background: #0c0c0e !important; }
[data-theme="dark"] td { border-color: #18181b !important; }

/* --- Scrollbar --- */
[data-theme="dark"] ::-webkit-scrollbar { width: 8px; height: 8px; }
[data-theme="dark"] ::-webkit-scrollbar-track { background: #09090b; }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 4px; }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #52525b; }

/* --- Stars/Ratings --- */
[data-theme="dark"] .stars { color: #52525b; }

/* --- Marquee --- */
[data-theme="dark"] section.border-y { background: #0c0c0e !important; border-color: #27272a !important; }

/* --- Club CTA gradient --- */
[data-theme="dark"] [style*="background:linear-gradient(135deg,#fff7ed"] {
  background: linear-gradient(135deg, rgba(249,115,22,0.1) 0%, rgba(249,115,22,0.05) 100%) !important;
  border-color: rgba(249,115,22,0.2) !important;
}

/* ---- Accessibility ---- */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;}
*:focus-visible{outline:2px solid #f97316;outline-offset:2px;border-radius:4px;}
*:focus:not(:focus-visible){outline:none;}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation-duration:0.01ms!important;animation-iteration-count:1!important;transition-duration:0.01ms!important;scroll-behavior:auto!important;}.animate-spin,.animate-ping,.animate-bounce,.animate-pulse,.animate-marquee,.animate-blob-1,.animate-blob-2,.animate-blob-3{animation:none!important;}}
@media(forced-colors:active){.btn-primary{border:2px solid ButtonText;}.glass-card{border:1px solid CanvasText;}}
@media(pointer:coarse){.sidebar-link,.btn-primary,.btn-ghost,button{min-height:44px;}}

/* ---- Performance ---- */
img[loading="lazy"]{content-visibility:auto;}
nav,.sticky{will-change:transform;contain:layout style;}
section{content-visibility:auto;contain-intrinsic-size:auto 500px;}

/* === Semantic design roles (safer: no forced dark nav/footer) === */

/* Body bg = Parchment. White cards still pop on it. */
html, body {
    background: var(--bg);
    color: var(--text);
}

/* Semantic utility classes (opt-in — use on new templates) */
.btn-primary, .cta-primary {
    background: var(--clay);
    color: #fff;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
    border: none;
    transition: background 0.15s;
    display: inline-block;
}
.btn-primary:hover, .cta-primary:hover {
    background: var(--clay-dark);
    color: #fff;
}

.tag-pill {
    display: inline-block;
    background: var(--brand-soft);
    color: var(--text);
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

/* For hero/feature sections that opt in to the dark palette:
   wrap in <section class="dark-section"> and all child text will
   automatically switch to cream. Only applies INSIDE the section. */
.dark-section {
    background: var(--bg-dark);
    color: var(--cream);
}
.dark-section h1, .dark-section h2, .dark-section h3,
.dark-section h4, .dark-section h5, .dark-section h6,
.dark-section p, .dark-section li, .dark-section span,
.dark-section a {
    color: var(--cream);
}
.dark-section a:hover {
    color: var(--clay);
}
.dark-section [class*="text-gray-"] {
    color: var(--brand-soft);
}

/* Heading serif */
h1.display, h2.display, .heading-serif, .font-display {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.5px;
}

/* ============================================================
   MODERN COMPONENT SYSTEM — 2025 patterns
   Apply via CSS classes, not inline styles. Alpine-compatible.
   CSP-safe: no eval, no external fetch, all animations pure CSS.
   ============================================================ */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .08s ease, background-color .15s, border-color .15s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
}
.btn:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }

.btn-primary { background: var(--clay); color: #fff; border-color: var(--clay); }
.btn-primary:hover:not(:disabled) { background: var(--clay-dark); border-color: var(--clay-dark); }

.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { background: var(--bg); border-color: var(--brand-dark); }

.btn-ghost { background: transparent; color: var(--text); }
.btn-ghost:hover:not(:disabled) { background: rgba(28, 26, 23, 0.06); }

.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover:not(:disabled) { background: var(--brand-dark); border-color: var(--brand-dark); }

.btn-danger { background: #dc2626; color: #fff; border-color: #dc2626; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }

.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; border-radius: 8px; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; border-radius: 12px; }

.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn-loading::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  top: 50%; left: 50%;
  margin-top: -8px; margin-left: -8px;
  animation: btn-spin 0.6s linear infinite;
  color: #fff;
}
@keyframes btn-spin { to { transform: rotate(360deg); } }

/* ---------- Pills (multi-select) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
  user-select: none;
}
.pill:hover { border-color: var(--brand); background: var(--bg); }
.pill:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }
.pill.is-active, .pill[aria-pressed="true"] {
  background: var(--clay);
  border-color: var(--clay);
  color: #fff;
}
.pill.is-active:hover { background: var(--clay-dark); border-color: var(--clay-dark); }
.pill-count {
  font-size: 0.6875rem;
  opacity: .7;
  font-weight: 600;
  padding: 0 0.25rem;
}

.pill-group { display: flex; flex-wrap: wrap; gap: 0.4rem; }

/* ---------- Chips (removable filter chips) ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem 0.25rem 0.75rem;
  border-radius: 9999px;
  background: var(--saddle-soft, #B8A688);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
}
.chip button, .chip .chip-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  border: none;
  cursor: pointer;
  opacity: .6;
  transition: opacity .15s, background-color .15s;
  font-size: 0.75rem;
  line-height: 1;
}
.chip button:hover { opacity: 1; background: rgba(0,0,0,.1); }

.chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 1rem;
}
.chip-bar-label { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.chip-bar-clear {
  margin-left: auto;
  color: var(--clay);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  text-decoration: underline;
}

/* ---------- Segmented control (horizontal radio) ---------- */
.segmented {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9999px;
  padding: 3px;
  width: 100%;
}
.segmented-option {
  flex: 1;
  padding: 0.4rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  border-radius: 9999px;
  color: var(--text-muted);
  cursor: pointer;
  transition: background-color .15s, color .15s;
  background: transparent;
  border: none;
  white-space: nowrap;
}
.segmented-option:hover { color: var(--text); }
.segmented-option.is-active, .segmented-option[aria-pressed="true"] {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,.1);
}

/* ---------- Star selector ---------- */
.star-group { display: inline-flex; gap: 0.25rem; }
.star-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  color: #d1d5db;
  line-height: 1;
  padding: 0.125rem;
  transition: color .15s, transform .08s;
}
.star-btn:hover { transform: scale(1.15); }
.star-btn.is-active { color: #f59e0b; }
.star-btn[aria-pressed="true"] { color: #f59e0b; }

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-size: 0.875rem;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(145, 125, 98, 0.15);
}
.input-prefixed { padding-left: 1.75rem; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s, transform .08s;
}
.card:hover { border-color: var(--brand); box-shadow: 0 4px 20px rgba(0,0,0,.06); }

/* ---------- Skeleton grid (improved) ---------- */
.skeleton-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.skeleton-card .skeleton-cover {
  aspect-ratio: 4/3;
  background: linear-gradient(90deg, #f0ebe0 0%, #e8e1d0 40%, #f0ebe0 80%) 0/200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-card .skeleton-body { padding: 0.75rem; }
.skeleton-card .skeleton-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f0ebe0 0%, #e8e1d0 40%, #f0ebe0 80%) 0/200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  margin-bottom: 0.5rem;
}
.skeleton-card .skeleton-line.w-60 { width: 60%; }
.skeleton-card .skeleton-line.w-40 { width: 40%; }

/* ---------- Bottom sheet (mobile filter panel) ---------- */
.bottom-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(28, 26, 23, 0.5);
  backdrop-filter: blur(2px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.bottom-sheet-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.bottom-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-height: 85vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 61;
  transform: translateY(100%);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
}
.bottom-sheet.is-open { transform: translateY(0); }
.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 12px auto;
}
.bottom-sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.bottom-sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
}
.bottom-sheet-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
}

/* ---------- Accordion (modern smooth) ---------- */
.accordion-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  background: #fff;
}
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 0.875rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8125rem;
  color: var(--text);
  transition: background-color .15s;
}
.accordion-header:hover { background: var(--bg); }
.accordion-header .accordion-icon { transition: transform .2s; font-size: 0.75rem; }
.accordion-header[aria-expanded="true"] .accordion-icon { transform: rotate(180deg); }
.accordion-body { padding: 0 0.875rem 0.875rem; }

/* ---------- Range slider (dual-handle, Alpine-powered) ---------- */
.range-slider {
  position: relative;
  width: 100%;
  height: 28px;
}
.range-slider-track {
  position: absolute;
  top: 12px;
  left: 0; right: 0;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
}
.range-slider-fill {
  position: absolute;
  top: 12px;
  height: 4px;
  background: var(--brand);
  border-radius: 2px;
}
.range-slider input[type="range"] {
  position: absolute;
  width: 100%;
  height: 28px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
}
.range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  cursor: pointer;
  pointer-events: auto;
  transition: transform .1s, box-shadow .15s;
}
.range-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(145, 125, 98, 0.15);
}
.range-slider input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  cursor: pointer;
  pointer-events: auto;
}

/* ---------- Result-count badge ---------- */
.result-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---------- Utility: hide old .select-wrapper spacing ---------- */
.select-wrapper select.input, .select-wrapper select.modern-select {
  padding-right: 2rem;
}
