/* ============================================
   CSS Variables & Design Tokens
   ============================================ */
:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.08);

    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);

    --accent-primary: #8b5cf6;
    --accent-secondary: #a78bfa;
    --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
    --accent-glow: rgba(139, 92, 246, 0.4);

    --error: #ef4444;
    --success: #22c55e;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;

    /* Borders */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    --border-subtle: 1px solid rgba(255, 255, 255, 0.08);
    --border-accent: 1px solid rgba(139, 92, 246, 0.3);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px var(--accent-glow);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Typography */
    --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: var(--accent-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--accent-primary);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input {
    font-family: inherit;
    border: none;
    background: none;
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   Background Animation
   ============================================ */
.background-animation {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.gradient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.4) 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.3) 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    animation-delay: -7s;
}

.orb-3 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.3) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    25% {
        transform: translate(30px, -30px) scale(1.05);
    }

    50% {
        transform: translate(-20px, 20px) scale(0.95);
    }

    75% {
        transform: translate(-30px, -10px) scale(1.02);
    }
}

/* ============================================
   Page Transitions
   ============================================ */

/* 1. Body entrance / exit */
body.page-loading {
    opacity: 0;
}

body {
    opacity: 1;
    transition: opacity 0.18s ease-out;
}

body.page-exiting {
    opacity: 0;
    transition: opacity 0.14s ease-in;
    pointer-events: none;
}

/* 2. Overlay — subtle, fast */
#page-transition-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 10, 15, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.14s ease-in;
}

#page-transition-overlay.overlay-active {
    opacity: 1;
    pointer-events: none;
    /* never block clicks — let navigation happen */
    transition: opacity 0.14s ease-in;
}

/* 3. Scroll-reveal pattern */
.scroll-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.scroll-visible {
    opacity: 1;
    transform: translateY(0);
}

/* 4. Navbar link hover underline */
.navbar-link {
    position: relative;
}

.navbar-link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-link:hover::after,
.navbar-link.active::after {
    width: 100%;
}

/* 5. Card hover lift — applied to all card types */
.movie-card,
.community-member-card,
.community-rating-card,
.up-movie-card {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.25s ease,
        border-color 0.25s ease !important;
    will-change: transform;
}

.movie-card:hover,
.community-member-card:hover,
.community-rating-card:hover,
.up-movie-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.2);
}

/* 6. Stat cards pop on hover */
.up-stat-card {
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.22s ease,
        background 0.22s ease !important;
}

.up-stat-card:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4), 0 0 16px rgba(139, 92, 246, 0.18);
}

/* 7. Button press ripple feel */
button,
.btn,
[class*="btn-"] {
    transition: transform 0.1s ease, opacity 0.15s ease, background 0.2s ease,
        box-shadow 0.2s ease, color 0.2s ease !important;
}

button:active,
.btn:active,
[class*="btn-"]:active {
    transform: scale(0.96) !important;
}

/* 8. Section reveal for in-page content areas */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.up-header {
    animation: slideInUp 0.45s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.up-stats {
    animation: slideInUp 0.45s 0.08s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.up-genres-section,
.up-top-movies-section,
.up-recent-section {
    animation: slideInUp 0.45s 0.14s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.community-section {
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* 9. Skeleton pulse for loading states */
@keyframes skeletonPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.community-loading .spinner,
.community-loading span {
    animation: skeletonPulse 1.5s ease-in-out infinite;
}

/* ============================================
   Layout
   ============================================ */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--space-xl);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ============================================
   Top Navbar
   ============================================ */
.top-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-sm) var(--space-xl);
    background: rgba(10, 10, 15, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: background var(--transition-normal), box-shadow var(--transition-normal);
}

.top-navbar.scrolled {
    background: rgba(10, 10, 15, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.4);
}

/* Brand */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    color: var(--text-primary);
    transition: opacity var(--transition-fast);
}

.navbar-brand:hover {
    opacity: 0.85;
    color: var(--text-primary);
}

.navbar-logo-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
}

