/* BingeAway - High-Tech Spatial Design System */

/* === FONT IMPORTS === */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* === CSS VARIABLES === */
:root {
    /* Color Palette - High-Tech Spatial */
    --bg-primary: #050505;
    --bg-surface: #121212;
    --bg-surface-elevated: #1a1a1a;

    /* Accent Colors */
    --electric-blue: #3B82F6;
    --neon-lime: #CCF381;
    --electric-blue-hover: #60A5FA;
    --neon-lime-glow: rgba(204, 243, 129, 0.2);
    --success-green: #10B981;
    --success-green-hover: #34D399;
    --series-gold-start: #f1c40f;
    --series-gold-end: #e67e22;

    /* Text Colors */
    --text-heading: #E5E5E5;
    --text-body: #A3A3A3;
    --text-muted: #737373;
    --text-dark: #404040;

    /* Borders & Effects */
    --border-dark: #262626;
    --border-subtle: #1a1a1a;
    --glow-blue: rgba(59, 130, 246, 0.3);
    --glow-lime: rgba(204, 243, 129, 0.2);

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sharp: 4px;
    --radius-none: 0px;

    /* Typography */
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-data: 'JetBrains Mono', 'Courier New', monospace;

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET & BASE STYLES === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    width: 100%;
}

body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-ui);
    background: var(--bg-primary);
    min-height: 100vh;
    color: var(--text-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    min-height: 100vh;
    min-height: 100dvh; /* dynamic viewport height for mobile/Safari */
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-primary);
    width: 100%;
}

.main-content,
#main-content {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-xl);
    flex: 1;
    box-sizing: border-box;
}

@media (max-width: 768px) {
    .main-content,
    #main-content {
        padding: 14px 12px;
    }
}

/* === HEADER - GLASSMORPHISM NAVIGATION === */
.header {
    width: 100%;
    background: rgba(18, 18, 26, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-dark);
    padding: var(--spacing-md) var(--spacing-xl);
    position: sticky;
    top: 0;
    z-index: 10000;
    transition: all var(--transition-base);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-md);
}

.logo h1 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    text-transform: uppercase;
}

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: brightness(1.2);
}

.tagline {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-left: var(--spacing-md);
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.welcome-text {
    color: var(--text-body);
    font-size: 0.875rem;
    font-weight: 500;
}

/* User Avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: linear-gradient(135deg, var(--electric-blue) 0%, var(--neon-lime) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.user-avatar:hover {
    border-color: var(--electric-blue);
    box-shadow: 0 0 16px var(--glow-blue);
}

/* Hamburger Menu */
.hamburger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger-menu span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--electric-blue);
    transition: all var(--transition-fast);
}

.hamburger-menu:hover span {
    background: var(--electric-blue-hover);
    box-shadow: 0 0 8px var(--glow-blue);
}

/* User Dropdown */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    min-width: 180px;
    overflow: hidden;
    z-index: 9999;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    color: var(--text-body);
    text-decoration: none;
    transition: all var(--transition-fast);
    font-weight: 500;
    font-size: 0.875rem;
    border-bottom: 1px solid var(--border-subtle);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--bg-surface-elevated);
    color: var(--text-heading);
    border-left: 2px solid var(--electric-blue);
}

.dropdown-icon {
    font-size: 16px;
}

/* User Menu Container */
.user-menu-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Header Notifications Bell (envelope + unread count) */
.header-notif-bell {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-right: 8px;
    text-decoration: none;
    border-radius: 50%;
    transition: background 0.2s, transform 0.15s;
}
.header-notif-bell:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}
.header-notif-bell .header-notif-icon {
    font-size: 20px;
    line-height: 1;
}
.header-notif-bell .header-notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #db2360;
    color: #fff !important;
    font-size: 11px;
    font-weight: 700;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--bg-primary, #050505);
    line-height: 1;
    text-decoration: none;
}
.header-notif-bell:hover .header-notif-badge,
.header-notif-bell:visited .header-notif-badge,
.header-notif-bell:active .header-notif-badge {
    color: #fff !important;
}
@media (max-width: 480px) {
    .header-notif-bell { width: 32px; height: 32px; margin-right: 4px; }
    .header-notif-bell .header-notif-icon { font-size: 18px; }
}

/* Header Message Icon */
.header-message-icon {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast);
}

.header-message-icon:hover {
    transform: scale(1.1);
}

.header-message-icon .message-icon {
    font-size: 20px;
}

.header-message-icon .message-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--electric-blue);
    color: var(--bg-primary);
    border-radius: 10px;
    font-family: var(--font-data);
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    min-width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 12px var(--glow-blue);
}

/* === BUTTONS - MINIMAL DESIGN === */
.logout-btn,
.back-btn {
    background: transparent;
    color: var(--text-heading);
    border: 1px solid var(--border-dark);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
}

.logout-btn:hover,
.back-btn:hover {
    border-color: var(--electric-blue);
    color: var(--electric-blue);
    box-shadow: 0 0 12px var(--glow-blue);
}

.btn-primary {
    background: var(--electric-blue);
    color: var(--bg-primary);
    border: 1px solid var(--electric-blue);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary:hover {
    background: var(--electric-blue-hover);
    border-color: var(--electric-blue-hover);
    box-shadow: 0 0 16px var(--glow-blue);
}

.btn-secondary {
    background: transparent;
    color: var(--text-heading);
    border: 1px solid var(--border-dark);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
}

.btn-secondary:hover {
    border-color: var(--electric-blue);
    color: var(--electric-blue);
}

.clear-btn {
    background: var(--text-muted);
    color: var(--bg-primary);
    border: 1px solid var(--text-muted);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.clear-btn:hover {
    background: var(--text-body);
    border-color: var(--text-body);
    box-shadow: 0 0 16px rgba(163, 163, 163, 0.25);
}

.btn-small {
    background: transparent;
    color: var(--text-body);
    border: 1px solid var(--border-dark);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
}

.btn-small:hover {
    border-color: var(--neon-lime);
    color: var(--neon-lime);
}

/* List Admin modal tabs */
.la-tab {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-dark);
    padding: 6px 14px;
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-size: 0.82rem;
    font-family: var(--font-ui);
    transition: all var(--transition-fast);
}
.la-tab:hover,
.la-tab.la-tab-active {
    border-color: var(--neon-lime);
    color: var(--neon-lime);
    background: rgba(163,230,53,0.06);
}

.btn-update {
    background: transparent;
    color: var(--electric-blue);
    border: 1px solid var(--electric-blue);
}

.btn-update:hover {
    background: var(--electric-blue);
    color: white;
    border-color: var(--electric-blue);
}

/* === MODAL BUTTONS === */
.btn-modal {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-sharp);
    border: 1px solid var(--border-dark);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-fast);
}

.btn-modal-primary {
    background: var(--electric-blue);
    color: var(--bg-primary);
    border-color: var(--electric-blue);
}

.btn-modal-primary:hover {
    background: var(--electric-blue-hover);
    border-color: var(--electric-blue-hover);
    box-shadow: 0 0 16px var(--glow-blue);
}

.btn-modal-secondary {
    background: transparent;
    color: var(--text-heading);
    border-color: var(--border-dark);
}

.btn-modal-secondary:hover {
    border-color: var(--electric-blue);
    color: var(--electric-blue);
}

.btn-modal-success {
    background: transparent;
    color: var(--neon-lime);
    border-color: var(--neon-lime);
}

.btn-modal-success:hover {
    background: var(--neon-lime);
    color: var(--bg-primary);
    box-shadow: 0 0 16px var(--glow-lime);
}

.btn-modal-danger {
    background: transparent;
    color: #e74c3c;
    border-color: #e74c3c;
}

.btn-modal-danger:hover:not(:disabled) {
    background: #e74c3c;
    color: #fff;
}

.btn-modal-danger:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* === MAIN CONTENT === */
.content {
    flex: 1;
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--spacing-xl);
    width: 100%;
}

/* === ACCESS TERMINAL - LOGIN/REGISTER === */
.homepage-intro {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--spacing-xl);
}

.intro-hero {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding: var(--spacing-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    position: relative;
}

.auth-buttons-container {
    position: absolute;
    top: var(--spacing-lg);
    right: var(--spacing-lg);
    display: flex;
    gap: var(--spacing-sm);
    z-index: 10;
}

.auth-toggle-btn {
    background: transparent;
    color: var(--text-heading);
    border: 1px solid var(--border-dark);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
}

.auth-toggle-btn:hover {
    border-color: var(--electric-blue);
    color: var(--electric-blue);
    box-shadow: 0 0 12px var(--glow-blue);
}

.hero-title {
    color: var(--text-heading);
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    color: var(--neon-lime);
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.hero-description {
    color: var(--text-body);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

.hero-logo-image {
    max-width: 300px;
    margin-bottom: var(--spacing-lg);
    filter: brightness(1.2);
}

/* Auth Container - Access Terminal Style */
.auth-container {
    max-width: 480px;
    margin: var(--spacing-xl) auto;
    padding: var(--spacing-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.8);
}

.auth-container h2 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-align: center;
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-dark);
}

.auth-container h2::before {
    content: '> ';
    color: var(--electric-blue);
    font-family: var(--font-data);
}

/* Auth Dropdown Forms */
.auth-dropdown {
    position: fixed;
    top: 80px;
    right: var(--spacing-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-lg);
    z-index: 9999;
    min-width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.8);
}

.auth-dropdown-content h3 {
    color: var(--text-heading);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-dropdown-content h3::before {
    content: '> ';
    color: var(--electric-blue);
    font-family: var(--font-data);
}

/* Form Groups */
.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    color: var(--text-body);
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font-ui);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    color: var(--text-heading);
    font-size: 0.875rem;
    font-family: var(--font-ui);
    transition: all var(--transition-fast);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--electric-blue);
    box-shadow: 0 0 12px var(--glow-blue);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: var(--font-ui);
}

/* Terminal-like Search Input */
#search-to-watch,
#search-watched {
    font-family: var(--font-data) !important;
    background: var(--bg-primary);
    border: 1px solid var(--border-dark);
    color: var(--neon-lime);
    padding: var(--spacing-md);
    border-radius: var(--radius-sharp);
    font-size: 0.875rem;
}

#search-to-watch::placeholder,
#search-watched::placeholder {
    color: var(--text-muted);
    font-family: var(--font-data);
}

#search-to-watch:focus,
#search-watched:focus {
    border-color: var(--neon-lime);
    box-shadow: 0 0 12px var(--glow-lime);
    outline: none;
}

