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

:root {
    /* Premium Dark Theme Colors */
    --bg-primary: #0a0e27;
    --bg-secondary: #121629;
    --bg-tertiary: #1a1f3a;
    --accent-primary: #d4af37;
    --accent-secondary: #f4d03f;
    --accent-blue: #4a90e2;
    --accent-purple: #8b5cf6;
    --text-primary: #ffffff;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    --glow-gold: rgba(212, 175, 55, 0.3);
    --glow-blue: rgba(74, 144, 226, 0.3);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(212, 175, 55, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #121629 25%, #1a1f3a 50%, #121629 75%, #0a0e27 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding: 12px;
    color: var(--text-primary);
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(138, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(212, 175, 55, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(74, 144, 226, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.header {
    text-align: center;
    margin-bottom: 20px;
    padding: 16px 12px;
}

.logo-container {
    margin-bottom: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    max-width: 160px;
    height: auto;
    filter: drop-shadow(0 0 30px var(--glow-gold))
            drop-shadow(0 0 60px rgba(212, 175, 55, 0.2))
            drop-shadow(0 8px 16px rgba(0, 0, 0, 0.4));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 20px;
}

.logo:hover {
    transform: scale(1.08) translateY(-5px);
    filter: drop-shadow(0 0 40px var(--glow-gold))
            drop-shadow(0 0 80px rgba(212, 175, 55, 0.3))
            drop-shadow(0 12px 24px rgba(0, 0, 0, 0.5));
}

.title {
    font-size: 2.75rem;
    font-weight: 800;
    margin-bottom: 6px;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #ffffff 0%, var(--accent-secondary) 50%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    word-wrap: break-word;
    hyphens: auto;
}

.subtitle {
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.75rem;
    opacity: 0.8;
}

.search-section {
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.8) 0%, rgba(18, 22, 41, 0.9) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 18px;
    padding: 18px 20px;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
}
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 0 1px var(--border-color),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid var(--border-color);
}

.type-selector {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
    flex-wrap: wrap;
    width: 100%;
}

.type-btn {
    flex: 1;
    min-width: 160px;
    max-width: 220px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(10px);
    letter-spacing: 0.3px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.type-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3),
                0 0 20px rgba(212, 175, 55, 0.2);
    color: var(--text-primary);
}

.type-btn.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-color: var(--accent-primary);
    box-shadow: 
        0 0 30px var(--glow-gold),
        0 8px 24px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
    color: var(--bg-primary);
    font-weight: 700;
}

.btn-icon {
    display: block;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
    color: inherit;
}

.type-btn .btn-icon {
    width: 20px;
    height: 20px;
}

.type-btn:hover .btn-icon {
    transform: scale(1.1);
}

.type-btn.active .btn-icon {
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.3));
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 100%;
}

.search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    font-size: 16px; /* Prevent zoom on iOS */
    border: 2px solid var(--border-color);
    border-radius: 14px;
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    outline: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 400;
    -webkit-appearance: none;
    appearance: none;
    box-sizing: border-box;
}

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

.search-input:focus {
    border-color: var(--accent-primary);
    background: rgba(10, 14, 39, 0.8);
    box-shadow: 
        0 0 30px var(--glow-gold),
        0 8px 24px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    pointer-events: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.search-icon svg {
    width: 100%;
    height: 100%;
}

.search-input:focus ~ .search-icon {
    opacity: 1;
}

.results-container {
    min-height: 200px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    font-size: 1.1rem;
    opacity: 0.8;
}

.results-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
    padding: 10px 0;
}

.result-card {
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.9) 0%, rgba(18, 22, 41, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-color);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05);
    width: 100%;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    display: flex;
    flex-direction: column;
}

.result-card:hover {
    transform: translateY(-12px) scale(1.03);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.5),
        0 0 40px var(--glow-gold),
        0 0 0 1px var(--border-hover);
    border-color: var(--border-hover);
}

.poster-container {
    width: 100%;
    height: 320px;
    min-height: 320px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    position: relative;
}

.poster-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: auto;
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.poster-image.poster-fallback {
    object-fit: contain;
    padding: 20px;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-secondary) 100%);
    opacity: 0.8;
}

.result-card:hover .poster-image {
    transform: scale(1.1);
}

.result-card:hover .poster-image.poster-fallback {
    opacity: 1;
}

.card-info {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.card-plot {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 4.5em; /* 3 lines * 1.5 line-height - fixed height for alignment */
    max-height: 4.5em;
    opacity: 0.85;
    transition: opacity 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.result-card:hover .card-plot {
    opacity: 1;
}

.card-plot.clickable {
    cursor: pointer;
    position: relative;
    padding-right: 20px;
}

.card-plot.clickable:hover {
    color: var(--accent-secondary);
    opacity: 1;
}

.card-plot.clickable::after {
    content: '...';
    position: absolute;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, transparent, var(--bg-tertiary) 30%);
    padding-left: 15px;
    color: var(--accent-secondary);
    font-weight: 700;
}

.trailer-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(244, 208, 63, 0.15) 100%);
    border: 2px solid var(--accent-primary);
    border-radius: 10px;
    color: var(--accent-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: auto;
    width: 100%;
    justify-content: center;
    backdrop-filter: blur(10px);
    touch-action: manipulation;
    flex-shrink: 0;
    align-self: flex-end;
}

