/* CSS Variables */
:root {
    --color-gold: #d4af37;
    --color-gold-light: #f4d03f;
    --color-gold-dark: #b8960c;
    --color-black: #0a0a0a;
    --color-black-light: #1a1a1a;
    --color-black-lighter: #2a2a2a;
    --color-white: #fafafa;
    --color-white-dim: #888;
    
    --font-display: 'Playfair Display', Georgia, serif;
    --font-body: 'Libre Franklin', -apple-system, sans-serif;
    
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    font-weight: 400;
    background: var(--color-black);
    color: var(--color-white);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* App Container */
.app {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
        var(--color-black);
}

/* Header */
.header {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-black-lighter);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 200%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--color-gold), transparent);
    opacity: 0.5;
}

.trophy-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto var(--spacing-sm);
    color: var(--color-gold);
    animation: glow 3s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% { filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.4)); }
    50% { filter: drop-shadow(0 0 16px rgba(212, 175, 55, 0.7)); }
}

.title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-white);
    margin-bottom: var(--spacing-xs);
}

.title sup,
.subtitle sup {
    font-size: 0.5em;
    vertical-align: super;
    opacity: 0.6;
    font-weight: 400;
}

.subtitle {
    font-size: 0.875rem;
    font-weight: 300;
    color: var(--color-gold);
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.subtitle-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.subtitle-link:hover {
    color: var(--color-gold-light);
}

.ceremony-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.8125rem;
    font-weight: 300;
    color: var(--color-white-dim);
    margin-top: var(--spacing-xs);
}

.ceremony-info .separator {
    color: var(--color-black-lighter);
}

.ceremony-info .mode-label {
    color: var(--color-white-dim);
}

.mode-select {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 300;
    color: var(--color-white-dim);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
    padding-right: 14px;
}

.mode-select:focus {
    outline: none;
}

.mode-select option {
    background: var(--color-black-light);
    color: var(--color-white);
}

/* Main Content */
.main {
    flex: 1;
    padding: var(--spacing-md);
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
}

/* Category */
.category {
    margin-bottom: var(--spacing-lg);
}

.category-header,
.category-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--color-black-lighter);
    gap: var(--spacing-xs);
}

.category-header {
    margin-bottom: var(--spacing-md);
}

.category-footer {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-sm);
    padding-bottom: 0;
    border-bottom: none;
    border-top: 1px solid var(--color-black-lighter);
}

.category-selector {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.category-select-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
}

.category-prefix {
    font-family: var(--font-display);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-white-dim);
    letter-spacing: 0.05em;
}

.category-select {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-white);
    background: transparent;
    border: none;
    text-align: center;
    cursor: pointer;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 6px;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 100%;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 28px;
}

.category-select:hover {
    background-color: var(--color-black-lighter);
}

.category-select:focus {
    outline: none;
    background-color: var(--color-black-lighter);
}

.category-select option {
    background: var(--color-black-light);
    color: var(--color-white);
    padding: var(--spacing-sm);
}

.nav-btn {
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--color-black-lighter);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white-dim);
    transition: all 0.2s ease;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.nav-btn:hover {
    background: var(--color-black-lighter);
    border-color: var(--color-gold-dark);
    color: var(--color-gold);
}

.nav-btn:active {
    transform: scale(0.95);
}

.nav-btn svg {
    width: 18px;
    height: 18px;
}

.progress {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--color-gold);
    font-variant-numeric: tabular-nums;
}

/* Films List */
.films {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.film {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--color-black-light);
    border: 1px solid var(--color-black-lighter);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.film:hover {
    background: var(--color-black-lighter);
    border-color: rgba(212, 175, 55, 0.3);
}

.film:active {
    transform: scale(0.98);
}

.film.watched {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);
    border-color: var(--color-gold-dark);
}

.film.watched .film-title {
    color: var(--color-gold-light);
}

.film.watched .film-studio {
    color: var(--color-gold-dark);
}

.film.predicted {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(212, 175, 55, 0.08) 100%);
    border-color: var(--color-gold);
}

.film.predicted .film-title {
    color: var(--color-gold-light);
}

.film.predicted .film-studio {
    color: var(--color-gold-dark);
}

/* Checkbox */
.checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--color-black-lighter);
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.film:hover .checkbox {
    border-color: var(--color-gold-dark);
}