.navbar-brand-text {
    font-size: 1.15rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Actions group */
.navbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Navigation links */
.navbar-link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    cursor: pointer;
}

.navbar-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.navbar-link.active {
    color: var(--accent-secondary);
    background: rgba(139, 92, 246, 0.1);
}

.navbar-link svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* Separator */
.navbar-separator {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    margin: 0 var(--space-xs);
}

/* Auth Button in navbar */
.navbar-auth-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-xs) var(--space-md);
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.navbar-auth-btn:hover {
    background: rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
    color: var(--text-primary);
}

.navbar-auth-btn.logged-in {
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
    color: var(--accent-secondary);
}

.navbar-auth-btn.logged-in:hover {
    background: rgba(139, 92, 246, 0.25);
    border-color: var(--accent-secondary);
}

.navbar-auth-btn svg {
    width: 18px;
    height: 18px;
}

/* Navbar avatar for logged-in state */
.navbar-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
    flex-shrink: 0;
}

.navbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navbar user dropdown */
.navbar-user-wrapper {
    position: relative;
}

.navbar-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: rgba(18, 18, 26, 0.98);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: var(--radius-md);
    padding: 6px;
    min-width: 180px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 2000;
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.navbar-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.navbar-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
    font-family: inherit;
}

.navbar-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-primary);
}

.navbar-dropdown-item.logout-item:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.navbar-dropdown-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.75;
}

.navbar-dropdown-item:hover svg {
    opacity: 1;
}

.navbar-dropdown-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    margin: 4px 0;
}

/* Body padding for fixed navbar */
body {
    padding-top: 52px;
}

@media (max-width: 768px) {
    .top-navbar {
        padding: var(--space-sm) var(--space-md);
    }

    .navbar-link span,
    .navbar-auth-btn span {
        display: none;
    }

    .navbar-link {
        padding: var(--space-xs);
    }

    .navbar-auth-btn {
        padding: var(--space-xs) var(--space-sm);
    }

    .navbar-brand-text {
        font-size: 1rem;
    }

    body {
        padding-top: 48px;
    }
}

/* ============================================
   Header
   ============================================ */
.header {
    text-align: center;
    padding: var(--space-3xl) 0;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.logo-icon {
    width: 48px;
    height: 48px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 300;
}

/* ============================================
   Search Form
   ============================================ */
.search-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    max-width: 700px;
    margin: 0 auto var(--space-3xl);
}

.input-group {
    display: flex;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.input-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
    background: var(--bg-card);
    border: var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    backdrop-filter: blur(10px);
}

.input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1), var(--shadow-glow);
}

.input-wrapper.year-input {
    flex: 0 0 150px;
    min-width: 150px;
}

.input-icon {
    position: absolute;
    left: var(--space-lg);
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-wrapper:focus-within .input-icon {
    color: var(--accent-primary);
}

.input-wrapper input {
    width: 100%;
    padding: var(--space-lg);
    padding-left: calc(var(--space-lg) + 28px);
    font-size: 1rem;
    color: var(--text-primary);
    background: transparent;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

/* Remove number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-lg) var(--space-2xl);
    background: var(--accent-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md), 0 0 20px rgba(139, 92, 246, 0.3);
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.search-btn:active {
    transform: translateY(0);
}

.search-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-fast);
}

.search-btn:hover .btn-icon {
    transform: translateX(4px);
}

/* ============================================
   Advanced Filters
   ============================================ */
.toggle-filters-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 100%;
}

.toggle-filters-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.toggle-filters-btn.active {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.toggle-filters-btn svg {
    width: 18px;
    height: 18px;
}

.toggle-filters-btn .chevron-icon {
    margin-left: auto;
    transition: transform var(--transition-normal);
}

.toggle-filters-btn.active .chevron-icon {
    transform: rotate(180deg);
}

.advanced-filters {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    animation: slideDown 0.3s ease;
    overflow: hidden;
}

.advanced-filters.hidden {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-lg);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.filter-label {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-label svg {
    width: 16px;
    height: 16px;
    color: var(--accent-primary);
}

.filter-select {
    width: 100%;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all var(--transition-normal);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23a78bfa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--space-md) center;
    background-size: 18px;
    padding-right: calc(var(--space-md) + 28px);
}

.filter-select:hover {
    border-color: var(--accent-primary);
    background-color: rgba(255, 255, 255, 0.08);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.filter-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: var(--space-sm);
}

.autocomplete-wrapper {
    position: relative;
}

.filter-input {
    width: 100%;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-normal);
}

.filter-input::placeholder {
    color: var(--text-muted);
}

.filter-input:hover {
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
}

.filter-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.filter-input.has-value {
    border-color: var(--accent-primary);
    background: rgba(139, 92, 246, 0.1);
}

.suggestions-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    margin-top: var(--space-xs);
    background: var(--bg-secondary);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    max-height: 250px;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.2s ease;
}

