:root {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #8b5cf6;
    --accent-secondary: #3b82f6;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --font-main: 'Outfit', sans-serif;
    --shadow-soft: 0 4px 30px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    line-height: 1.6;
}

/* Background Animations */
.bg-shape {
    position: fixed;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -2;
    animation: float 20s infinite ease-in-out alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    opacity: 0.15;
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--accent-secondary);
    opacity: 0.15;
    bottom: -150px;
    right: -100px;
    animation-delay: -5s;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, var(--bg-color) 100%);
    z-index: -1;
    pointer-events: none;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Typography & Layout */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    z-index: 100; /* Ensures main content always sits above footer */
}

.app-header {
    text-align: center;
    margin-bottom: 1rem;
}

.logo {
    font-size: 3rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Search Bar (Glassmorphism) */
.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    z-index: 50; /* Ensure dropdown stays above footer */
}

.search-box {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 50px;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.search-box:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 10px 40px rgba(139, 92, 246, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
}

.search-icon {
    padding: 0 1rem;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.search-box input {
    flex: 1;
    min-width: 0; /* Prevents input from stretching flex container horizontally */
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    padding: 0.5rem 0;
}

.search-box input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    background: var(--accent-gradient);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 40px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.search-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

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

.hidden {
    display: none !important;
}

/* States */
.loading-state, .error-state {
    text-align: center;
    padding: 3rem;
    background: var(--card-bg);
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    animation: fadeIn 0.4s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

.error-icon {
    font-size: 4rem;
    color: var(--danger);
    margin-bottom: 1rem;
}

@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Movie Card */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 768px) {
    .glass-panel {
        flex-direction: row;
    }
}

.movie-poster {
    position: relative;
    width: 100%;
    height: 300px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
}

@media (min-width: 768px) {
    .movie-poster {
        width: 300px;
        height: 450px;
    }
}

.movie-poster img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.poster-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.movie-poster:hover .poster-overlay {
    opacity: 1;
}

.trailer-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border: 1px solid white;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.trailer-btn:hover {
    background: white;
    color: black;
    transform: scale(1.05);
}

.movie-info {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.title-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

#movieTitle {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.badge {
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
}

.badge.year {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.badge.runtime {
    background: rgba(59, 130, 246, 0.2);
    color: var(--accent-secondary);
}

.meta-tags {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.genre {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.rated {
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

.plot {
    color: var(--text-primary);
    font-size: 1.05rem;
    line-height: 1.7;
    border-left: 3px solid var(--accent-primary);
    padding-left: 1rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 1.5rem;
    border-radius: 16px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.info-item .label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.info-item .value {
    color: var(--text-primary);
    font-weight: 500;
}

/* Ratings */
.ratings-section h3, .reviews-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.ratings-container {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.rating-badge {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    transition: transform 0.2s ease, background 0.3s ease;
}

.rating-badge:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.1);
}

.rating-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.rating-icon.imdb { color: #f5c518; font-size: 1.5rem; }
.rating-icon.rotten { color: #fa320a; font-size: 1.5rem; }
.rating-icon.google { color: #4285F4; font-size: 1.5rem; }
.rating-icon.metacritic { color: #66cc33; font-size: 1.5rem; }

.rating-value {
    font-size: 1.1rem;
    font-weight: 700;
}

.rating-source {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: block;
}

/* Reviews */
.reviews-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.review-card {
    background: rgba(255, 255, 255, 0.03);
    padding: 1.2rem;
    border-radius: 12px;
    border-left: 3px solid var(--accent-secondary);
}

.review-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.reviewer {
    font-weight: 600;
    color: var(--accent-secondary);
}

.review-score {
    color: var(--warning);
    font-weight: bold;
}

.review-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Suggestions Box */
.suggestions-box {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
    z-index: 10;
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.suggestion-item {
    padding: 1rem 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

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

.suggestion-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Footer */
.app-footer {
    margin-top: 4rem;
    padding: 3rem 2rem 1.5rem;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1.5fr;
    }
}

.footer-section h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.about-section p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.donate-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.donate-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.donate-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.donate-btn.paypal:hover { border-color: #0079C1; color: #0079C1; }
.donate-btn.btc:hover { border-color: #F7931A; color: #F7931A; }
.donate-btn.eth:hover { border-color: #627EEA; color: #627EEA; }

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.share-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
}

.share-btn.twitter:hover { color: #1DA1F2; border-color: #1DA1F2; }
.share-btn.facebook:hover { color: #1877F2; border-color: #1877F2; }
.share-btn.whatsapp:hover { color: #25D366; border-color: #25D366; }
.share-btn.link:hover { color: var(--accent-primary); border-color: var(--accent-primary); }

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-bottom a {
    color: var(--accent-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-bottom a:hover {
    color: var(--accent-primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--accent-primary);
}

/* Player View */
.player-view {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    animation: fadeIn 0.4s ease;
}

.player-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}

.back-btn {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-5px);
}

.video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.share-code-box {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.share-code-box h3 {
    margin: 0;
    font-size: 1.2rem;
}

.code-snippet {
    display: flex;
    gap: 0.5rem;
}

.code-snippet input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.8rem 1rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 0.95rem;
    outline: none;
}

.code-snippet button {
    background: var(--accent-gradient);
    border: none;
    color: white;
    padding: 0 1.2rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s ease;
}

.code-snippet button:hover {
    opacity: 0.9;
}

/* Player Extra Controls */
.tv-controls {
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.control-group select {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    outline: none;
    min-width: 150px;
    cursor: pointer;
}

.control-group select option {
    background: var(--bg-color);
    color: var(--text-primary);
}

.related-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-content h3 {
    margin: 0;
    font-size: 1.2rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 1rem;
}

.related-item {
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.related-item:hover {
    transform: translateY(-5px);
}

.related-item img {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.related-item span {
    font-size: 0.85rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-secondary);
}

/* Mobile Lite Optimizations - Simple Theme */
@media (max-width: 767px) {
    /* Completely remove glassmorphism and shadows on mobile */
    .glass-panel, .search-box {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: transparent;
        border: none;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
    }
    
    .suggestions-box {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg-color); /* MUST be solid so footer doesn't bleed through */
        border: 1px solid var(--glass-border);
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        border-radius: 8px;
        padding: 0;
        z-index: 200;
    }
    
    .search-box {
        background: var(--bg-color);
        border: 1px solid var(--glass-border);
        border-radius: 8px;
        padding: 0.5rem;
        flex-wrap: wrap;
    }
    
    .search-box input {
        flex: 1;
        min-width: 150px;
    }

    .container {
        padding: 1rem;
        gap: 1rem;
    }
    
    /* Disable all background animations */
    .bg-shape, .bg-overlay {
        display: none;
    }
    
    /* Simplified Typography */
    .logo {
        font-size: 1.8rem;
        background: none;
        color: var(--accent-primary);
        -webkit-text-fill-color: initial;
    }
    
    #movieTitle {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }
    
    /* Simple poster layout */
    .movie-poster {
        height: auto;
        aspect-ratio: 2/3;
        background: transparent;
        border-radius: 8px;
        margin-bottom: 1rem;
    }
    
    /* Simplify info grid */
    .info-grid {
        background: transparent;
        padding: 0;
        gap: 0.8rem;
        grid-template-columns: 1fr;
    }
    
    .info-item {
        flex-direction: row;
        justify-content: space-between;
        border-bottom: 1px solid var(--glass-border);
        padding-bottom: 0.5rem;
    }
    
    .info-item .label {
        font-size: 0.8rem;
    }
    
    /* Simplify buttons */
    .search-btn, .trailer-btn, .donate-btn {
        background: var(--accent-primary);
        border-radius: 8px;
        padding: 0.8rem;
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    
    .search-btn {
        margin-top: 0.5rem;
    }
    
    /* Stack TV Controls */
    .tv-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 0;
    }
    
    .control-group select {
        width: 100%;
        background: var(--bg-color);
    }
    
    /* Simplify footer */
    .app-footer {
        padding: 1.5rem 0;
        margin-top: 2rem;
        border-top: 1px solid var(--glass-border);
        border-radius: 0;
    }
    
    .footer-grid {
        gap: 1.5rem;
    }
    
    /* Hide some details on mobile */
    .rating-badge {
        padding: 0.5rem;
        background: transparent;
        border: 1px solid var(--glass-border);
    }
    
    .plot {
        font-size: 0.95rem;
        border-left: none;
        padding-left: 0;
    }
    
    /* Simplify related items */
    .related-content {
        padding: 0;
    }
}