/* Blinking cursor effect for terminal input */
#search-to-watch:focus::after,
#search-watched:focus::after {
    content: '▊';
    animation: blink 1s infinite;
    color: var(--neon-lime);
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* Name Fields Layout */
.name-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

.auth-switch {
    text-align: center;
    margin-top: var(--spacing-lg);
    color: var(--text-body);
    font-size: 0.875rem;
}

.auth-switch button {
    background: none;
    border: none;
    color: var(--electric-blue);
    cursor: pointer;
    font-weight: 600;
    text-decoration: underline;
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}

.auth-switch button:hover {
    color: var(--electric-blue-hover);
}

.auth-submit-btn {
    width: 100%;
    background: var(--electric-blue);
    color: var(--bg-primary);
    border: 1px solid var(--electric-blue);
    padding: var(--spacing-md);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
}

.auth-submit-btn:hover {
    background: var(--electric-blue-hover);
    box-shadow: 0 0 16px var(--glow-blue);
}

/* === NAVIGATION TABS === */
.nav-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xl);
    border-bottom: 1px solid var(--border-dark);
    overflow-x: auto;
    padding-bottom: var(--spacing-sm);
}

.nav-tab {
    background: transparent;
    color: var(--text-body);
    border: none;
    border-bottom: 2px solid transparent;
    padding: var(--spacing-md) var(--spacing-lg);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text-heading);
    border-bottom-color: var(--electric-blue);
}

.nav-tab.active {
    color: var(--electric-blue);
    border-bottom-color: var(--electric-blue);
}

/* Sub-nav variant — smaller, lighter than the global primary nav.
   Used inside index.html (the SPA) to expose Groups / Lists views
   that don't have a top-level global tab. */
.nav-tabs--subnav {
    margin-bottom: var(--spacing-md);
    padding-bottom: 4px;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.05));
    gap: 4px;
}
.nav-tabs--subnav .nav-tab {
    padding: 8px 14px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: var(--text-muted, #A5A5A5);
    border-bottom-width: 1px;
}
.nav-tabs--subnav .nav-tab .nav-icon {
    font-size: 0.95rem;
    opacity: 0.75;
}
.nav-tabs--subnav .nav-tab.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 6px;
    border-bottom-color: var(--electric-blue);
}

/* social.html sub-nav variant — same treatment as the SPA sub-nav so the
   two contextual sub-navs feel consistent. Hidden by default; the active
   view (Friends / Binge Partner) sets display via inline style or a
   parent class. */
.social-nav--subnav {
    display: none;
    gap: 4px;
    margin-bottom: var(--spacing-md);
    padding: 4px 0 6px;
    border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.05));
}
.social-nav--subnav.is-visible {
    display: flex;
}
.social-nav--subnav .social-tab {
    background: transparent;
    color: var(--text-muted, #A5A5A5);
    border: none;
    padding: 8px 14px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 6px;
    transition: color 0.18s ease, background 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}
.social-nav--subnav .social-tab .nav-icon { font-size: 0.95rem; opacity: 0.75; }
.social-nav--subnav .social-tab:hover { color: #fff; background: rgba(255,255,255,0.04); }
.social-nav--subnav .social-tab:hover .nav-icon { opacity: 1; }
.social-nav--subnav .social-tab.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.10);
}
.social-nav--subnav .social-tab.active .nav-icon { opacity: 1; }

.nav-icon {
    font-size: 1.125rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.nav-icon i {
    font-size: 1.25rem;
}

.nav-label {
    font-family: var(--font-ui);
}

/* ─── Group Invite Modal ────────────────────────────────────────────────── */
.group-invite-modal-content {
    max-width: 420px;
    border-radius: 16px;
    overflow: hidden;
}
.group-invite-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    padding: 18px 24px;
    text-align: center;
}
.group-invite-header h3 { margin: 0; font-size: 1.2rem; }
.group-invite-info { padding: 4px 0; }
.invite-from-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}
.invite-avatar-circle {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; font-weight: 700; flex-shrink: 0;
}
.invite-from-text { margin: 0; font-size: 0.95rem; color: #ccc; line-height: 1.4; }
.invite-group-card {
    display: flex; align-items: flex-start; gap: 14px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.25);
    border-radius: 10px; padding: 14px 16px; margin-bottom: 14px;
}
.invite-group-icon { font-size: 1.8rem; line-height: 1; flex-shrink: 0; }
.invite-group-name { margin: 0 0 4px; font-size: 1.05rem; color: #fff; }
.invite-group-desc { margin: 0; font-size: 0.85rem; color: #aaa; line-height: 1.4; }
.invite-counter { text-align: center; font-size: 0.8rem; color: #888; margin: 4px 0 0; }
.group-invite-footer {
    display: flex; gap: 10px; flex-wrap: wrap;
    padding: 16px 24px 20px; justify-content: center;
}
.group-invite-footer button {
    flex: 1; min-width: 90px;
    padding: 10px 14px; font-size: 0.9rem; border-radius: 8px; cursor: pointer;
}
.btn-danger {
    background: #e74c3c; color: #fff; border: none;
    border-radius: 6px; cursor: pointer; transition: background 0.2s;
}
.btn-danger:hover { background: #c0392b; }
.community-sort-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    color: var(--text-secondary);
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.2s;
}
.community-sort-btn.active,
.community-sort-btn:hover {
    background: rgba(167,139,250,0.2);
    border-color: rgba(167,139,250,0.4);
    color: #a78bfa;
}
.list-detail-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    background: #0f0f1a;
    border-radius: 8px;
    padding: 10px;
    border: 1px solid #1e1e30;
}
.ldi-badge {
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
}
.ldi-badge-watched  { background: #166534; color: #86efac; }
.ldi-badge-towatch  { background: #1e3a5f; color: #93c5fd; }

.ldi-queue-btn {
    display: inline-block;
    font-size: 0.72rem;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
    font-family: inherit;
    cursor: default;
}
.ldi-queue-in {
    background: rgba(134,239,172,0.1);
    color: #86efac;
    border: 1px solid rgba(134,239,172,0.25);
}
.ldi-queue-add {
    background: rgba(147,197,253,0.12);
    color: #93c5fd;
    border: 1px solid rgba(147,197,253,0.3);
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}
.ldi-queue-add:hover {
    background: rgba(147,197,253,0.22);
    border-color: rgba(147,197,253,0.5);
}
.list-remove-btn {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px 6px;
    flex-shrink: 0;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}
.list-remove-btn:hover { color: #f87171; background: rgba(248,113,113,0.1); }
.btn-list {
    background: rgba(167, 139, 250, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 6px; cursor: pointer; transition: background 0.2s;
}
.btn-list:hover { background: rgba(167, 139, 250, 0.25); }
#add-to-list-popup button:not([onclick="closeAddToListPopup()"]):hover {
    background: rgba(255,255,255,0.06) !important;
}
/* ─────────────────────────────────────────────────────────────────────────── */

/* Invite card in Groups > Invites tab */
.invite-from-badge {
    font-size: 0.82rem;
    color: #aaa;
    white-space: nowrap;
}

/* ─────────────────────────────────────────────────────────────────────────── */

/* Social Hub unread badge */
.social-hub-badge {
    display: inline-block;
    color: #FFD700;
    font-size: 0.75rem;
    margin-left: 4px;
    vertical-align: middle;
    animation: badge-pulse 2s ease-in-out infinite;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.7);
    line-height: 1;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1;   transform: scale(1);    }
    50%       { opacity: 0.7; transform: scale(1.15); }
}

/* === DASHBOARD - BENTO GRID === */
.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    border-color: var(--electric-blue);
    box-shadow: 0 0 20px var(--glow-blue);
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--electric-blue), var(--neon-lime));
    opacity: 0;
    transition: opacity var(--transition-base);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card h3 {
    color: var(--text-heading);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-data);
    letter-spacing: -0.02em;
}

.stat-card p {
    color: var(--text-body);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-weight: 600;
}

/* Dashboard Activity Feed */
.dashboard-activity-feed {
    margin-top: var(--spacing-xl);
}

.dashboard-activity-feed h2 {
    color: var(--text-heading);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.activity-feed-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Activity Card Styles */
.dashboard-activity-item {
    background: linear-gradient(135deg, rgba(0, 191, 191, 0.05) 0%, rgba(0, 191, 191, 0.02) 100%);
    border: 1px solid rgba(0, 191, 191, 0.2);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-md);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInActivity 0.5s ease forwards;
}

.dashboard-activity-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #00BFBF 0%, rgba(0, 191, 191, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dashboard-activity-item:hover {
    background: linear-gradient(135deg, rgba(0, 191, 191, 0.1) 0%, rgba(0, 191, 191, 0.05) 100%);
    border-color: rgba(0, 191, 191, 0.4);
    transform: translateX(5px);
    box-shadow: 0 4px 20px rgba(0, 191, 191, 0.1);
}

.dashboard-activity-item:hover::before {
    opacity: 1;
}

.activity-icon {
    font-size: 1.75rem;
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 191, 191, 0.1);
    border: 1px solid rgba(0, 191, 191, 0.3);
    border-radius: 50%;
    flex-shrink: 0;
    position: relative;
    animation: pulseIcon 2s ease-in-out infinite;
}

.activity-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(45deg, #00BFBF, transparent);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.dashboard-activity-item:hover .activity-icon::after {
    opacity: 0.3;
}

.activity-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.activity-details p {
    color: var(--text-body);
    margin: 0;
    line-height: 1.5;
    font-size: 0.9rem;
}

.activity-details strong {
    color: var(--text-heading);
    font-weight: 600;
}

.activity-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.activity-note {
    display: block;
    margin-top: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    border-left: 2px solid rgba(0, 191, 191, 0.5);
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-radius: 2px;
}

.no-activity {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
    font-style: italic;
    background: rgba(0, 0, 0, 0.2);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sharp);
}