.suggestions-list.hidden {
    display: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    cursor: pointer;
    transition: background var(--transition-fast);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: rgba(139, 92, 246, 0.1);
}

.suggestion-item img {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    object-fit: cover;
    background: var(--bg-card);
}

.suggestion-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.suggestion-item-name {
    font-weight: 500;
    color: var(--text-primary);
}

.suggestion-item-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.suggestion-loading {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
}

.suggestion-no-results {
    padding: var(--space-lg);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Active Filters Tags */
.active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.active-filters.hidden {
    display: none;
}

.active-filters-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.filter-tag {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    animation: fadeIn 0.2s ease;
}

.filter-tag-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
}

.filter-tag-remove:hover {
    background: rgba(255, 255, 255, 0.4);
}

.filter-tag-remove svg {
    width: 12px;
    height: 12px;
}

.clear-filters-btn {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-full);
    color: var(--error);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    margin-left: auto;
}

.clear-filters-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--error);
}

.clear-filters-btn svg {
    width: 14px;
    height: 14px;
}

/* Results Limit Section */
.results-limit-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.results-limit-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-wrap: wrap;
}

.results-limit-select {
    min-width: 180px;
    max-width: 200px;
}

.results-limit-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

@media (max-width: 640px) {
    .results-limit-controls {
        flex-direction: column;
        align-items: flex-start;
    }

    .results-limit-select {
        width: 100%;
        max-width: none;
    }
}


/* ============================================
   Loading State
   ============================================ */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    padding: var(--space-3xl);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--bg-card);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ============================================
   Error Message
   ============================================ */
.error-message {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    max-width: 600px;
    margin: 0 auto;
}

.error-message svg {
    width: 24px;
    height: 24px;
    color: var(--error);
    flex-shrink: 0;
}

.error-message p {
    color: var(--error);
}

/* ============================================
   Sort Section
   ============================================ */
.sort-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    padding: var(--space-lg);
    background: var(--bg-card);
    border: var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-xl);
    backdrop-filter: blur(10px);
}

.sort-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.sort-buttons {
    display: flex;
    gap: var(--space-sm);
}

.sort-btn {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.sort-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.sort-btn.active {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 0 15px var(--accent-glow);
}

.sort-btn svg {
    width: 16px;
    height: 16px;
}

.sort-indicator {
    font-size: 0.75rem;
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    opacity: 0.8;
}

.sort-btn.active .sort-indicator {
    background: rgba(255, 255, 255, 0.2);
}

.results-count {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-left: auto;
}

@media (max-width: 640px) {
    .sort-section {
        flex-direction: column;
        gap: var(--space-md);
    }

    .results-count {
        margin-left: 0;
    }
}

/* ============================================
   Results Grid
   ============================================ */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--space-xl);
    margin-top: var(--space-xl);
}