.film.watched .checkbox {
    background: var(--color-gold);
    border-color: var(--color-gold);
}

.film.predicted .checkbox {
    background: var(--color-gold);
    border-color: var(--color-gold);
}

.checkbox svg {
    width: 14px;
    height: 14px;
    color: var(--color-black);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s ease;
}

.film.watched .checkbox svg,
.film.predicted .checkbox svg {
    opacity: 1;
    transform: scale(1);
}

/* Film Info */
.film-info {
    flex: 1;
    min-width: 0;
}

.film-title {
    font-family: var(--font-display);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-white);
    margin-bottom: 2px;
    transition: color 0.2s ease;
}

/* Streaming Box */
.streaming-box {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.streaming-box.empty {
    visibility: hidden;
}

.streaming-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.streaming-icon img {
    width: 18px;
    height: 18px;
    display: block;
}

.streaming-icon:hover {
    background: #fff;
    transform: scale(1.05);
}

.streaming-icon:active {
    transform: scale(0.95);
}

.film-studio {
    font-size: 0.8125rem;
    font-weight: 300;
    color: var(--color-white-dim);
    transition: color 0.2s ease;
}

/* Onboarding Screen */
.onboarding-screen {
    padding-bottom: var(--spacing-xl);
}

.onboarding-prompt {
    text-align: center;
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-white-dim);
    margin-bottom: var(--spacing-lg);
}

.nomination-badge {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-gold);
    background: rgba(212, 175, 55, 0.15);
    padding: 4px 10px;
    border-radius: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.film.watched .nomination-badge {
    background: rgba(212, 175, 55, 0.25);
    color: var(--color-gold-light);
}

.browse-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 280px;
    margin: var(--spacing-lg) auto 0;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-black);
    background: var(--color-gold);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.browse-btn:hover {
    background: var(--color-gold-light);
}

.browse-btn:active {
    transform: scale(0.98);
}

.browse-btn svg {
    width: 18px;
    height: 18px;
}

/* Footer */
.footer {
    text-align: center;
    padding: var(--spacing-md);
    padding-bottom: var(--spacing-lg);
    color: var(--color-white-dim);
    font-size: 0.8125rem;
    font-weight: 300;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
}

.tip-label {
    color: var(--color-gold-dark);
    font-weight: 500;
}

.refresh-btn {
    position: relative;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--color-black-lighter);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-black-lighter);
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.refresh-btn svg {
    width: 16px;
    height: 16px;
}

.refresh-btn:hover {
    color: var(--color-white-dim);
    border-color: var(--color-white-dim);
}

.refresh-btn:active {
    transform: scale(0.95);
}

.refresh-btn .tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 6px 10px;
    background: var(--color-black-lighter);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: 400;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
}

.refresh-btn .tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--color-black-lighter);
}

.refresh-btn:hover .tooltip,
.refresh-btn:focus .tooltip {
    opacity: 1;
    visibility: visible;
}

.legal-disclaimer {
    font-size: 0.625rem;
    line-height: 1.4;
    color: var(--color-black-lighter);
    max-width: 320px;
    margin-top: var(--spacing-sm);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.film {
    animation: fadeInUp 0.4s ease backwards;
}

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

/* PWA Standalone Mode Adjustments */
@media (display-mode: standalone) {
    .header {
        padding-top: calc(var(--spacing-lg) + var(--safe-area-top));
    }
}

/* Landscape adjustments */
@media (orientation: landscape) and (max-height: 500px) {
    .header {
        padding: var(--spacing-md);
    }
    
    .trophy-icon {
        width: 32px;
        height: 32px;
    }
    
    .title {
        font-size: 1.5rem;
    }
}

/* Larger screens */
@media (min-width: 768px) {
    .title {
        font-size: 2.75rem;
    }

    .category-header,
    .category-footer {
        justify-content: center;
        gap: var(--spacing-lg);
    }

    .category-selector {
        flex: unset;
        flex-direction: row;
        align-items: center;
        gap: var(--spacing-lg);
    }

    .category-select-row {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }

    .category-prefix {
        font-size: 1.125rem;
        font-weight: 600;
        color: var(--color-white);
    }

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

    .film-title {
        font-size: 1.125rem;
    }
}
