/* Couch Cult Theme: System-Adaptive + Manual Toggle */
:root{--gwt-bg:27 22 38;--gwt-surface:43 36 64;--gwt-text:244 239 225;--gwt-text-muted:167 155 184;--gwt-border:61 52 86;--gwt-accent:251 90 36;--gwt-accent-hover:226 74 22;}
[data-theme="light"]{--gwt-bg:244 239 225;--gwt-surface:253 250 241;--gwt-text:46 39 66;--gwt-text-muted:90 79 110;--gwt-border:219 210 190;--gwt-accent:178 58 14;--gwt-accent-hover:143 46 11;}
@media(prefers-color-scheme:light){:root:not([data-theme="dark"]){--gwt-bg:244 239 225;--gwt-surface:253 250 241;--gwt-text:46 39 66;--gwt-text-muted:90 79 110;--gwt-border:219 210 190;--gwt-accent:178 58 14;--gwt-accent-hover:143 46 11;}}

/* Override Tailwind gw-* utility classes */
.bg-gw-bg{background-color:rgb(var(--gwt-bg))!important}
.bg-gw-bg\/50{background-color:rgb(var(--gwt-bg)/0.5)!important}
.bg-gw-bg\/80{background-color:rgb(var(--gwt-bg)/0.8)!important}
.bg-gw-surface{background-color:rgb(var(--gwt-surface))!important}
.bg-gw-accent{background-color:rgb(var(--gwt-accent))!important}
.bg-gw-accent\/10{background-color:rgb(var(--gwt-accent)/0.1)!important}
.bg-gw-accent\/20{background-color:rgb(var(--gwt-accent)/0.2)!important}
.text-gw-text{color:rgb(var(--gwt-text))!important}
.text-gw-text-muted{color:rgb(var(--gwt-text-muted))!important}
.text-gw-accent{color:rgb(var(--gwt-accent))!important}
.text-gw-border{color:rgb(var(--gwt-border))!important}
.border-gw-border{border-color:rgb(var(--gwt-border))!important}
.border-gw-accent\/30{border-color:rgb(var(--gwt-accent)/0.3)!important}
.hover\:bg-gw-accent-hover:hover{background-color:rgb(var(--gwt-accent-hover))!important}
.hover\:bg-gw-border:hover{background-color:rgb(var(--gwt-border))!important}
.hover\:border-gw-accent\/30:hover{border-color:rgb(var(--gwt-accent)/0.3)!important}
.hover\:border-gw-accent:hover{border-color:rgb(var(--gwt-accent))!important}
.hover\:text-gw-accent:hover{color:rgb(var(--gwt-accent))!important}
.hover\:text-gw-accent-hover:hover{color:rgb(var(--gwt-accent-hover))!important}
.hover\:text-gw-text:hover{color:rgb(var(--gwt-text))!important}
.focus\:ring-gw-accent:focus{--tw-ring-color:rgb(var(--gwt-accent))!important}
.placeholder\:text-gw-text-muted::placeholder{color:rgb(var(--gwt-text-muted))!important}
.placeholder\:text-gw-text-muted::-moz-placeholder{color:rgb(var(--gwt-text-muted))!important}
.group:hover .group-hover\:text-gw-accent{color:rgb(var(--gwt-accent))!important}