.trailer-btn:hover {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 
        0 8px 20px rgba(212, 175, 55, 0.3),
        0 0 20px var(--glow-gold);
}

.trailer-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.card-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    margin-bottom: 12px;
}

.card-meta div {
    color: var(--text-secondary);
    line-height: 1.5;
}

.card-meta strong {
    color: var(--text-primary);
    font-weight: 700;
    margin-right: 8px;
    letter-spacing: 0.3px;
}

/* Make category text bold and clear */
.category-info {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.category-value {
    font-weight: 700;
    color: var(--accent-secondary);
    letter-spacing: 0.2px;
}

.rating-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(244, 208, 63, 0.2) 100%);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 700;
    width: fit-content;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: var(--accent-secondary);
    backdrop-filter: blur(10px);
    font-size: 0.85rem;
}

.star-icon {
    color: var(--accent-primary);
    filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5));
}

.loading {
    text-align: center;
    padding: 30px;
    font-size: 1rem;
}

.loading-spinner {
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    font-size: 1rem;
    opacity: 0.8;
}

.error-message {
    text-align: center;
    padding: 20px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 16px;
    margin: 16px 0;
    color: #fecaca;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 32px;
    padding: 20px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    touch-action: manipulation;
}

.pagination-btn:hover:not(.disabled) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: translateY(-2px);
}

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