/* Activity Animation Keyframes */
@keyframes slideInActivity {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulseIcon {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(0, 191, 191, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 10px 2px rgba(0, 191, 191, 0.2);
    }
}

/* Stagger animation delay for each item */
.dashboard-activity-item:nth-child(1) { animation-delay: 0.05s; }
.dashboard-activity-item:nth-child(2) { animation-delay: 0.1s; }
.dashboard-activity-item:nth-child(3) { animation-delay: 0.15s; }
.dashboard-activity-item:nth-child(4) { animation-delay: 0.2s; }
.dashboard-activity-item:nth-child(5) { animation-delay: 0.25s; }
.dashboard-activity-item:nth-child(6) { animation-delay: 0.3s; }
.dashboard-activity-item:nth-child(7) { animation-delay: 0.35s; }
.dashboard-activity-item:nth-child(8) { animation-delay: 0.4s; }
.dashboard-activity-item:nth-child(9) { animation-delay: 0.45s; }
.dashboard-activity-item:nth-child(10) { animation-delay: 0.5s; }

/* === GROUPS SECTION === */
/* ── Group Views: hide all, show only active ──────────────────────────────── */
.group-view { display: none; }
.group-view.active { display: block; }

/* ── Discover Hero ─────────────────────────────────────────────────────────── */
.discover-hero {
    background: linear-gradient(135deg, rgba(167,139,250,0.15) 0%, rgba(0,191,191,0.08) 60%, rgba(0,0,0,0) 100%);
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: var(--radius-sharp);
    padding: 28px 28px 24px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.discover-hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, #a78bfa, #00BFBF, #a78bfa);
}
.discover-hero h2 {
    margin: 0 0 6px;
    font-size: 1.4rem;
    font-weight: 700;
    background: linear-gradient(90deg, #a78bfa, #00BFBF);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.discover-hero p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ── Discover section headings ─────────────────────────────────────────────── */
.discover-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.discover-section-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-heading);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.discover-section-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 32px 0 28px;
}

/* ── Community List Cards ──────────────────────────────────────────────────── */
.cl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}
.cl-card {
    background: linear-gradient(135deg, rgba(167,139,250,0.07) 0%, rgba(167,139,250,0.02) 100%);
    border: 1px solid rgba(167,139,250,0.18);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(16px);
    animation: slideUpGroup 0.5s ease forwards;
}
.cl-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, #a78bfa 0%, rgba(167,139,250,0.2) 100%);
    opacity: 0;
    transition: opacity 0.3s;
}
.cl-card:hover {
    border-color: rgba(167,139,250,0.4);
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(167,139,250,0.15);
}
.cl-card:hover::before { opacity: 1; }

.cl-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
}
.cl-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    text-transform: uppercase;
}
.cl-username {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.cl-username strong {
    color: #a78bfa;
    font-weight: 600;
}
.cl-title {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.3;
    margin: 0;
}
.cl-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
    flex: 1;
}
.cl-stats {
    display: flex;
    gap: 12px;
    align-items: center;
}
.cl-stat {
    font-size: 0.75rem;
    color: #888;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cl-stat-fire { color: #f59e0b; font-weight: 600; }
.cl-clone-btn {
    background: linear-gradient(135deg, rgba(167,139,250,0.2), rgba(124,58,237,0.2));
    border: 1px solid rgba(167,139,250,0.35);
    color: #a78bfa;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    width: 100%;
    text-align: center;
    transition: all 0.2s;
    margin-top: auto;
}
.cl-clone-btn:hover {
    background: linear-gradient(135deg, rgba(167,139,250,0.35), rgba(124,58,237,0.3));
    border-color: rgba(167,139,250,0.6);
    box-shadow: 0 0 14px rgba(167,139,250,0.25);
}

.groups-container {
    margin-top: var(--spacing-lg);
}

.groups-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    animation: fadeIn 0.4s ease;
}

/* Group Card Styles */
.group-card {
    background: linear-gradient(135deg, rgba(0, 191, 191, 0.05) 0%, rgba(0, 191, 191, 0.02) 100%);
    border: 1px solid rgba(0, 191, 191, 0.2);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUpGroup 0.5s ease forwards;
}

.group-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #00BFBF 0%, rgba(0, 191, 191, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.group-card:hover {
    background: linear-gradient(135deg, rgba(0, 191, 191, 0.1) 0%, rgba(0, 191, 191, 0.05) 100%);
    border-color: rgba(0, 191, 191, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 191, 191, 0.15);
}

.group-card:hover::before {
    opacity: 1;
}

.group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.group-header h3 {
    color: var(--text-heading);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
    flex: 1;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.group-name-link {
    cursor: pointer;
    transition: color 0.2s ease;
}

.group-name-link:hover {
    color: #00BFBF !important;
}

.owner-badge,
.member-badge,
.public-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border: 1px solid;
}

.owner-badge {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.15), rgba(255, 215, 0, 0.05));
    border-color: rgba(255, 215, 0, 0.3);
    color: #FFD700;
}

.member-badge {
    background: linear-gradient(135deg, rgba(0, 191, 191, 0.15), rgba(0, 191, 191, 0.05));
    border-color: rgba(0, 191, 191, 0.3);
    color: #00BFBF;
}

.public-badge {
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.15), rgba(76, 175, 80, 0.05));
    border-color: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
}

.group-description {
    color: var(--text-body);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: rgba(0, 0, 0, 0.2);
    border-left: 2px solid rgba(0, 191, 191, 0.3);
    border-radius: 2px;
}

.group-info {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    margin-bottom: var(--spacing-md);
    padding-top: var(--spacing-sm);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.group-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.member-count,
.privacy-status,
.created-by {
    background: rgba(0, 191, 191, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(0, 191, 191, 0.2);
}

.group-actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    margin-top: var(--spacing-md);
}

.group-actions button {
    flex: 1;
    min-width: 100px;
    font-size: 0.85rem;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

/* Requests Container */
.requests-container {
    margin-top: var(--spacing-lg);
}

.requests-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    animation: fadeIn 0.4s ease;
}

.request-card {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.05) 0%, rgba(255, 152, 0, 0.02) 100%);
    border: 1px solid rgba(255, 152, 0, 0.2);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-md);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateX(20px);
    animation: slideInRight 0.5s ease forwards;
}

.request-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(180deg, #FF9800 0%, rgba(255, 152, 0, 0.3) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.request-card:hover {
    background: linear-gradient(135deg, rgba(255, 152, 0, 0.1) 0%, rgba(255, 152, 0, 0.05) 100%);
    border-color: rgba(255, 152, 0, 0.4);
    transform: translateX(-5px);
    box-shadow: 0 4px 20px rgba(255, 152, 0, 0.1);
}

.request-card:hover::before {
    opacity: 1;
}

.request-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.request-header h4 {
    color: var(--text-heading);
    font-size: 1rem;
    margin: 0;
    font-weight: 600;
}

.request-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.request-status.pending {
    background: rgba(255, 152, 0, 0.2);
    color: #FF9800;
    border: 1px solid rgba(255, 152, 0, 0.4);
}

.request-status.approved {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.4);
}

.request-status.rejected {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.4);
}

.request-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
}

/* Group Animation Keyframes */
@keyframes slideUpGroup {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    0% {
        opacity: 0;
        transform: translateX(20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

/* Stagger animation delay for group cards */
.group-card:nth-child(1) { animation-delay: 0.05s; }
.group-card:nth-child(2) { animation-delay: 0.1s; }
.group-card:nth-child(3) { animation-delay: 0.15s; }
.group-card:nth-child(4) { animation-delay: 0.2s; }
.group-card:nth-child(5) { animation-delay: 0.25s; }
.group-card:nth-child(6) { animation-delay: 0.3s; }
.group-card:nth-child(7) { animation-delay: 0.35s; }
.group-card:nth-child(8) { animation-delay: 0.4s; }
.group-card:nth-child(9) { animation-delay: 0.45s; }
.group-card:nth-child(10) { animation-delay: 0.5s; }

/* Stagger animation delay for request cards */
.request-card:nth-child(1) { animation-delay: 0.05s; }
.request-card:nth-child(2) { animation-delay: 0.1s; }
.request-card:nth-child(3) { animation-delay: 0.15s; }
.request-card:nth-child(4) { animation-delay: 0.2s; }
.request-card:nth-child(5) { animation-delay: 0.25s; }

/* === MEDIA CARDS - HIGH-DENSITY GRID === */
.media-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

.media-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    overflow: hidden;
    transition: all var(--transition-base);
    cursor: pointer;
    position: relative;
}

.media-item:hover {
    border-color: var(--electric-blue);
    box-shadow: 0 4px 16px var(--glow-blue);
    transform: translateY(-4px);
}

.media-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    position: relative;
    transition: all 0.3s ease;
}

.media-poster:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.poster-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.poster-placeholder:hover {
    border-color: var(--electric-blue);
    transform: scale(1.02);
}

.poster-placeholder-title {
    position: absolute;
    top: var(--spacing-md);
    left: var(--spacing-md);
    right: var(--spacing-md);
    color: var(--text-heading);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.poster-placeholder-logo {
    max-width: 60%;
    max-height: 50%;
    opacity: 0.3;
    filter: brightness(0.8);
}

.media-detail-poster-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border: 2px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.media-detail-poster-placeholder .poster-placeholder-title {
    font-size: 1.1rem;
}

.media-detail-poster-placeholder .poster-placeholder-logo {
    max-width: 70%;
    max-height: 60%;
}

.media-item h3 {
    transition: color 0.2s ease;
}

.media-item h3:hover {
    color: var(--electric-blue);
}

/* Season badges */
.media-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
}

.season-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.season-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 4px;
    background: var(--electric-blue);
    color: white;
    border-radius: 11px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--bg-primary);
    white-space: nowrap;
}

/* Synopsis styles */
.synopsis {
    color: var(--text-body);
    font-size: 0.875rem;
    line-height: 1.6;
    margin: var(--spacing-sm) 0;
}

.synopsis-mobile {
    display: none;
    color: var(--text-body);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: var(--spacing-sm) 0;
    font-style: italic;
}

/* Show mobile synopsis and hide full synopsis on mobile */
@media (max-width: 768px) {
    .synopsis {
        display: none;
    }

    .synopsis-mobile {
        display: block;
    }
}

.media-poster-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    overflow: hidden;
}

.media-poster-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-poster-container::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, transparent, rgba(5, 5, 5, 0.95));
    pointer-events: none;
}

.media-info {
    padding: var(--spacing-md);
    background: var(--bg-surface);
}

.media-title {
    color: var(--text-heading);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-xs);
}

.media-genre,
.media-type {
    color: var(--text-body);
    font-size: 0.75rem;
    font-family: var(--font-data);
}

.media-date {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--font-data);
}

/* === SEGMENTED BAR RATING SYSTEM === */
.rating-display,
.rating-input {
    display: flex;
    gap: 4px;
    align-items: center;
}

.rating-segment {
    width: 32px;
    height: 6px;
    background: var(--border-dark);
    border-radius: 1px;
    transition: all var(--transition-fast);
}

.rating-segment.filled {
    background: var(--neon-lime);
    box-shadow: 0 0 8px var(--glow-lime);
}

.rating-segment:hover {
    background: var(--neon-lime);
    opacity: 0.6;
}

