/* =========================================
   THEME ENHANCEMENTS & LIGHT MODE SUPPORT
   This file extends the base style.css with theme variables
   ========================================= */

/* CSS Variables for theming */
:root {
    /* Dark theme (default) */
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-tertiary: #1a1a1a;
    --bg-card: #111111;
    --bg-hover: #222222;
    
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #888888;
    
    --accent-primary: #ff6b00;
    --accent-secondary: #ff8533;
    --accent-hover: #ff9d5c;
    
    --border-color: rgba(43, 43, 43, 1);
    --border-light: rgba(255, 255, 255, 0.1);
    
    --overlay-bg: rgba(0, 0, 0, 0.85);
    --glass-bg: rgba(0, 0, 0, 0.7);
    
    --success-color: #4caf50;
    --error-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.5);
    
    --gradient-hero: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0) 100%);
}

/* Light theme overrides */
body.theme-light {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

body.theme-light .navbar {
    background: var(--gradient-hero);
    border-bottom: 1px solid var(--border-color);
}

body.theme-light .search-box {
    background: rgba(240, 240, 240, 0.9) !important;
    border: 1px solid var(--border-color);
}

body.theme-light .search-box input {
    color: var(--text-primary) !important;
}

body.theme-light .search-results-menu {
    background: rgba(250, 250, 250, 0.95) !important;
    border: 1px solid var(--border-color);
}

body.theme-light .search-item {
    border-bottom: 1px solid var(--border-light);
}

body.theme-light .search-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.theme-light .search-info h5 {
    color: var(--text-primary);
}

body.theme-light .search-info p {
    color: var(--text-muted);
}

body.theme-light .account-dropdown {
    background: rgba(250, 250, 250, 0.95) !important;
    border: 1px solid var(--border-color);
}

body.theme-light .dropdown-header {
    border-bottom: 1px solid var(--border-light);
}

body.theme-light .tier-badge {
    background: var(--accent-primary);
    color: white;
}

body.theme-light .drop-link {
    color: var(--text-primary);
}

body.theme-light .drop-link:hover {
    background: rgba(0, 0, 0, 0.05);
}

body.theme-light .hero {
    background: var(--bg-secondary);
}

body.theme-light .hero-overlay {
    background: linear-gradient(to top, var(--bg-primary) 0%, transparent 100%);
}

body.theme-light .hero-glass-container {
    background: var(--glass-bg);
    backdrop-filter: blur(15px);
}

body.theme-light .hero-title,
body.theme-light .hero-desc {
    color: var(--text-primary);
}

body.theme-light .btn-play {
    background: var(--accent-primary);
    color: white;
}

body.theme-light .btn-play:hover {
    background: var(--accent-hover);
}

body.theme-light .btn-info {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

body.theme-light .row-title {
    color: var(--text-primary);
}

body.theme-light .movie-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
}

body.theme-light .movie-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

body.theme-light .movie-card h4 {
    color: var(--text-primary);
}

body.theme-light .movie-card .year {
    color: var(--text-muted);
}

body.theme-light .promo-section {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

body.theme-light .promo-overlay {
    background: var(--overlay-bg);
}

body.theme-light .movie-detail-overlay {
    background: var(--overlay-bg);
}

body.theme-light .overlay-wrapper {
    background: var(--bg-card);
}

body.theme-light .stats-sidebar {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

body.theme-light .site-footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
}

body.theme-light .footer-desc,
body.theme-light .footer-col a {
    color: var(--text-secondary);
}

body.theme-light .signup-overlay {
    background: var(--overlay-bg);
}

body.theme-light .signup-box {
    background: var(--bg-card);
    color: var(--text-primary);
}

body.theme-light .signup-subtitle {
    color: var(--text-secondary);
}

body.theme-light .input-group input,
body.theme-light .input-group select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

body.theme-light .input-group label {
    color: var(--text-muted);
}

body.theme-light .settings-modal-overlay {
    background: var(--overlay-bg);
}

body.theme-light .settings-content {
    background: var(--bg-card);
    color: var(--text-primary);
}

body.theme-light .setting-item input,
body.theme-light .setting-item textarea,
body.theme-light .setting-item select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

body.theme-light .beta-notice-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
}

body.theme-light .confirm-modal-box {
    background: var(--bg-card);
    color: var(--text-primary);
}


/* Theme toggle button styles */
.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.theme-toggle-icon {
    font-size: 1.2rem;
}

/* Language selector styles */
.language-selector {
    position: relative;
}

.language-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.language-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.language-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: none;
    min-width: 150px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.language-dropdown.active {
    display: block;
}

.language-option {
    padding: 10px 15px;
    cursor: pointer;
    color: var(--text-primary);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-option:hover {
    background: var(--bg-hover);
}

.language-option.selected {
    background: var(--accent-primary);
    color: white;
}

.language-flag {
    font-size: 1.2rem;
}

/* Loading skeleton for better UX */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-hover) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-card {
    width: 100%;
    height: 300px;
}

.skeleton-text {
    width: 100%;
    height: 20px;
    margin: 10px 0;
}

/* Continue watching feature */
.continue-watching-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.continue-watching-progress {
    height: 100%;
    background: var(--accent-primary);
    transition: width 0.3s ease;
}

/* Watch history indicator */
.watched-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--success-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

/* Improved tooltips */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 12px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    margin-bottom: 8px;
    box-shadow: var(--shadow-md);
}