.pagination-pages {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.pagination-page {
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-page:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.pagination-page.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    border-color: var(--accent-primary);
    color: var(--bg-primary);
    box-shadow: 0 0 20px var(--glow-gold);
    font-weight: 700;
}

.pagination-ellipsis {
    color: var(--text-secondary);
    padding: 0 4px;
    font-weight: 600;
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-left: auto;
    padding: 0 12px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .logo {
        max-width: 120px;
    }
    
    .logo-container {
        margin-bottom: 8px;
    }
    
    .title {
        font-size: 1.75rem;
        margin-bottom: 4px;
    }
    
    .subtitle {
        font-size: 0.7rem;
    }
    
    .header {
        margin-bottom: 16px;
        padding: 12px 10px;
    }
    
    .search-section {
        padding: 14px 12px;
        margin-bottom: 18px;
        border-radius: 16px;
        gap: 12px;
    }
    
    .type-selector {
        flex-direction: row;
        gap: 8px;
        margin-bottom: 0;
        justify-content: center;
    }
    
    .type-btn {
        max-width: none;
        flex: 1;
        min-width: 140px;
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .btn-icon {
        width: 18px;
        height: 18px;
    }
    
    .type-btn svg.btn-icon {
        width: 18px;
        height: 18px;
    }
    
    .search-input {
        padding: 12px 45px 12px 18px;
        font-size: 16px; /* Prevent zoom on iOS */
        border-radius: 12px;
    }
    
    .search-icon {
        right: 18px;
        width: 18px;
        height: 18px;
    }
    
    .results-header h2 {
        font-size: 1.25rem;
        margin-bottom: 12px;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 8px 0;
    }
    
    .poster-container {
        height: 260px;
        min-height: 260px;
    }
    
    .poster-image {
        object-fit: contain;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: auto;
        -ms-interpolation-mode: bicubic;
    }
    
    .poster-image.poster-fallback {
        object-fit: contain;
    }
    
    .card-info {
        padding: 12px;
    }
    
    .card-title {
        font-size: 1rem;
        margin-bottom: 8px;
    }
    
    .card-plot {
        font-size: 0.8rem;
        margin-bottom: 10px;
        -webkit-line-clamp: 2;
        max-height: 3em; /* 2 lines * 1.5 line-height */
    }
    
    .card-meta {
        font-size: 0.8rem;
        gap: 6px;
    }
    
    .category-info {
        font-size: 0.85rem;
    }
    
    .category-value {
        font-size: 0.85rem;
    }
    
    .rating-badge {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .welcome-message {
        padding: 30px 15px;
        font-size: 1rem;
    }
    
    .loading {
        padding: 30px 20px;
        font-size: 0.95rem;
    }
    
    .no-results {
        padding: 30px 15px;
        font-size: 0.95rem;
    }
    
    .pagination-container {
        gap: 8px;
        padding: 16px 12px;
        margin-top: 24px;
    }
    
    .pagination-btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .pagination-page {
        min-width: 36px;
        height: 36px;
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .pagination-info {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 8px;
        font-size: 0.8rem;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    body {
        padding: 8px;
    }
    
    .logo {
        max-width: 100px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .header {
        padding: 10px 8px;
        margin-bottom: 12px;
    }
    
    .search-section {
        padding: 12px 10px;
        margin-bottom: 16px;
        gap: 10px;
    }
    
    .type-btn {
        min-width: 120px;
        padding: 11px 16px;
        font-size: 0.85rem;
        gap: 8px;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .poster-container {
        height: 300px;
        min-height: 300px;
    }
    
    .poster-image {
        object-fit: contain;
        image-rendering: -webkit-optimize-contrast;
        image-rendering: auto;
        -ms-interpolation-mode: bicubic;
    }
    
    .poster-image.poster-fallback {
        object-fit: contain;
    }
    
    .card-title {
        font-size: 0.95rem;
    }
    
    .card-plot {
        font-size: 0.75rem;
        margin-bottom: 8px;
        -webkit-line-clamp: 2;
        max-height: 3em;
    }
    
    .card-meta {
        font-size: 0.75rem;
    }
    
    .pagination-container {
        gap: 6px;
        padding: 12px 8px;
        margin-top: 20px;
    }
    
    .pagination-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        gap: 6px;
    }
    
    .pagination-pages {
        gap: 4px;
    }
    
    .pagination-page {
        min-width: 32px;
        height: 32px;
        padding: 6px 8px;
        font-size: 0.8rem;
    }
    
    .pagination-info {
        font-size: 0.75rem;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .type-btn {
        min-height: 44px; /* Minimum touch target size */
    }
    
    .result-card {
        cursor: default;
    }
    
    .result-card:active {
        transform: translateY(-4px) scale(0.98);
        opacity: 0.9;
    }
    
    .result-card:hover {
        transform: none; /* Disable hover transform on touch devices */
    }
    
    .search-input {
        min-height: 44px;
    }
    
    .logo:hover {
        transform: none; /* Disable hover on touch devices */
    }
}

/* Landscape mobile orientation */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        padding: 8px 10px;
        margin-bottom: 12px;
    }
    
    .logo {
        max-width: 80px;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.65rem;
    }
    
    .search-section {
        padding: 12px;
    }
    
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .poster-container {
        height: 200px;
    }
    
    .poster-image {
        object-fit: contain;
    }
    
    .poster-image.poster-fallback {
        object-fit: contain;
    }
}

/* Prevent text selection on interactive elements */
.type-btn,
.result-card {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Smooth scrolling */
html {
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Plot Modal Styles */
.plot-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.plot-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.plot-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.plot-modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.98) 0%, rgba(18, 22, 41, 0.98) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    max-width: 90%;
    width: 100%;
    max-width: 700px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px var(--border-color),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 60px rgba(212, 175, 55, 0.2);
    border: 1px solid var(--border-color);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.plot-modal.active .plot-modal-content {
    transform: scale(1) translateY(0);
}

.plot-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.plot-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.plot-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.plot-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.plot-modal-close svg {
    width: 20px;
    height: 20px;
}

.plot-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

.plot-modal-text {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Mobile Modal Styles */
@media (max-width: 768px) {
    .plot-modal-content {
        max-width: 95%;
        max-height: 85vh;
        border-radius: 16px;
    }
    
    .plot-modal-header {
        padding: 16px 20px;
    }
    
    .plot-modal-title {
        font-size: 1.25rem;
    }
    
    .plot-modal-body {
        padding: 20px;
    }
    
    .plot-modal-text {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .plot-modal-close {
        width: 32px;
        height: 32px;
    }
    
    .plot-modal-close svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .plot-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .plot-modal-header {
        padding: 14px 16px;
    }
    
    .plot-modal-title {
        font-size: 1.1rem;
    }
    
    .plot-modal-body {
        padding: 16px;
    }
    
    .plot-modal-text {
        font-size: 0.9rem;
    }
}

/* Trailer Modal Styles */
.trailer-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.trailer-modal.active {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.trailer-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.trailer-modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(26, 31, 58, 0.98) 0%, rgba(18, 22, 41, 0.98) 100%);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 20px;
    max-width: 90%;
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px var(--border-color),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 60px rgba(212, 175, 55, 0.2);
    border: 1px solid var(--border-color);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.trailer-modal.active .trailer-modal-content {
    transform: scale(1) translateY(0);
}

.trailer-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.trailer-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trailer-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.trailer-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.trailer-modal-close svg {
    width: 20px;
    height: 20px;
}

.trailer-modal-body {
    padding: 0;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.trailer-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.trailer-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.no-trailer-message {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: var(--text-secondary);
}

.no-trailer-icon {
    width: 64px;
    height: 64px;
    opacity: 0.5;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.no-trailer-message p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

/* Mobile Trailer Modal Styles */
@media (max-width: 768px) {
    .trailer-modal-content {
        max-width: 95%;
        border-radius: 16px;
    }
    
    .trailer-modal-header {
        padding: 16px 20px;
    }
    
    .trailer-modal-title {
        font-size: 1.25rem;
    }
    
    .trailer-modal-close {
        width: 32px;
        height: 32px;
    }
    
    .trailer-modal-close svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .trailer-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .trailer-modal-header {
        padding: 14px 16px;
    }
    
    .trailer-modal-title {
        font-size: 1.1rem;
    }
    
    .trailer-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        gap: 6px;
    }
    
    .trailer-icon {
        width: 16px;
        height: 16px;
    }
    
    .no-trailer-message {
        padding: 30px 20px;
    }
    
    .no-trailer-icon {
        width: 48px;
        height: 48px;
        margin-bottom: 16px;
    }
    
    .no-trailer-message p {
        font-size: 1rem;
    }
}