.rating-value {
    color: var(--neon-lime);
    font-family: var(--font-data);
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: var(--spacing-sm);
}

.rating-label {
    color: var(--text-muted);
    font-size: 0.75rem;
    margin-left: var(--spacing-sm);
}

/* Star Rating */
.stars {
    display: flex;
    gap: 2px;
}

.star {
    color: rgba(255, 255, 255, 0.25);
    font-size: 32px;
    cursor: pointer;
    transition: color var(--transition-fast), text-shadow var(--transition-fast);
    user-select: none;
    line-height: 1;
}

.star.active {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.star.hover {
    color: #FFD700;
    opacity: 0.75;
}

/* Backward compatibility */
.star.filled {
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* === CONTROLS & FILTERS === */
.controls {
    margin-bottom: var(--spacing-lg);
}

.controls h2 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === GROUP CONTROLS / VIEW TABS === */
.group-controls {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.group-view-tabs {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.group-view-tab {
    background: transparent;
    color: var(--text-body);
    border: 1px solid var(--border-dark);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    white-space: nowrap;
}

.group-view-tab:hover:not(.active) {
    border-color: var(--electric-blue);
    color: var(--electric-blue);
}

.group-view-tab.active {
    background: var(--electric-blue);
    color: var(--bg-primary);
    border-color: var(--electric-blue);
    box-shadow: 0 0 16px var(--glow-blue);
}

.group-view-tab .badge {
    background: var(--neon-lime);
    color: var(--bg-primary);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    min-width: 16px;
    text-align: center;
    line-height: 1.4;
}

.group-view-tab.active .badge {
    background: var(--bg-primary);
    color: var(--electric-blue);
}

.search-filter {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
}

.filter-actions {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: nowrap;
}

/* === MODALS === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--spacing-lg);
}

.modal.show {
    display: flex !important;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--spacing-lg);
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-xl);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-dark);
}

.modal-header h3 {
    color: var(--text-heading);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Canonical close button — shared by .close, .modal-close, .tmdb-modal-close */
.close,
.modal-close {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sharp);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
}

.close:hover,
.modal-close:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
}

/* === MODAL FORM FIELDS === */
.modal-form-group {
    margin-bottom: var(--spacing-md);
}

.modal-form-group label {
    display: block;
    color: var(--text-body);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-xs);
}

.modal-form-group input,
.modal-form-group select,
.modal-form-group textarea {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    color: var(--text-heading);
    font-size: 0.875rem;
    font-family: var(--font-ui);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    box-sizing: border-box;
}

.modal-form-group input:focus,
.modal-form-group select:focus,
.modal-form-group textarea:focus {
    outline: none;
    border-color: var(--electric-blue);
    box-shadow: 0 0 12px var(--glow-blue);
}

.modal-form-group textarea {
    resize: vertical;
    min-height: 64px;
}

#review-notes {
    min-height: 64px;
    resize: vertical;
}

/* === NOTIFICATION BOX === */
.notification-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-xl);
    z-index: 10001;
    width: 90vw;
    max-width: 400px;
    min-width: 0;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.notification-content h3 {
    color: var(--text-heading);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.notification-content p {
    color: var(--text-body);
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.notification-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
}

.notification-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sharp);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
}

.notification-close:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
}

.notification-action-btn {
    background: var(--electric-blue);
    color: var(--bg-primary);
    border: 1px solid var(--electric-blue);
    padding: var(--spacing-md) var(--spacing-xl);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: all var(--transition-fast);
}

.notification-action-btn:hover {
    background: var(--electric-blue-hover);
    box-shadow: 0 0 16px var(--glow-blue);
}

/* === ERROR MESSAGES === */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-left: 3px solid #EF4444;
    border-radius: var(--radius-sharp);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.error-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.error-content {
    flex: 1;
}

.error-title {
    font-weight: 600;
    color: #FCA5A5;
    margin-bottom: var(--spacing-xs);
    font-size: 0.875rem;
}

.error-details {
    color: #FCA5A5;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.error-close {
    background: transparent;
    border: 1px solid rgba(252, 165, 165, 0.3);
    color: #FCA5A5;
    font-size: 0.875rem;
    line-height: 1;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sharp);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
}

.error-close:hover {
    border-color: #FCA5A5;
    background: rgba(239, 68, 68, 0.15);
    color: #fff;
}

/* === FEATURES GRID (Homepage) === */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.feature-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-lg);
    transition: all var(--transition-base);
}

.feature-card:hover {
    border-color: var(--electric-blue);
    box-shadow: 0 0 20px var(--glow-blue);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
}

.feature-card h3 {
    color: var(--text-heading);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.feature-card p {
    color: var(--text-body);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* === HOW TO USE SECTION === */
.how-to-use {
    margin-bottom: var(--spacing-xl);
}

.how-to-use h2 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
}

.step {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--electric-blue);
    color: var(--bg-primary);
    border-radius: var(--radius-sharp);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-data);
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.step-content h4 {
    color: var(--text-heading);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.step-content p {
    color: var(--text-body);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* === USER TYPES === */
.user-types {
    margin-bottom: var(--spacing-xl);
}

.user-types h2 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-lg);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.user-types-grid {
    display: grid;
    /* 4 tier cards — always 2x2 on desktop/tablet so the grid is never lopsided,
       and a single column on phones. Max-width keeps cards readable on wide screens. */
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    max-width: 900px;
    margin: 0 auto;
}
@media (max-width: 720px) {
    .user-types-grid { grid-template-columns: 1fr; max-width: none; }
}

/* Sign-up CTAs on each tier card — same look as pricing.html's btn-subscribe.
   Anchored to the bottom of the card so all 4 buttons align horizontally even
   when the feature lists differ in length. */
.user-type-card {
    display: flex;
    flex-direction: column;
}
.user-type-card .user-type-note {
    margin-bottom: var(--spacing-md);
}
.user-type-card .user-type-cta {
    margin-top: auto;
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    background: #7c3aed;
    color: #fff;
    transition: background 0.2s;
}
.user-type-card .user-type-cta:hover { background: #6d28d9; }
.user-type-card .user-type-cta--free {
    background: #2a2a2a;
    color: #aaa;
}
.user-type-card .user-type-cta--free:hover {
    background: #333;
    color: #fff;
}

.user-type-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-xl);
    position: relative;
    transition: all var(--transition-base);
}

.user-type-card.featured {
    border-color: var(--electric-blue);
}

.user-type-card:hover {
    box-shadow: 0 0 20px var(--glow-blue);
}

.user-type-badge {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-sharp);
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-family: var(--font-data);
}

.user-type-badge.free {
    background: #16a34a;
    color: #fff;
    border: none;
}

.user-type-badge.premium {
    background: var(--electric-blue);
    color: var(--bg-primary);
}

.user-type-card h3 {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
}

.user-type-subtitle {
    color: var(--text-body);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-lg);
}

.user-type-features {
    list-style: none;
    margin-bottom: var(--spacing-lg);
}

.user-type-features li {
    color: var(--text-body);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
    padding-left: var(--spacing-lg);
    position: relative;
}

.user-type-features li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--electric-blue);
    font-family: var(--font-data);
}

.user-type-note {
    color: var(--text-muted);
    font-size: 0.8125rem;
    font-style: italic;
}

/* === CTA SECTION === */
.cta-section {
    text-align: center;
    padding: var(--spacing-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
}

.cta-section h2 {
    color: var(--text-heading);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cta-section p {
    color: var(--text-body);
    font-size: 1rem;
    margin-bottom: var(--spacing-lg);
}

.cta-buttons {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    flex-wrap: wrap;
}

.btn-large {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: 1rem;
}

/* === TAB CONTENT === */
.tab-content {
    display: none !important;
}

.tab-content.active {
    display: block !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* === QUEUE HEADER === */
.queue-header {
    margin-bottom: var(--spacing-lg);
}

.queue-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

.btn-add-media {
    background: var(--electric-blue);
    color: var(--bg-primary);
    border: 1px solid var(--electric-blue);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.btn-add-media:hover {
    background: var(--electric-blue-hover);
    box-shadow: 0 0 16px var(--glow-blue);
}

.queue-sub-nav {
    display: flex;
    gap: var(--spacing-sm);
}

.queue-nav-btn {
    background: transparent;
    color: var(--text-body);
    border: 1px solid var(--border-dark);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.queue-nav-btn:hover,
.queue-nav-btn.active {
    border-color: var(--electric-blue);
    color: var(--electric-blue);
}

.nav-icon svg {
    width: 16px;
    height: 16px;
}

/* === BULK ACTIONS === */
.bulk-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
    padding: var(--spacing-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    margin-bottom: var(--spacing-md);
}

/* === MOBILE FILTER TOGGLE === */
.mobile-filter-toggle {
    display: none;
    width: 100%;
    background: var(--bg-surface);
    color: var(--text-heading);
    border: 1px solid var(--border-dark);
    padding: var(--spacing-md);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* === SUB-TAB CONTENT === */
.sub-tab-content {
    display: none;
}

.sub-tab-content.active {
    display: block;
}

/* === TITLE INPUT GROUP === */
.title-input-group {
    display: flex;
    gap: var(--spacing-sm);
}

.title-input-group input {
    flex: 1;
}

.btn-tmdb,
.btn-autofill {
    background: transparent;
    color: var(--text-heading);
    border: 1px solid var(--border-dark);
    padding: var(--spacing-md);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.75rem;
    white-space: nowrap;
    transition: all var(--transition-fast);
}

.btn-tmdb:hover,
.btn-autofill:hover {
    border-color: var(--neon-lime);
    color: var(--neon-lime);
}

/* === TRAILER === */
.trailer-group {
    margin-top: var(--spacing-md);
}

.trailer-input-group {
    display: flex;
    gap: var(--spacing-sm);
}

.trailer-input-group input {
    flex: 1;
}

.btn-trailer-preview {
    background: transparent;
    color: var(--text-heading);
    border: 1px solid var(--border-dark);
    padding: var(--spacing-md);
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.75rem;
    transition: all var(--transition-fast);
}

.btn-trailer-preview:hover {
    border-color: var(--electric-blue);
    color: var(--electric-blue);
}

.trailer-info {
    display: block;
    margin-top: var(--spacing-xs);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .header {
        padding: var(--spacing-md);
    }

    .header-content {
        flex-direction: row;
        align-items: center;
        flex-wrap: nowrap;
    }

    .header-content .user-info {
        margin-left: auto;
        flex-shrink: 0;
    }

    .content {
        padding: var(--spacing-md);
    }

    .dashboard {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: var(--spacing-sm);
    }

    .media-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-sm);
    }

    .nav-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-tab {
        flex-shrink: 0;
    }

    .hero-title {
        font-size: 2rem;
    }

    .auth-buttons-container {
        position: static;
        justify-content: center;
        margin-bottom: var(--spacing-md);
    }

    .mobile-filter-toggle {
        display: block;
    }

    .search-filter {
        display: none;
    }

    .search-filter.show {
        display: grid;
    }

    .queue-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .queue-sub-nav {
        width: 100%;
        justify-content: space-between;
    }

    .name-fields {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .stat-card h3 {
        font-size: 2rem;
    }

    .media-list {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .modal-content {
        padding: var(--spacing-lg);
    }
}

/* === ANIMATIONS === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* === TMDB MODAL === */
.tmdb-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(5, 5, 5, 0.9);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    z-index: 10002; /* above .modal (10000) and list-detail-modal */
}

.tmdb-modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-xl);
    max-width: 900px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    position: relative;
    animation: fadeIn 0.3s ease-out;
}

.tmdb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-dark);
}

.tmdb-modal-header h3 {
    color: var(--text-heading);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

/* Inherits all close-button styles via .close / .modal-close shared rule above */
.tmdb-modal-close {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sharp);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
}

.tmdb-modal-close:hover {
    border-color: #e74c3c;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
}

.tmdb-modal-body {
    color: var(--text-body);
}

.tmdb-modal-body p {
    margin-bottom: var(--spacing-md);
    color: var(--text-muted);
}

.tmdb-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
}