.tooltip:hover::after {
    opacity: 1;
}

/* Smooth transitions for theme changes */
* {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Accessibility improvements */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}
 
.theme-selector {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.theme-option {
    flex: 1;
    padding: 12px 20px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

.theme-option:hover {
    background: var(--bg-hover);
    border-color: var(--accent-secondary);
}

.theme-option.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.theme-icon {
    font-size: 1.5rem;
}

/* Settings: Toggle Switch */
.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 26px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 2px;
    top: 2px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
    background: white;
}

.toggle-description {
    color: var(--text-muted);
    font-size: 0.85rem;
    flex: 1 1 200px;
}

/* Settings: Hero trailer audio switch */
.hero-audio-setting {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 10px;
    padding: 12px 0 4px;
    border-top: 1px solid var(--border-color);
}

.hero-audio-copy {
    min-width: 0;
}

.hero-audio-copy label {
    display: block;
    margin: 0 0 4px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
}

.hero-audio-copy p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.3;
}

.hero-audio-switch {
    position: relative;
    display: inline-flex;
    width: 50px;
    height: 28px;
    flex: 0 0 auto;
    cursor: pointer;
}

.hero-audio-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.hero-audio-slider {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    transition: all 0.25s ease;
}

.hero-audio-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform 0.25s ease, background 0.25s ease;
}

.hero-audio-switch input[type="checkbox"]:checked + .hero-audio-slider {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
}

.hero-audio-switch input[type="checkbox"]:checked + .hero-audio-slider::before {
    transform: translateX(22px);
    background: #fff;
}

@media (max-width: 540px) {
    .hero-audio-setting {
        align-items: flex-start;
    }

    .hero-audio-switch {
        margin-top: 2px;
    }
}

/* Improved light mode with filter inversion */
body.theme-light {
    filter: invert(1) hue-rotate(180deg);
}

body.theme-light img,
body.theme-light video,
body.theme-light .movie-card img,
body.theme-light .poster-img,
body.theme-light [style*="background-image"] {
    filter: invert(1) hue-rotate(180deg);
}

/* Smooth transitions for all interactive elements */
button, .btn, .apply-btn, .theme-option, .toggle-slider {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover effects with smooth scaling */
.movie-card:hover {
    transform: scale(1.05) translateY(-5px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn:hover, .apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
}

/* Fade-in animation for content */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.setting-item {
    animation: fadeIn 0.4s ease-out;
}

/* Professional card shadows */
.settings-content,
.modal-header,
.setting-item {
    box-shadow: var(--shadow-md);
}

/* Improved input focus states */
input:focus, textarea:focus, select:focus {
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.1);
    transition: all 0.2s ease;
}