.movie-card {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    background: var(--bg-card);
    border: var(--border-subtle);
    transition: all var(--transition-normal);
    animation: fadeIn 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.movie-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.movie-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.movie-card:hover img {
    transform: scale(1.05);
}

.movie-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 50%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-lg);
}

.movie-card:hover .movie-card-overlay {
    opacity: 1;
}

.movie-card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    line-height: 1.3;
}

.movie-card-year {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.no-poster {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-align: center;
    padding: var(--space-md);
}

/* ============================================
   Modal
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl);
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: var(--border-subtle);
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    animation: modalSlideIn 0.4s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.close-btn {
    position: absolute;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    border-radius: var(--radius-full);
    color: white;
    transition: all var(--transition-fast);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.close-btn svg {
    width: 20px;
    height: 20px;
}

.modal-body {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-body {
        flex-direction: row;
    }
}

.modal-body>img {
    width: 100%;
    max-height: 400px;
    object-fit: contain;
    background: var(--bg-primary);
}

@media (min-width: 768px) {
    .modal-body>img {
        width: 40%;
        max-height: none;
        object-fit: cover;
    }
}

.modal-info {
    flex: 1;
    padding: var(--space-2xl);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    overflow-y: auto;
    max-height: 400px;
}

@media (min-width: 768px) {
    .modal-info {
        max-height: 500px;
    }
}

.modal-info h2 {
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.2;
}

.modal-year {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 500;
    width: fit-content;
}

/* Modal Meta (Director & Genre) */
.modal-meta {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border: var(--border-subtle);
    border-radius: var(--radius-md);
    margin: var(--space-sm) 0;
}

.meta-item {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

.meta-item svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.meta-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.meta-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.meta-value {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 500;
}

.meta-value.loading {
    color: var(--text-muted);
    font-style: italic;
}

.modal-overview {
    color: var(--text-secondary);
    line-height: 1.7;
    flex: 1;
}

.modal-actions {
    margin-top: var(--space-lg);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--accent-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.download-btn svg {
    width: 20px;
    height: 20px;
}



/* ============================================
   Movie Sections (Now Playing & Box Office)
   ============================================ */
.movie-section {
    margin-top: var(--space-3xl);
    padding: var(--space-xl);
    background: var(--bg-card);
    border: var(--border-subtle);
    border-radius: var(--radius-xl);
    backdrop-filter: blur(10px);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.section-icon {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.01em;
}

.section-badge {
    padding: var(--space-xs) var(--space-md);
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--accent-secondary);
}

/* Carousel */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.carousel {
    display: flex;
    gap: var(--space-lg);
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: var(--space-sm) 0;
    flex: 1;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-3xl);
    color: var(--text-muted);
}

.carousel-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: all var(--transition-normal);
    cursor: pointer;
}

.carousel-btn:hover {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: var(--shadow-glow);
    transform: scale(1.1);
}

.carousel-btn:active {
    transform: scale(0.95);
}

.carousel-btn svg {
    width: 20px;
    height: 20px;
}

/* Carousel Movie Card */
.carousel-card {
    flex-shrink: 0;
    width: 180px;
    cursor: pointer;
    transition: all var(--transition-normal);
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.carousel-card:hover {
    transform: translateY(-8px) scale(1.03);
}

.carousel-card-poster {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    transition: all var(--transition-normal);
}

.carousel-card:hover .carousel-card-poster {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-lg), 0 0 30px var(--accent-glow);
}

.carousel-card-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

.carousel-card:hover .carousel-card-poster img {
    transform: scale(1.08);
}

.carousel-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 60%);
    opacity: 0;
    transition: opacity var(--transition-normal);
    display: flex;
    align-items: flex-end;
    padding: var(--space-md);
}

.carousel-card:hover .carousel-card-overlay {
    opacity: 1;
}

.carousel-card-rating {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: rgba(0, 0, 0, 0.6);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}

.carousel-card-rating svg {
    width: 14px;
    height: 14px;
    color: #fbbf24;
}