.tmdb-movie-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-md);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.tmdb-movie-card:hover {
    border-color: var(--electric-blue);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 150, 255, 0.2);
}

.tmdb-movie-poster {
    width: 100%;
    border-radius: var(--radius-sharp);
    margin-bottom: var(--spacing-sm);
    aspect-ratio: 2/3;
    object-fit: cover;
}

.tmdb-movie-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: var(--spacing-xs);
    line-height: 1.3;
}

.tmdb-movie-year {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
}

.tmdb-movie-overview {
    font-size: 0.875rem;
    color: var(--text-body);
    line-height: 1.5;
    margin-bottom: var(--spacing-sm);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tmdb-trailer-badge {
    background: linear-gradient(135deg, var(--electric-blue), var(--vivid-purple));
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-sharp);
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
    margin-top: var(--spacing-xs);
}

/* === MEDIA DETAIL MODAL === */
.media-detail-content {
    max-width: 900px;
    width: 95%;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow: hidden;
}

#detail-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
    padding: 14px 20px;
    background: var(--bg-card, #1c1c28);
    border-top: 1px solid var(--border-dark, #333);
}

@media (max-width: 768px) {
    #detail-modal-actions {
        justify-content: center;
        padding: 10px 14px;
        gap: 6px;
    }

    #detail-modal-actions .btn-modal {
        flex: 1 1 calc(50% - 6px);
        min-width: 100px;
        text-align: center;
        padding: 8px 6px;
        font-size: 0.78rem;
    }
}

.media-detail-body {
    max-height: 75vh;
    overflow-y: auto;
}

.media-detail-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
}

.media-detail-poster-column {
    display: flex;
    flex-direction: column;
}

.media-detail-poster {
    width: 100%;
    border-radius: var(--radius-sharp);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.media-detail-info-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.media-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.detail-badge {
    padding: 6px 12px;
    border-radius: var(--radius-sharp);
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    display: inline-block;
}

.modal-actions-top {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.modal-actions-top .btn-modal {
    padding: 6px 12px;
    white-space: nowrap;
    line-height: 1.2;
    font-size: 0.875rem;
}

.media-detail-meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.detail-meta-item {
    color: var(--text-body);
    font-size: 0.95rem;
}

.detail-meta-item strong {
    color: var(--text-heading);
    margin-right: var(--spacing-xs);
}

.trailer-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sharp);
    background: #000;
}

.trailer-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--radius-sharp);
}

/* Responsive layout for smaller screens (Pixel 10 Pro / Mobile) */
@media (max-width: 768px) {
    .modal,
    .modal.show {
        padding: 0 !important;
        align-items: flex-end !important; /* Bottom sheet modal presentation on mobile */
        justify-content: center !important;
    }

    .modal.show {
        display: flex !important;
    }

    .modal-content,
    .media-detail-content {
        padding: 14px 16px !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 88vh !important;
        max-height: 88dvh !important;
        border-radius: 20px 20px 0 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.9) !important;
    }

    .modal-header {
        padding: 10px 0 !important;
        flex-shrink: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        margin-bottom: 10px !important;
    }

    .modal-header h3 {
        font-size: 1.1rem !important;
    }

    .media-detail-body {
        flex: 1 !important;
        max-height: calc(88dvh - 120px) !important;
        padding: 6px 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .media-detail-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }

    .media-detail-poster-column {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }

    .media-detail-poster {
        max-width: 130px !important;
        max-height: 180px !important;
        width: auto !important;
        height: auto !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        margin: 0 auto !important;
    }

    #detail-modal-actions,
    .modal-actions {
        flex-shrink: 0 !important;
        padding: 10px 8px !important;
        gap: 6px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
        background: #14141e !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    #detail-modal-actions .btn-modal,
    .modal-actions .btn-modal {
        flex: 1 1 calc(33.33% - 6px) !important;
        min-width: 80px !important;
        font-size: 0.75rem !important;
        padding: 8px 4px !important;
        text-align: center !important;
        margin: 0 !important;
    }
}

/* === RELEASE ALERT BANNER === */
.release-alert {
    display: none;
    align-items: center;
    gap: var(--spacing-sm);
    background: linear-gradient(135deg, var(--electric-blue), var(--vivid-purple));
    color: white;
    padding: 8px 12px;
    border-radius: var(--radius-sharp);
    margin-left: var(--spacing-md);
    font-size: 0.875rem;
    animation: slideInRight 0.4s ease-out;
    box-shadow: 0 4px 12px rgba(0, 150, 255, 0.3);
    /* Cap width so it never pushes the avatar off screen */
    max-width: 260px;
    min-width: 0;
    overflow: hidden;
    flex-shrink: 1;
}

.release-alert-content {
    display: block;
    cursor: pointer;
    padding: 4px 0;
    white-space: nowrap;
    overflow: hidden;
    /* Scroll the text when it's wider than the container */
    animation: releaseScroll 12s linear infinite;
    animation-play-state: running;
}

.release-alert-content:hover {
    animation-play-state: paused;
    opacity: 0.9;
}

@keyframes releaseScroll {
    0%   { transform: translateX(0); }
    20%  { transform: translateX(0); }
    80%  { transform: translateX(-60%); }
    100% { transform: translateX(0); }
}

.release-alert-content strong {
    font-weight: 700;
}

.release-alert-close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: rgba(255, 255, 255, 0.7);
    width: 24px;
    height: 24px;
    border-radius: var(--radius-sharp);
    cursor: pointer;
    font-size: 0.875rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    font-family: var(--font-ui);
}

.release-alert-close:hover {
    border-color: rgba(255, 255, 255, 0.7);
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* === CALENDAR STYLES === */
.calendar-container {
    background: var(--bg-surface);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-dark);
}

.calendar-month-year {
    color: var(--text-heading);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.calendar-nav-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    color: var(--text-heading);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sharp);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.calendar-nav-btn:hover {
    border-color: var(--electric-blue);
    color: var(--electric-blue);
    transform: scale(1.05);
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: var(--spacing-sm);
}

.calendar-weekday {
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 8px 0;
}

.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.calendar-day {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    min-height: 100px;
    padding: 8px;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
}

.calendar-day.empty {
    background: transparent;
    border-color: transparent;
}

.calendar-day.today {
    border-color: var(--electric-blue);
    box-shadow: 0 0 12px rgba(0, 150, 255, 0.3);
}

.calendar-day.has-releases {
    background: linear-gradient(135deg, rgba(124, 58, 237, 0.15), rgba(79, 70, 229, 0.2));
    border: 1px solid rgba(139, 92, 246, 0.4);
    cursor: pointer;
}

.calendar-day.has-releases:hover {
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(124, 58, 237, 0.3);
}

.calendar-day.has-releases .calendar-day-number {
    color: #a78bfa;
    font-weight: 700;
}

.calendar-release-title {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: white;
    padding: 5px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1.3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
}