/* Gradient overrides */
.from-gw-accent\/10{--tw-gradient-from:rgb(var(--gwt-accent)/0.1) var(--tw-gradient-from-position);--tw-gradient-to:rgb(var(--gwt-accent)/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}
.from-gw-accent\/20{--tw-gradient-from:rgb(var(--gwt-accent)/0.2) var(--tw-gradient-from-position);--tw-gradient-to:rgb(var(--gwt-accent)/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}
.from-gw-bg\/60{--tw-gradient-from:rgb(var(--gwt-bg)/0.6) var(--tw-gradient-from-position);--tw-gradient-to:rgb(var(--gwt-bg)/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}
.via-gw-bg\/80{--tw-gradient-to:rgb(var(--gwt-bg)/0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),rgb(var(--gwt-bg)/0.8) var(--tw-gradient-via-position),var(--tw-gradient-to)}
.to-gw-bg{--tw-gradient-to:rgb(var(--gwt-bg)) var(--tw-gradient-to-position)}
.to-gw-surface{--tw-gradient-to:rgb(var(--gwt-surface)) var(--tw-gradient-to-position)}

/* Scrollbar */
::-webkit-scrollbar-track{background:rgb(var(--gwt-bg))!important}
::-webkit-scrollbar-thumb{background:rgb(var(--gwt-border))!important}
@supports(scrollbar-color:auto){*{scrollbar-color:rgb(var(--gwt-border)) rgb(var(--gwt-bg))!important}}

/* Selection */
::selection{background-color:rgb(var(--gwt-accent)/0.3)!important;color:rgb(var(--gwt-text))!important}
::-moz-selection{background-color:rgb(var(--gwt-accent)/0.3)!important;color:rgb(var(--gwt-text))!important}

/* Smooth transition */
body{transition:background-color 0.3s,color 0.3s}

/* Floating toggle button */
.gw-theme-toggle{position:fixed;bottom:24px;right:24px;z-index:60;width:44px;height:44px;border-radius:50%;background:rgb(var(--gwt-surface));border:1px solid rgb(var(--gwt-border));cursor:pointer;display:flex;align-items:center;justify-content:center;font-size:20px;box-shadow:0 4px 12px rgba(0,0,0,0.15);transition:background 0.2s,border-color 0.2s;padding:0;font-family:inherit;color:rgb(var(--gwt-text))}
.gw-theme-toggle:hover{border-color:rgb(var(--gwt-accent))}

/* Logo always in dark container (gold film strip on black) */
img[alt="Couch Cult Logo"]{background:#1b1626;border-radius:12px;padding:3px}

/* Explore page theme-adaptive overrides */
.skeleton{background:linear-gradient(90deg,rgb(var(--gwt-surface)) 25%,rgb(var(--gwt-border)) 50%,rgb(var(--gwt-surface)) 75%)!important;background-size:200%!important}
.poster-fallback{background:rgb(var(--gwt-surface))!important}
.filter-chip-active{background:rgb(var(--gwt-accent)/0.15)!important;border-color:rgb(var(--gwt-accent))!important;color:rgb(var(--gwt-accent))!important}
.type-active{background:rgb(var(--gwt-accent)/0.15)!important;color:rgb(var(--gwt-accent))!important;border-color:rgb(var(--gwt-accent))!important}
.section-inactive{background:rgb(var(--gwt-surface))!important;color:rgb(var(--gwt-text-muted))!important;border-color:rgb(var(--gwt-border))!important}
/* Auth gate: fade animation instead of display toggle */
.auth-gate-overlay{background:rgba(0,0,0,0.6)!important;opacity:0;pointer-events:none;transition:opacity 0.2s ease-out}
.auth-gate-overlay.visible{opacity:1;pointer-events:auto}
.auth-gate-card{background:rgb(var(--gwt-surface))!important;border-color:rgb(var(--gwt-border))!important}

/* Screen-reader only utility */
.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}
.sr-only:focus{position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal}

/* Touch: remove 300ms tap delay */
a,button,[role="button"],input,select,.cursor-pointer{touch-action:manipulation}

/* Toast notifications */
.gw-toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);padding:12px 24px;border-radius:8px;font-size:14px;font-weight:500;z-index:9999;opacity:0;transition:opacity 0.3s,transform 0.3s;pointer-events:none;max-width:90vw}
.gw-toast.visible{opacity:1;transform:translateX(-50%) translateY(0)}
.gw-toast-success{background:rgb(34 197 94);color:#fff}
.gw-toast-error{background:rgb(239 68 68);color:#fff}
.gw-toast-info{background:rgb(var(--gwt-surface));color:rgb(var(--gwt-text));border:1px solid rgb(var(--gwt-border))}

/* Mobile hamburger menu */
.gw-hamburger{display:none;width:44px;height:44px;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;padding:0;color:rgb(var(--gwt-text))}
@media(max-width:767px){
  .gw-hamburger{display:flex}
  .gw-nav-links{display:none}
}
.gw-drawer-backdrop{position:fixed;inset:0;z-index:90;background:rgba(0,0,0,0.5);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);opacity:0;pointer-events:none;transition:opacity 0.2s ease-out}
.gw-drawer-backdrop.visible{opacity:1;pointer-events:auto}
.gw-drawer{position:fixed;top:0;right:0;bottom:0;z-index:91;width:280px;max-width:80vw;background:rgb(var(--gwt-surface));border-left:1px solid rgb(var(--gwt-border));transform:translateX(100%);transition:transform 0.2s ease-out;display:flex;flex-direction:column;overflow-y:auto}
.gw-drawer.visible{transform:translateX(0)}
.gw-drawer-header{display:flex;align-items:center;justify-content:space-between;padding:16px 24px;border-bottom:1px solid rgb(var(--gwt-border))}
.gw-drawer-close{width:44px;height:44px;display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;color:rgb(var(--gwt-text));border-radius:8px}
.gw-drawer-close:hover{background:rgb(var(--gwt-border))}
.gw-drawer-nav{padding:8px 0;flex:1}
.gw-drawer-nav a,.gw-drawer-nav button{display:block;width:100%;text-align:left;padding:12px 24px;font-size:16px;color:rgb(var(--gwt-text-muted));background:none;border:none;cursor:pointer;text-decoration:none;transition:color 0.15s,background 0.15s}
.gw-drawer-nav a:hover,.gw-drawer-nav button:hover{color:rgb(var(--gwt-text));background:rgb(var(--gwt-border)/0.5)}
.gw-drawer-nav a.active{color:rgb(var(--gwt-accent));font-weight:600}
.gw-drawer-divider{height:1px;background:rgb(var(--gwt-border));margin:4px 24px}

/* Reduced motion */
@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}
}

/* Contrast: white on the coral accent is 2.77:1. Dark mode uses plum ink (5.5:1); light mode keeps white on the darker coral (6.0:1). */
.bg-gw-accent.text-white{color:#1b1626!important}
[data-theme="light"] .bg-gw-accent.text-white{color:#ffffff!important}
@media(prefers-color-scheme:light){:root:not([data-theme="dark"]) .bg-gw-accent.text-white{color:#ffffff!important}}