.carousel-card-rating span {
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

.carousel-card-info {
    padding: var(--space-md) var(--space-xs);
}

.carousel-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-card-year {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.carousel-card-date {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.75rem;
    color: var(--accent-secondary);
    font-weight: 500;
}

.carousel-card-date svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.carousel-card-no-poster {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: var(--space-md);
    background: var(--bg-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .carousel-btn {
        display: none;
    }

    .carousel-card {
        width: 150px;
    }

    .section-header h2 {
        font-size: 1.2rem;
    }

    .movie-section {
        padding: var(--space-lg);
        margin-top: var(--space-xl);
    }
}

@media (max-width: 480px) {
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .carousel-card {
        width: 140px;
    }
}

/* ============================================
   Footer
   ============================================ */
.footer {
    margin-top: auto;
    padding-top: var(--space-3xl);
    text-align: center;
}

.footer p {
    color: var(--text-muted);
    font-size: 0.875rem;
}



.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

/* ============================================
   Utilities
   ============================================ */
.hidden {
    display: none !important;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 640px) {
    .container {
        padding: var(--space-md);
    }

    .header {
        padding: var(--space-xl) 0;
    }

    .logo h1 {
        font-size: 1.75rem;
    }

    .logo-icon {
        width: 36px;
        height: 36px;
    }

    .tagline {
        font-size: 0.95rem;
    }

    .input-wrapper.year-input {
        flex: 1;
        min-width: 100%;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--space-md);
    }

    .modal-content {
        max-height: 95vh;
    }

    .modal-info {
        padding: var(--space-lg);
    }

    .modal-info h2 {
        font-size: 1.25rem;
    }
}

/* ============================================
   Authentication Styles
   ============================================ */

/* Auth Modal */
.auth-modal-content {
    max-width: 420px;
    padding: 0;
}

.auth-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-tab {
    flex: 1;
    padding: var(--space-md) var(--space-lg);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
}

.auth-tab:hover {
    color: var(--text-primary);
}

.auth-tab.active {
    color: var(--accent-primary);
}

.auth-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
}

.auth-form {
    padding: var(--space-xl);
}

.auth-form.hidden {
    display: none;
}

.auth-form h2 {
    font-size: 1.5rem;
    margin-bottom: var(--space-sm);
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

.auth-input-group {
    margin-bottom: var(--space-md);
}

.auth-input-group label {
    display: block;
    margin-bottom: var(--space-xs);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.auth-input-group input {
    width: 100%;
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all var(--transition-normal);
}

.auth-input-group input:focus {
    outline: none;
    border-color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-hint {
    display: block;
    margin-top: var(--space-xs);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.auth-error {
    padding: var(--space-sm) var(--space-md);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.auth-error.hidden {
    display: none;
}

.auth-submit-btn {
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    background: var(--accent-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}


/* Auth Success Message */
.auth-success {
    padding: var(--space-sm) var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    color: #10b981;
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

.auth-success.hidden {
    display: none;
}

/* User Movie Actions in Modal */
.user-movie-actions {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding: var(--space-md);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.user-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.user-action-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: var(--text-primary);
}

.user-action-btn svg {
    width: 20px;
    height: 20px;
}

.user-action-btn.watched-btn:hover,
.user-action-btn.watched-btn.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.5);
    color: #10b981;
}

.user-action-btn.watchlist-btn:hover,
.user-action-btn.watchlist-btn.active {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.5);
    color: #f59e0b;
}

.user-action-btn.active {
    pointer-events: none;
}

/* User Rating Display */
.user-rating-display {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.user-rating-display.hidden {
    display: none;
}

.user-rating-display .rating-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.user-rating-display .rating-stars {
    color: #fbbf24;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.edit-rating-link {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color var(--transition-fast);
}

.edit-rating-link:hover {
    color: var(--accent-secondary);
}

/* Rating Modal */
.rating-modal-content {
    max-width: 450px;
}

.rating-modal-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-xl);
    text-align: center;
}

.rating-modal-body img {
    width: 150px;
    height: auto;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
    box-shadow: var(--shadow-lg);
}

.rating-info h3 {
    font-size: 1.25rem;
    margin-bottom: var(--space-lg);
}

.rating-info .rating-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-md);
}

/* Star Rating - SVG Based, Mobile-First */
.star-rating {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.star-container {
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: transform 0.15s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.star-container:hover {
    transform: scale(1.15);
}

/* Active press feedback for touch */
.star-container:active {
    transform: scale(0.92);
}

.star-container svg {
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
}

.star-container .star-bg {
    fill: rgba(255, 255, 255, 0.12);
    stroke: rgba(255, 255, 255, 0.15);
    stroke-width: 0.5;
    transition: fill 0.15s ease;
}

.star-container:hover .star-bg {
    fill: rgba(251, 191, 36, 0.15);
}

.star-container .star-fill {
    fill: #fbbf24;
    filter: drop-shadow(0 0 3px rgba(251, 191, 36, 0.4));
    transition: filter 0.15s ease;
}

.star-container:hover .star-fill {
    filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.6));
}

/* Half-star center line - desktop only */
.star-container::after {
    content: '';
    position: absolute;
    top: 10%;
    bottom: 10%;
    left: 50%;
    width: 1px;
    background: transparent;
    transition: background 0.15s ease;
    pointer-events: none;
}

.star-container:hover::after {
    background: rgba(251, 191, 36, 0.25);
}

/* Hide half-line on touch devices */
@media (pointer: coarse) {
    .star-container::after {
        display: none;
    }

    .star-container:hover {
        transform: none;
    }
}

/* Rating Adjuster (±0.5 fine-tune) */
.rating-adjuster {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: var(--space-md);
    padding: 8px 0;
}

.adjust-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.08);
    color: #fbbf24;
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    line-height: 1;
}