.calendar-release-title:hover {
    transform: translateX(2px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
}

/* === ENHANCED TV SHOW CALENDAR STYLES (TVShowCalendar Feature Upgrade) === */
.calendar-hero-banner {
    background: linear-gradient(135deg, rgba(30, 27, 75, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.calendar-hero-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #a78bfa;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.calendar-hero-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
}

.calendar-hero-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 14px;
    min-width: 220px;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calendar-hero-card:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: #8b5cf6;
    transform: translateY(-2px);
}

.calendar-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    background: var(--bg-surface-elevated, #1a1a24);
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-dark, #333);
}

.calendar-filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.calendar-filter-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ccc;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-filter-btn:hover, .calendar-filter-btn.active {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 0 12px rgba(124, 58, 237, 0.4);
}

.calendar-search-input {
    background: #111118;
    border: 1px solid #333;
    color: #fff;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s;
    width: 200px;
}

.calendar-search-input:focus {
    border-color: #8b5cf6;
}

.ep-badge {
    background: #7c3aed;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    margin-right: 4px;
    display: inline-block;
}

.network-pill {
    font-size: 0.6rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-block;
    margin-left: 4px;
}

.network-hbo { background: #5822b4; color: #fff; }
.network-netflix { background: #e50914; color: #fff; }
.network-apple { background: #333333; color: #fff; border: 1px solid #555; }
.network-amazon { background: #00a8e1; color: #fff; }
.network-disney { background: #113ccf; color: #fff; }
.network-bbc { background: #bb1919; color: #fff; }
.network-hulu { background: #1ce783; color: #000; }
.network-paramount { background: #0064ff; color: #fff; }
.network-default { background: #4b5563; color: #fff; }

/* === CALENDAR DAY MODAL === */
.calendar-day-content {
    max-width: 900px;
    width: 90%;
}

.calendar-day-releases {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
}

.calendar-release-card {
    background: var(--bg-card);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-sharp);
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.calendar-release-card:hover {
    border-color: var(--electric-blue);
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 150, 255, 0.2);
}

.calendar-release-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.calendar-release-info {
    padding: var(--spacing-md);
}

.calendar-release-info h4 {
    color: var(--text-heading);
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xs);
}

.calendar-release-genre {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: var(--spacing-sm);
}

.calendar-release-synopsis {
    color: var(--text-body);
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Responsive Calendar (Mobile Optimized) */
@media (max-width: 768px) {
    .calendar-container {
        padding: 10px;
        border-radius: 8px;
    }

    .calendar-header {
        margin-bottom: 12px;
        padding-bottom: 8px;
    }

    .calendar-month-year {
        font-size: 1.15rem;
    }

    .calendar-nav-btn {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .calendar-hero-banner {
        padding: 12px 14px;
        margin-bottom: 14px;
        border-radius: 10px;
    }

    .calendar-hero-title {
        font-size: 0.85rem;
        margin-bottom: 8px;
    }

    .calendar-hero-list {
        gap: 10px;
        -webkit-overflow-scrolling: touch;
    }

    .calendar-hero-card {
        min-width: 170px;
        flex: 0 0 170px;
        padding: 8px 10px;
    }

    .calendar-filter-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 10px;
        margin-bottom: 14px;
    }

    .calendar-filter-group {
        width: 100%;
        justify-content: space-between;
    }

    .calendar-filter-btn {
        flex: 1;
        text-align: center;
        padding: 8px 6px;
        font-size: 0.8rem;
    }

    .calendar-search-input {
        width: 100%;
        font-size: 0.85rem;
        padding: 8px 12px;
    }

    .calendar-weekdays {
        gap: 3px;
    }

    .calendar-weekday {
        font-size: 0.75rem;
        padding: 4px 0;
    }

    .calendar-days {
        gap: 4px;
    }

    .calendar-day {
        min-height: 65px;
        padding: 4px 3px;
        border-radius: 6px;
        grid-column: span 1 !important; /* Keep exact 7-column grid alignment */
    }

    .calendar-day.has-releases {
        min-height: 65px;
        padding: 4px 3px;
        grid-column: span 1 !important;
        background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(79, 70, 229, 0.25));
        border-color: rgba(139, 92, 246, 0.4);
    }

    .calendar-day-number {
        font-size: 0.8rem;
        margin-bottom: 2px;
    }

    .calendar-day.has-releases .calendar-day-number {
        font-size: 0.85rem;
        color: #a78bfa;
        margin-bottom: 2px;
    }

    .calendar-releases-list {
        max-height: 48px;
        gap: 2px;
    }

    .calendar-release-title {
        font-size: 0.62rem;
        padding: 2px 4px;
        border-radius: 3px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .calendar-day-releases {
        grid-template-columns: 1fr;
    }

    .release-alert {
        margin-left: 0;
        margin-top: 8px;
        font-size: 0.75rem;
        padding: 6px 10px;
        max-width: 100%;
    }
}

/* === UTILITY CLASSES === */
.text-center {
    text-align: center;
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.hidden {
    display: none !important;
}

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-dark);
    border-radius: var(--radius-sharp);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--electric-blue);
}


/* ── Weekly Intelligence: Smart Banner ──────────────────────────────────── */
.smart-banner {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    background: linear-gradient(135deg, rgba(0, 191, 191, 0.10) 0%, rgba(0, 191, 191, 0.04) 100%);
    border: 1px solid rgba(0, 191, 191, 0.3);
    border-left: 3px solid var(--electric-blue);
    border-radius: var(--radius-sharp);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    animation: slideInActivity 0.4s ease forwards;
}

.smart-banner-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.smart-banner-text {
    flex: 1;
    color: var(--text-primary);
    font-size: 0.9rem;
    line-height: 1.4;
}

.smart-banner-dismiss {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    border-radius: var(--radius-sharp);
    transition: color var(--transition-fast);
    flex-shrink: 0;
}

.smart-banner-dismiss:hover {
    color: var(--text-primary);
}


/* =========================================
   Global Navigation Links — unified six-tab primary nav
   ========================================= */
.global-nav-links {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    justify-content: center;
}

.gnav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted, #A5A5A5);
    text-decoration: none;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border-radius: 6px;
    transition: color 0.18s ease, background 0.18s ease;
    white-space: nowrap;
}

.gnav-link .gnav-icon {
    font-size: 1rem;
    line-height: 1;
    opacity: 0.75;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.gnav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
}
.gnav-link:hover .gnav-icon {
    opacity: 1;
}

/* Active state — visible electric-blue text + 2px underline so the user
   always knows which primary section they are in. */
.gnav-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.12);
}
.gnav-link.active .gnav-icon {
    opacity: 1;
    color: var(--electric-blue, #3B82F6);
}
.gnav-link.active::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 2px;
    background: var(--electric-blue, #3B82F6);
    border-radius: 1px;
}

/* Tablet: collapse labels, show icon-only with tooltip via title */
@media (max-width: 960px) {
    .gnav-link { padding: 10px 10px; gap: 0; }
    .gnav-link .gnav-label { display: none; }
    .gnav-link .gnav-icon { font-size: 1.15rem; }
    .gnav-link.active::after { left: 8px; right: 8px; }
}

/* Mobile: hide the inline primary nav entirely; on small screens the
   primary nav moves to a fixed bottom tab bar (.bottom-nav) instead. */
@media (max-width: 720px) {
    .global-nav-links { display: none !important; }
}

/* ============================================
   Mobile bottom tab bar — primary navigation on small screens.
   Rendered inside #header (statically by components/header.php, or by
   js/header-notif-bell.js on HTML pages) so it inherits the header's
   logged-in visibility. Hidden on desktop; shown <=720px, where the inline
   .global-nav-links is hidden. See docs/navigation-ia-redesign.md (step 4).
   ============================================ */
.bottom-nav { display: none; }

@media (max-width: 720px) {
    .bottom-nav {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9000;
        background: rgba(13, 13, 18, 0.97);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.45);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .bottom-nav-link {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-height: 54px;
        padding: 7px 2px;
        text-decoration: none;
        color: var(--text-muted, #8A8F98);
        transition: color 0.18s ease;
    }
    .bottom-nav-icon { font-size: 1.3rem; line-height: 1; }
    .bottom-nav-label {
        font-size: 0.62rem;
        font-weight: 600;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        white-space: nowrap;
    }
    .bottom-nav-link:active { opacity: 0.7; }
    .bottom-nav-link.active { color: var(--electric-blue, #3B82F6); }

    /* Reserve space so the fixed bar never covers page content (+ iOS safe area).
       Scoped to pages that actually render the bar. */
    body:has(.bottom-nav) { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
}

/* Dropdown-mobile-nav block — superseded by .bottom-nav (step 4); kept as
   harmless dead styles in case any cached markup still references it. */
.dropdown-mobile-nav {
    display: flex;
    flex-direction: column;
}
.dropdown-mobile-nav .dropdown-mobile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-body, #A3A3A3);
    text-decoration: none;
    padding: 10px 14px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.15s ease, color 0.15s ease;
}
.dropdown-mobile-nav .dropdown-mobile-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}
.dropdown-mobile-nav .dropdown-mobile-link.active {
    color: #fff;
    background: rgba(59, 130, 246, 0.15);
}
.dropdown-mobile-nav .dropdown-mobile-link .dropdown-icon {
    color: var(--electric-blue, #3B82F6);
    font-size: 1rem;
}

/* User dropdown additions */
.dropdown-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 6px 0;
}

.msg-badge {
    display: inline-block;
    background: #dc3545;
    color: white;
    border-radius: 10px;
    font-size: 10px;
    padding: 1px 5px;
    min-width: 14px;
    text-align: center;
    margin-left: 4px;
    vertical-align: middle;
}

.msg-badge:empty {
    display: none;
}

/* Hide global nav links on small mobile, rely on hamburger */
@media (max-width: 640px) {
    .global-nav-links {
        display: none;
    }
}

        transform: rotate(360deg);
    }
}

/* Status Badges - Add binging status */
.status-binging {
    background: linear-gradient(135deg, var(--electric-blue), #00d4ff);
    color: white;
}

/* Progress Badge on Media Cards */
.progress-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 8px;
    border-radius: var(--radius-smooth);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--electric-blue);
    z-index: 2;
}

/* Episodes Button */
.btn-episodes {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--electric-blue), #00d4ff);
    color: white;
    border: none;
    border-radius: var(--radius-smooth);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-episodes:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(55, 107, 251, 0.4);
}

/* Mobile Responsiveness */
@media (max-width: 640px) {
    .episode-modal-content {
        max-width: 95%;
    }

    .season-tabs {
        gap: 4px;
    }

    .season-tab {
        padding: 6px 12px;
        font-size: 0.875rem;
    }

    .episode-item {
        padding: var(--spacing-sm);
    }

    .episode-meta {
        flex-direction: column;
        gap: 2px;
    }

    .episode-bulk-actions {
        flex-direction: column;
    }
}

/* ── Subscription Tier Badges ─────────────────────────────────────────────── */
.tier-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}
.tier-binger { background: #1e3a5f; color: #60a5fa; }
.tier-power  { background: #2d1f52; color: #a78bfa; }
.tier-master { background: #3b2200; color: #fbbf24; }

/* ── Trial Banner ─────────────────────────────────────────────────────────── */
.trial-banner {
    background: linear-gradient(135deg, #7c3aed, #4f46e5);
    color: #fff;
    text-align: center;
    padding: 10px 20px;
    font-size: 0.88rem;
}
.trial-banner a { color: #fbbf24; font-weight: 600; text-decoration: none; }
.trial-banner a:hover { text-decoration: underline; }

/* ── Recently Reviewed Community Section ──────────────────────────────── */
.recently-reviewed-section {
    margin: 24px 0;
}
.recently-reviewed-section h2 {
    margin-bottom: 4px;
}
.section-subtitle {
    color: var(--text-secondary, #a0a0a0);
    font-size: 0.85rem;
    margin: 0 0 16px;
}
.recently-reviewed-cards {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 16px;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color, rgba(255,255,255,0.2)) transparent;
}
.recently-reviewed-cards.rr-centered {
    justify-content: center;
}
.rr-card {
    flex: 0 0 calc(20% - 13px);
    min-width: 120px;
    background: var(--card-bg, #1a1a2e);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rr-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.rr-poster-wrap {
    width: 100%;
}
.rr-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    display: block;
}
.rr-poster-placeholder {
    width: 100%;
    aspect-ratio: 2/3;
    background: var(--card-bg-secondary, #0f0f1a);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: var(--text-secondary, #a0a0a0);
    text-align: center;
    padding: 8px;
    gap: 6px;
}
.rr-info {
    padding: 8px;
}
.rr-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    margin-bottom: 5px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.rr-score {
    font-size: 0.7rem;
    color: var(--text-secondary, #a0a0a0);
    line-height: 1.5;
}
.rr-loading,
.rr-empty {
    color: var(--text-secondary, #a0a0a0);
    font-size: 0.9rem;
    padding: 12px 0;
}

/* ── Currently Binging Dashboard Rows ───────────────────────────────────── */
.binging-dash-row {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
}
.binging-dash-row:hover {
    background: rgba(255,255,255,0.09);
    transform: translateX(4px);
}
.binging-dash-art {
    flex-shrink: 0;
    width: 48px;
    height: 72px;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(255,255,255,0.05);
}
.binging-dash-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.binging-dash-poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}
.binging-dash-info {
    flex: 1;
    min-width: 0;
}
.binging-dash-title {
    font-weight: 600;
    color: var(--text-heading, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.binging-dash-meta {
    font-size: 13px;
    color: var(--text-secondary, #A5A5A5);
}
.binging-dash-continue {
    flex-shrink: 0;
    background: var(--electric-blue, #00bfbf);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.binging-dash-continue:hover { opacity: 0.85; }

.binging-dash-lastwatched {
    font-size: 13px;
    color: var(--text-secondary, #A5A5A5);
    margin-top: 2px;
}
.binging-dash-lastwatched strong {
    color: #fff;
    font-weight: 600;
}

.binging-dash-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.binging-dash-mark-next {
    flex-shrink: 0;
    background: var(--success-green, #10B981);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
}
.binging-dash-mark-next:hover {
    background: var(--success-green-hover, #34D399);
}
.binging-dash-mark-next:disabled {
    opacity: 0.6;
    cursor: default;
}

.binging-dash-mark-series {
    background: linear-gradient(135deg, var(--series-gold-start, #f1c40f), var(--series-gold-end, #e67e22));
    color: #1a1a1a;
}
.binging-dash-mark-series:hover {
    background: linear-gradient(135deg, var(--series-gold-start, #f1c40f), var(--series-gold-end, #e67e22));
    opacity: 0.9;
}

/* Mobile: stack the two buttons under the info block, full-width */
@media (max-width: 640px) {
    .binging-dash-row { flex-wrap: wrap; }
    .binging-dash-info { flex: 1 1 calc(100% - 64px); min-width: 0; }
    .binging-dash-actions {
        flex-basis: 100%;
        flex-direction: column;
        gap: 6px;
        margin-top: 10px;
    }
    .binging-dash-actions .binging-dash-continue,
    .binging-dash-actions .binging-dash-mark-next {
        width: 100%;
        text-align: center;
    }
}

/* Hide binging items from the pure Queue list */
#to-watch-list .media-item[data-status="binging"] { display: none; }

.btn-modal-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}
.btn-modal-primary:hover { opacity: 0.85; }
.btn-modal-primary:disabled { opacity: 0.5; cursor: default; }

/* ── Binge Partner ───────────────────────────────────────────────────────── */
.bp-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.bp-badge-you {
    background: rgba(0,191,191,0.18);
    color: #00BFBF;
    border: 1px solid rgba(0,191,191,0.35);
}
.bp-badge-partner {
    background: rgba(168,85,247,0.18);
    color: #c084fc;
    border: 1px solid rgba(168,85,247,0.35);
}
.bp-badge-both {
    background: rgba(251,191,36,0.18);
    color: #fbbf24;
    border: 1px solid rgba(251,191,36,0.35);
}
.bp-section {
    background: var(--card-bg, #1a1a2e);
    border: 1px solid rgba(0,191,191,0.25);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}
.bp-section h3 { margin: 0 0 4px; font-size: 1rem; }
.bp-section .bp-subtitle { color: var(--text-secondary, #a0a0a0); font-size: 0.82rem; margin: 0 0 16px; }
.bp-partner-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0,191,191,0.06);
    border: 1px solid rgba(0,191,191,0.2);
    border-radius: 8px;
}
.bp-partner-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--accent-color, #00BFBF);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; color: #fff; font-size: 0.9rem;
    flex-shrink: 0;
}
.bp-partner-name { font-weight: 600; font-size: 0.95rem; }
.bp-partner-label { font-size: 0.75rem; color: var(--text-secondary, #a0a0a0); }
.bp-input-row { display: flex; gap: 10px; margin-bottom: 10px; }
.bp-input-row input { flex: 1; padding: 10px 12px; background: var(--input-bg, #0f0f1a); border: 1px solid var(--border-color, rgba(255,255,255,0.1)); border-radius: 6px; color: var(--text-primary, #e0e0e0); font-size: 0.9rem; }
.bp-pending-card {
    background: rgba(168,85,247,0.08);
    border: 1px solid rgba(168,85,247,0.25);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.bp-pending-card .bp-pending-text { font-size: 0.9rem; }
.bp-pending-actions { display: flex; gap: 8px; flex-shrink: 0; }
.bp-share-prompt {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(0,191,191,0.07);
    border: 1px solid rgba(0,191,191,0.25);
    border-radius: 8px;
}
.bp-share-prompt p { margin: 0 0 10px; font-size: 0.9rem; color: var(--text-primary, #e0e0e0); }
.bp-share-prompt .bp-share-btns { display: flex; gap: 10px; }
.bp-share-prompt .bp-share-btns button { flex: 1; padding: 8px 0; border-radius: 6px; border: none; cursor: pointer; font-weight: 600; font-size: 0.85rem; transition: opacity 0.2s; }
.bp-share-yes { background: #00BFBF; color: #000; }
.bp-share-no  { background: var(--card-bg-secondary, #0f0f1a); color: var(--text-secondary, #a0a0a0); border: 1px solid var(--border-color, rgba(255,255,255,0.1)) !important; }

/* ===== Fresh / Consensus Reviews (discover.php) ===== */
.discover-page { max-width: 860px; margin: 0 auto; padding: 24px 16px 48px; }
.discover-title { font-size: 28px; font-weight: 800; margin: 0 0 4px; }
.discover-sub { color: var(--text-secondary, #A5A5A5); margin: 0 0 20px; }
.discover-tabs { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.discover-tab {
    padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,0.06);
    color: var(--text-secondary, #A5A5A5); text-decoration: none; font-size: 13px; font-weight: 600;
}
.discover-tab.active { background: #8a7bff; color: #fff; }
.discover-empty {
    padding: 48px 16px; text-align: center; color: var(--text-secondary, #A5A5A5);
    background: rgba(255,255,255,0.04); border-radius: 12px;
}
.discover-list { display: flex; flex-direction: column; gap: 16px; }
.cr-card {
    display: flex; gap: 16px; background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 16px;
}
.cr-poster {
    width: 96px; aspect-ratio: 2 / 3; align-self: flex-start; flex-shrink: 0; border-radius: 8px;
    background: linear-gradient(150deg, #4b3f7a, #2a2438); background-size: cover; background-position: center;
}
.cr-body { flex: 1; min-width: 0; }
.cr-head { display: flex; align-items: flex-start; gap: 12px; }
.cr-title { font-size: 18px; font-weight: 700; margin: 0; }
.cr-meta { font-size: 12px; color: var(--text-secondary, #A5A5A5); margin-top: 2px; }
.cr-score {
    margin-left: auto; flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 15px; color: #fff;
    background: #2ecc71;
}
.cr-verdict { color: #3ddc84; font-weight: 700; font-size: 14px; margin: 8px 0 4px; }
.cr-summary { font-size: 14px; line-height: 1.55; color: #c9c9d2; margin: 4px 0 10px; }
.cr-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.cr-tag { font-size: 11px; padding: 3px 8px; border-radius: 4px; }
.cr-tag.good { background: #16321f; color: #5fe39a; }
.cr-tag.bad { background: #3a1f1f; color: #f08a8a; }
.cr-standouts { font-size: 12px; color: var(--text-secondary, #A5A5A5); margin-bottom: 12px; }
.cr-add {
    background: #6c5ce7; color: #fff; border: none; border-radius: 8px;
    padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cr-add:hover { opacity: 0.88; }
.cr-add:disabled { opacity: 0.6; cursor: default; }
.cr-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cr-share {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(139, 92, 246, 0.15);
    color: #dbeaff;
    border: 1px solid rgba(139, 92, 246, 0.4);
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.2px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-decoration: none;
}
.cr-share:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(124, 58, 237, 0.45);
}
.cr-share:active {
    transform: translateY(0);
}
.cr-share i {
    font-size: 13px;
    color: inherit;
    transition: transform 0.2s ease;
}
.cr-share:hover i {
    transform: scale(1.15);
}
.cr-disclaimer { font-size: 10.5px; color: #6f6f7a; font-style: italic; margin: 10px 0 0; }
.cr-trailer {
    display: inline-block;
    margin: 0 0 12px;
    color: var(--accent, #8b7cf6);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}
.cr-trailer:hover { text-decoration: underline; color: var(--accent-strong, #a594ff); }
.fresh-card .fresh-trailer {
    display: inline-block;
    font-size: 12px;
    color: var(--accent, #8b7cf6);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
}
.fresh-card .fresh-trailer:hover {
    text-decoration: underline;
    color: var(--accent-strong, #a594ff);
}
/* Trailer popup (Fresh/consensus cards) — injected by js/core/trailer-popup.js */
.ba-trailer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.82);
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.ba-trailer-overlay.is-open { display: flex; }
.ba-trailer-box {
    position: relative;
    width: min(900px, 100%);
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}
.ba-trailer-frame,
.ba-trailer-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
}
.ba-trailer-close {
    position: absolute;
    top: -42px;
    right: 0;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
}
.ba-trailer-close:hover { color: #c9b8ff; }
@media (max-width: 600px) {
    .ba-trailer-close {
        top: 0;
        right: 0;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 0 10px 0 10px;
    }
}
.discover-footer-disclaimer {
    margin-top: 28px; text-align: center; font-size: 11px; color: #6f6f7a; font-style: italic;
}
@media (max-width: 600px) {
    .cr-card { flex-direction: column; }
    .cr-poster { width: 100%; height: 160px; min-height: 0; }
}

/* === Fresh on BingeAway homepage section === */
.fresh-section { margin: 40px 0 50px; }
.fresh-section h2 { font-size: 1.8rem; margin: 0 0 4px; color: #fff; }
.fresh-sub { color: #a0a0a0; font-size: 0.95rem; margin: 0 0 18px; }

.fresh-tabs { display: flex; gap: 8px; margin: 0 0 18px; flex-wrap: wrap; }
.fresh-tab {
    background: transparent;
    color: #a0a0a0;
    border: 1px solid #2a3540;
    padding: 6px 14px;
    border-radius: 18px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.fresh-tab:hover { color: #fff; border-color: #4a5060; }
.fresh-tab.active {
    background: #7c3aed;
    color: #fff;
    border-color: #7c3aed;
}

.fresh-grid {
    display: none;
    grid-template-columns: repeat(3, 1fr); /* fallback if no col modifier */
    gap: 16px;
}
.fresh-grid.active { display: grid; }
/* Column count picked server-side per category so the grid is always even.
   Single card centres; 2 cards = 1x2; 4 cards = 2x2; 6 cards = 3x2; etc. */
.fresh-grid--cols-1 { grid-template-columns: 1fr; max-width: 520px; }
.fresh-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.fresh-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }

.fresh-card {
    background: #1f2933;
    border-radius: 10px;
    padding: 12px;
    display: flex;
    gap: 12px;
}
.fresh-poster {
    width: 80px;
    min-width: 80px;
    height: 120px;
    background: #3a4554 center / cover no-repeat;
    border-radius: 6px;
}
.fresh-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.fresh-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}
.fresh-title {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.2;
}
.fresh-score {
    background: #00e054;
    color: #000;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 2px 8px;
    border-radius: 12px;
    flex-shrink: 0;
}
.fresh-score[data-score^="7"],
.fresh-score[data-score^="6"] { background: #fbbf24; }
.fresh-score[data-score^="5"],
.fresh-score[data-score^="4"],
.fresh-score[data-score^="3"],
.fresh-score[data-score^="2"],
.fresh-score[data-score^="1"],
.fresh-score[data-score="0"] { background: #ff5252; color: #fff; }
.fresh-meta { color: #9ab; font-size: 0.78rem; }
.fresh-verdict {
    color: #bcd;
    font-size: 0.82rem;
    font-style: italic;
    margin: 4px 0 8px;
}
.fresh-card .cr-add {
    background: rgba(124, 58, 237, 0.15);
    color: #c4b5fd;
    border: 1px solid #7c3aed;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: auto;
    align-self: flex-start;
}
.fresh-card .cr-add:hover {
    background: #7c3aed;
    color: #fff;
}

.fresh-empty {
    color: #9ab;
    text-align: center;
    padding: 20px;
    grid-column: 1 / -1;
}

.fresh-see-all {
    display: inline-block;
    margin-top: 16px;
    color: #7c3aed;
    text-decoration: none;
    font-size: 0.9rem;
}
.fresh-see-all:hover { text-decoration: underline; }

@media (max-width: 980px) {
    /* Tablets: cap at 2 cols regardless of server-side pick */
    .fresh-grid,
    .fresh-grid--cols-3,
    .fresh-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
    .fresh-grid--cols-1 { grid-template-columns: 1fr; max-width: 520px; }
}
@media (max-width: 720px) {
    /* Phones: always single column */
    .fresh-grid,
    .fresh-grid--cols-1,
    .fresh-grid--cols-2,
    .fresh-grid--cols-3 {
        grid-template-columns: 1fr;
        max-width: none;
    }
    .fresh-poster { width: 60px; min-width: 60px; height: 90px; }
}

/* Read full review + Add to Binge List actions row */
.fresh-card .fresh-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.fresh-card .fresh-read {
    background: transparent;
    color: #a0a0a0;
    border: 1px solid #2a3540;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    display: inline-block;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.fresh-card .fresh-read:hover {
    color: #fff;
    border-color: #4a5060;
    background: rgba(255, 255, 255, 0.04);
}

/* ==========================================================================
   MASTER MOBILE OPTIMIZATION ENGINE (Universal Mobile Responsiveness)
   Targeted for mobile screens (< 768px & < 480px, e.g. iPhone, Pixel, Galaxy)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Global Viewport & Container Reset */
    html, body {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        font-size: 15px;
    }

    .container, .main-content, #main-content {
        width: 100% !important;
        max-width: 100vw !important;
        padding-left: 10px !important;
        padding-right: 10px !important;
        box-sizing: border-box !important;
    }

    /* 2. Top Header & Navigation Bar */
    .header {
        padding: 8px 10px !important;
    }

    .header-content {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .logo-image {
        height: 30px !important;
    }

    .tagline {
        display: none !important; /* Hide tagline on mobile to save space */
    }

    .nav-tabs {
        display: flex !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        padding: 6px 0 !important;
        margin-bottom: 12px !important;
        scrollbar-width: none;
    }
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    .nav-tab {
        flex-shrink: 0 !important;
        padding: 7px 14px !important;
        font-size: 0.8rem !important;
        border-radius: 20px !important;
        white-space: nowrap !important;
    }

    /* 3. Universal Card Grids (2 Crisp Columns on Mobile) */
    .media-list,
    .media-grid,
    .discover-grid,
    .community-grid,
    .dashboard {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .media-card,
    .discover-card,
    .community-card {
        width: 100% !important;
        border-radius: 10px !important;
        padding: 8px !important;
    }

    .media-poster,
    .discover-poster {
        width: 100% !important;
        aspect-ratio: 2 / 3 !important;
        object-fit: cover !important;
        border-radius: 8px !important;
    }

    .media-info h3,
    .discover-title {
        font-size: 0.85rem !important;
        line-height: 1.25 !important;
        margin-top: 6px !important;
    }

    /* 4. Controls, Filters & Search Bar */
    .controls,
    .search-filter,
    .queue-actions,
    .calendar-filter-bar {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        width: 100% !important;
    }

    .search-filter input,
    .calendar-search-input,
    .search-bar input {
        width: 100% !important;
        font-size: 0.88rem !important;
        padding: 10px 14px !important;
        border-radius: 24px !important;
        box-sizing: border-box !important;
    }

    .filter-pills,
    .category-pills,
    .calendar-filter-group {
        display: flex !important;
        gap: 6px !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
        padding-bottom: 4px !important;
    }

    .filter-pill,
    .category-pill,
    .calendar-filter-btn {
        flex: 0 0 auto !important;
        padding: 7px 12px !important;
        font-size: 0.8rem !important;
        white-space: nowrap !important;
    }

    /* 5. Master Bottom Sheet Presentation for ALL Modals */
    .modal,
    .modal-overlay {
        padding: 0 !important;
        align-items: flex-end !important;
        justify-content: center !important;
        z-index: 100000 !important;
    }

    .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 88vh !important;
        max-height: 88dvh !important;
        border-radius: 20px 20px 0 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.95) !important;
    }

    .modal-header {
        padding: 12px 16px !important;
        flex-shrink: 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .modal-header h3 {
        font-size: 1.1rem !important;
    }

    .modal-body {
        flex: 1 !important;
        max-height: calc(88dvh - 130px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        padding: 12px 16px !important;
    }

    .modal-actions {
        flex-shrink: 0 !important;
        padding: 10px 12px !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        justify-content: space-between !important;
        background: #14141e !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    .modal-actions .btn-modal,
    .modal-actions button {
        flex: 1 1 calc(50% - 6px) !important;
        min-width: 100px !important;
        font-size: 0.8rem !important;
        padding: 9px 6px !important;
        text-align: center !important;
        margin: 0 !important;
    }

    /* 6. Stats & Groups Grids */
    .stats-grid,
    .groups-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* 7. User Menu & Dropdown */
    .user-dropdown {
        position: absolute !important;
        top: calc(100% + 8px) !important;
        right: 0 !important;
        min-width: 220px !important;
        background: #181826 !important;
        border: 1px solid rgba(139, 92, 246, 0.4) !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95) !important;
        z-index: 1000000 !important;
    }
}

/* TV Show Metadata Grid (Runtime | Status | On | Seasons | Episodes) */
.tv-show-meta-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    background: rgba(24, 29, 41, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 14px 4px;
    margin: 14px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

@media (max-width: 640px) {
    .tv-show-meta-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px 0;
    }
}

.tv-meta-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 4px;
}

.tv-meta-col:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.tv-meta-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: #94a3b8;
    letter-spacing: 0.2px;
}

.tv-meta-icon {
    min-height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tv-meta-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: #f8fafc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Season Accordions & Episodes Table */
.seasons-guide-wrapper {
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 16px;
}

.seasons-guide-title {
    font-size: 1rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.season-accordion-item {
    background: #181d29;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-bottom: 8px;
    overflow: hidden;
}

.season-accordion-header {
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    color: #f1f5f9;
    user-select: none;
    transition: background 0.15s ease;
}

.season-accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.season-accordion-arrow {
    font-size: 0.75rem;
    color: #94a3b8;
    transition: transform 0.2s ease;
}

.season-accordion-item.open .season-accordion-arrow {
    transform: rotate(180deg);
}

.season-accordion-content {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.6);
}

.episodes-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.episodes-table th {
    text-align: left;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.episodes-table td {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}

.ep-num-cell {
    font-weight: 700;
    color: #94a3b8;
}

.ep-date-cell {
    color: #94a3b8;
    font-size: 0.8rem;
}

.ep-title-link {
    color: #38bdf8;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease;
}

.ep-title-link:hover {
    color: #7dd3fc;
    text-decoration: underline;
}

/* Episode Detail Modal */
.ep-detail-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(6px);
    z-index: 100050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ep-detail-modal-card {
    background: #1e253b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
    overflow: hidden;
    color: #f8fafc;
    position: relative;
    animation: modalPopIn 0.2s ease-out;
}

.ep-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ep-detail-title-group h3 {
    margin: 0 0 6px 0;
    font-size: 1.15rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
}

.ep-detail-pill {
    display: inline-block;
    background: #fbbf24;
    color: #000000;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 4px 12px;
    border-radius: 6px;
}

.ep-detail-stats {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ep-stat-box {
    text-align: center;
}

.ep-stat-label {
    font-size: 0.75rem;
    color: #94a3b8;
    font-weight: 500;
}

.ep-stat-num {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
}

.ep-stat-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
}

.ep-detail-close {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.6rem;
    cursor: pointer;
    margin-left: 12px;
    line-height: 1;
    transition: color 0.15s ease;
}

.ep-detail-close:hover {
    color: #ffffff;
}

.ep-detail-body {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 18px;
    padding: 20px 24px;
    align-items: start;
}

@media (max-width: 600px) {
    .ep-detail-body {
        grid-template-columns: 1fr;
    }
}

.ep-detail-img-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #0f172a;
    aspect-ratio: 16/9;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.ep-detail-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ep-detail-img-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: 10px;
}

.ep-detail-img-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: #ffffff;
    line-height: 1.2;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.ep-detail-summary {
    font-size: 0.9rem;
    line-height: 1.55;
    color: #cbd5e1;
    max-height: 240px;
    overflow-y: auto;
}