.adjust-btn:hover {
    background: rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.5);
    transform: scale(1.1);
}

.adjust-btn:active {
    transform: scale(0.92);
    background: rgba(251, 191, 36, 0.3);
}

.adjust-btn:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    transform: none;
}

.adjust-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #fbbf24;
    min-width: 60px;
    text-align: center;
    background: rgba(251, 191, 36, 0.08);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.adjust-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: -4px;
    margin-bottom: var(--space-xs);
}

.rating-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    min-height: 36px;
    margin-bottom: var(--space-md);
    text-align: center;
    flex-wrap: wrap;
}

.rating-number {
    font-size: 1.3rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.1);
}

/* Star Display Utilities (for inline star ratings in cards/modals) */
.rating-stars-display {
    display: inline-flex;
    gap: 2px;
    align-items: center;
    vertical-align: middle;
}

.rating-stars-display svg {
    width: 16px;
    height: 16px;
    display: block;
}

.save-rating-btn {
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    background: var(--accent-gradient);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-normal);
    min-height: 48px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.save-rating-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.save-rating-btn:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Responsive star sizes */
@media (max-width: 480px) {
    .star-rating {
        gap: 8px;
        padding: var(--space-sm) var(--space-md);
    }

    .star-container {
        width: 44px;
        height: 44px;
    }

    .adjust-btn {
        width: 48px;
        height: 48px;
        font-size: 1.6rem;
    }
}

@media (min-width: 768px) {
    .star-container {
        width: 42px;
        height: 42px;
    }

    .star-rating {
        gap: 10px;
    }
}

/* Login prompt message */
.login-prompt {
    text-align: center;
    padding: var(--space-md);
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}

.login-prompt p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.login-prompt-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.login-prompt-btn:hover {
    color: var(--accent-secondary);
}

/* ============================================
   Cookie Banner (RGPD)
   ============================================ */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 15, 25, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: var(--space-lg);
    z-index: 10000;
    backdrop-filter: blur(20px);
    animation: slideUp 0.4s ease;
}

.cookie-banner.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-xl);
}

.cookie-text {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
    flex: 1;
}

.cookie-text svg {
    width: 24px;
    height: 24px;
    color: var(--accent-primary);
    flex-shrink: 0;
    margin-top: 2px;
}

.cookie-text p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.cookie-text a {
    color: var(--accent-primary);
    text-decoration: underline;
}

.cookie-text a:hover {
    color: var(--accent-secondary);
}

.cookie-actions {
    display: flex;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.cookie-btn {
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
}

.cookie-btn.accept {
    background: var(--accent-gradient);
    border: none;
    color: white;
}

.cookie-btn.accept:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.cookie-btn.reject {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
}

.cookie-btn.reject:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--text-primary);
}

@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }

    .cookie-text {
        flex-direction: column;
        align-items: center;
    }

    .cookie-actions {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   Footer
   ============================================ */
.site-footer {
    background: rgba(10, 10, 20, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: var(--space-2xl) var(--space-lg);
    margin-top: var(--space-3xl);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

.footer-brand svg {
    width: 28px;
    height: 28px;
    color: var(--accent-primary);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md) var(--space-xl);
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: color var(--transition-normal);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-copyright a {
    color: var(--accent-secondary);
}

/* ============================================
   Legal Modal
   ============================================ */
.legal-modal-content {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.legal-content {
    padding: var(--space-xl);
}

.legal-content h2 {
    font-size: 1.75rem;
    margin-bottom: var(--space-sm);
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.legal-date {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: var(--space-xl);
}

.legal-content h3 {
    font-size: 1.1rem;
    margin-top: var(--space-xl);
    margin-bottom: var(--space-md);
    color: var(--accent-secondary);
}

.legal-content p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-md);
}

.legal-content ul {
    margin: var(--space-md) 0;
    padding-left: var(--space-xl);
}

.legal-content li {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: var(--space-sm);
}

.legal-content strong {
    color: var(--text-primary);
}

/* ============================================
   Watched Badge on Movie Cards
   ============================================ */
.movie-card .watched-badge {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.9);
    border-radius: var(--radius-full);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.movie-card .watched-badge svg {
    width: 12px;
    height: 12px;
}

.movie-card .watchlist-badge {
    position: absolute;
    top: var(--space-sm);
    left: var(--space-sm);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: rgba(245, 158, 11, 0.9);
    border-radius: var(--radius-full);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.movie-card .watchlist-badge svg {
    width: 12px;
    height: 12px;
}



/* ============================================
   Enhanced Responsive Styles
   ============================================ */

/* Large tablets and small desktops */
@media (max-width: 1024px) {
    .container {
        padding: var(--space-md);
    }

    .header {
        padding: var(--space-xl) 0;
    }

    .logo h1 {
        font-size: 2rem;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    .carousel {
        gap: var(--space-md);
    }
}

/* Tablets */
@media (max-width: 768px) {
    :root {
        --space-3xl: 2rem;
        --space-2xl: 1.5rem;
    }

    .container {
        padding: var(--space-sm);
    }

    .header {
        padding: var(--space-lg) 0;
    }

    .logo h1 {
        font-size: 1.75rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .input-group {
        flex-direction: column;
    }

    .input-wrapper {
        flex: none;
        width: 100%;
    }

    .search-btn {
        width: 100%;
        justify-content: center;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: var(--space-md);
    }

    .modal-content {
        flex-direction: column;
        max-width: 95%;
        max-height: 90vh;
    }

    .modal-image-container {
        max-height: 40vh;
    }

    .modal-info {
        padding: var(--space-lg);
    }



    /* Sections carousel */
    .home-section-title {
        font-size: 1.25rem;
    }

    .carousel-container {
        margin: 0 calc(-1 * var(--space-sm));
        padding: 0 var(--space-sm);
    }

    .carousel-item {
        width: 130px;
    }

    .carousel-nav {
        display: none;
    }

    /* Advanced filters */
    .advanced-filters {
        grid-template-columns: 1fr;
    }

    .filter-group {
        min-width: 100%;
    }
}

/* Mobile phones */
@media (max-width: 480px) {
    .container {
        padding: var(--space-xs);
    }

    .header {
        padding: var(--space-md) 0;
    }

    .logo {
        flex-direction: column;
        gap: var(--space-sm);
    }

    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .logo h1 {
        font-size: 1.5rem;
    }

    .tagline {
        font-size: 0.85rem;
        padding: 0 var(--space-sm);
    }

    .search-form {
        padding: var(--space-md);
    }

    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .movie-card {
        border-radius: var(--radius-md);
    }

    .movie-title {
        font-size: 0.8rem;
    }

    .modal-info h2 {
        font-size: 1.25rem;
    }

    .modal-actions {
        flex-direction: column;
    }

    .modal-actions button {
        width: 100%;
    }

    .user-movie-actions {
        flex-direction: column;
    }



    /* Carousel mobile */
    .carousel-item {
        width: 110px;
    }

    .carousel-item-title {
        font-size: 0.75rem;
    }

    /* Footer mobile */
    .footer-links {
        flex-direction: column;
        gap: var(--space-sm);
    }
}

/* Very small phones */
@media (max-width: 360px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xs);
    }

    .logo h1 {
        font-size: 1.25rem;
    }

    .carousel-item {
        width: 100px;
    }
}

/* Touch devices - better tap targets */
@media (hover: none) and (pointer: coarse) {
    .movie-card-overlay {
        opacity: 1;
        background: linear-gradient(to top,
                rgba(0, 0, 0, 0.9) 0%,
                rgba(0, 0, 0, 0.3) 50%,
                transparent 100%);
    }

    .movie-card:active {
        transform: scale(0.98);
    }

    .carousel-item:active {
        transform: scale(0.98);
    }
}

/* ============================================
   Site Footer
   ============================================ */
.app-footer {
    padding: var(--space-xl) var(--space-md);
    margin-top: var(--space-3xl);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: center;
    background: var(--bg-secondary);
    width: 100%;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    font-size: 0.85rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.footer-links span {
    opacity: 0.5;
}

/* ============================================
   Movie Card Badges
   ============================================ */
.watched-badge,
.watchlist-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    pointer-events: none;
}

.watched-badge {
    background: rgba(16, 185, 129, 0.9);
    /* Green */
    color: white;
}

.watchlist-badge {
    background: rgba(245, 158, 11, 0.9);
    /* Amber */
    color: white;
    left: auto;
    right: 10px;
    /* Watchlist on the right */
}

/* Compact version for carousel cards */
.watched-badge.compact,
.watchlist-badge.compact {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.watched-badge svg,
.watchlist-badge svg {
    width: 14px;
    height: 14px;
}

/* ============================================
   Floating Lab Button (Profile pages)
   ============================================ */
.lab-floating-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 5000;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    background: rgba(18, 18, 26, 0.92);
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 999px;
    color: var(--accent-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    font-family: var(--font-family);
    box-shadow: 0 4px 24px rgba(139, 92, 246, 0.25), 0 0 0 0 rgba(139, 92, 246, 0);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: labBtnPop 0.6s 1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.lab-floating-btn:hover {
    transform: translateY(-3px) scale(1.06);
    border-color: rgba(139, 92, 246, 0.6);
    box-shadow: 0 8px 32px rgba(139, 92, 246, 0.4), 0 0 0 4px rgba(139, 92, 246, 0.1);
    color: white;
    background: rgba(139, 92, 246, 0.25);
}

.lab-floating-btn:active {
    transform: scale(0.95);
}

.lab-float-icon {
    font-size: 1.1rem;
    display: block;
    animation: float 3s ease-in-out infinite;
}

.lab-float-label {
    letter-spacing: 0.03em;
}

@keyframes labBtnPop {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}