/* ==========================================================================
   CINESTREAM - Movie Release Info Web App CSS (Modern Cinema Dark Mode)
   ========================================================================== */

:root, [data-theme="dark"] {
    --bg-main: #0b0e17;
    --bg-card: #151a28;
    --bg-card-hover: #1e2638;
    --bg-glass: rgba(21, 26, 40, 0.75);
    --bg-modal: #121722;
    --accent-red: #e50914;
    --accent-red-hover: #f40612;
    --accent-gold: #ffb703;
    --accent-blue: #3a86ef;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.15);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(229, 9, 20, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-modal: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.15);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 4px 15px rgba(229, 9, 20, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: #2a3447;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red);
}

/* Header & Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: var(--transition);
}

.theme-toggle-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.theme-toggle-btn:hover {
    background: rgba(229, 9, 20, 0.15);
    color: var(--accent-red);
    border-color: var(--accent-red);
}

[data-theme="light"] .sun-icon {
    display: none;
}
[data-theme="light"] .moon-icon {
    display: block;
    color: #475569;
}
[data-theme="dark"] .sun-icon {
    display: block;
    color: var(--accent-gold);
}
[data-theme="dark"] .moon-icon {
    display: none;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.navbar-brand i {
    color: var(--accent-red);
    font-size: 1.8rem;
    filter: drop-shadow(0 0 8px rgba(229, 9, 20, 0.6));
}

.brand-accent {
    color: var(--accent-red);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-full);
}

.nav-link:hover, .nav-link.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

/* Search Bar */
.search-box {
    position: relative;
    width: 280px;
}

.search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0.6rem 1rem 0.6rem 2.8rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-red);
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.3);
    width: 320px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

/* Hero Section */
.hero-slider {
    position: relative;
    height: 70vh;
    min-height: 480px;
    margin-top: 70px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center top;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: flex-end;
}

.hero-slide.active {
    opacity: 1;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        var(--bg-main) 5%,
        rgba(11, 14, 23, 0.8) 50%,
        rgba(11, 14, 23, 0.3) 100%
    );
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 800px;
    padding: 3rem 2rem 4rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(229, 9, 20, 0.85);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    box-shadow: 0 0 12px rgba(229, 9, 20, 0.5);
}

.hero-title {
    font-size: 3rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
}

.hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.hero-meta-item i {
    color: var(--accent-gold);
}

.hero-overview {
    font-size: 1rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1.5rem;
    max-width: 680px;
}

.hero-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-full);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--accent-red);
    color: white;
    box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
    background: var(--accent-red-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(229, 9, 20, 0.7);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.12);
    color: white;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
}

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

/* Slider Controls */
.hero-controls {
    position: absolute;
    right: 2rem;
    bottom: 3rem;
    z-index: 20;
    display: flex;
    gap: 0.6rem;
}

.control-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.control-dot.active {
    background: var(--accent-red);
    width: 32px;
    border-radius: 6px;
    box-shadow: 0 0 10px rgba(229, 9, 20, 0.8);
}

/* Main Layout & Containers */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Section Header & Tabs */
.section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.section-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-title-icon {
    width: 4px;
    height: 28px;
    background: var(--accent-red);
    border-radius: 2px;
}

.section-title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.category-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.4rem;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1.4rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

.tab-count {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.85;
    background: rgba(255, 255, 255, 0.12);
    padding: 0.12rem 0.5rem;
    border-radius: var(--radius-full);
    margin-left: 0.2rem;
    transition: var(--transition);
}

.tab-btn:hover .tab-count {
    background: rgba(255, 255, 255, 0.22);
}

.tab-btn.active .tab-count {
    background: rgba(255, 255, 255, 0.3);
    color: #fff;
}

/* Genre Filter Pills */
.genre-scroller {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    scrollbar-width: none;
}

.genre-scroller::-webkit-scrollbar {
    display: none;
}

.genre-chip {
    flex: 0 0 auto;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1.2rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.genre-chip:hover, .genre-chip.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    border-color: var(--border-light);
}

.genre-chip.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(58, 134, 239, 0.4);
}

/* Movie Grid */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.8rem;
}

/* Movie Card */
.movie-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    transform: translateY(-8px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-soft), 0 0 20px rgba(0, 0, 0, 0.6);
}

.poster-wrapper {
    position: relative;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #1a2234;
}

.poster-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.movie-card:hover .poster-img {
    transform: scale(1.08);
}

.release-tag {
    position: absolute;
    top: 0.8rem;
    left: 0.8rem;
    background: rgba(11, 14, 23, 0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.release-tag.upcoming {
    border-color: var(--accent-red);
    color: #ff6b6b;
}

.rating-badge {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    background: rgba(11, 14, 23, 0.85);
    backdrop-filter: blur(8px);
    color: var(--accent-gold);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid rgba(255, 183, 3, 0.3);
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 14, 23, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

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

.play-icon-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--accent-red);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: var(--shadow-glow);
    transform: scale(0.8);
    transition: var(--transition);
}

.movie-card:hover .play-icon-btn {
    transform: scale(1);
}

.movie-info {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.movie-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.movie-meta-text {
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

/* Pagination / Load More */
.load-more-wrap {
    text-align: center;
    margin-top: 3rem;
}

/* Modal Windows */
.modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-modal);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border-light);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
    position: relative;
    transform: scale(0.9);
    transition: var(--transition);
}

.modal-backdrop.active .modal-container {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    z-index: 10;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--border-color);
    color: white;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.modal-close-btn:hover {
    background: var(--accent-red);
    transform: rotate(90deg);
}

.modal-hero {
    position: relative;
    height: 380px;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: flex-end;
}

.modal-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, var(--bg-modal) 0%, rgba(18, 23, 34, 0.4) 100%);
}

.modal-header-content {
    position: relative;
    z-index: 5;
    padding: 2rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-end;
}

.modal-poster {
    width: 130px;
    aspect-ratio: 2 / 3;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
    border: 2px solid var(--border-light);
    object-fit: cover;
}

.modal-title-block h2 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.5rem;
}

.modal-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-body {
    padding: 2rem;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
    border-left: 3px solid var(--accent-red);
    padding-left: 0.6rem;
}

.overview-text {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

/* Cast horizontal grid */
.cast-grid {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.8rem;
}

.cast-card {
    flex: 0 0 110px;
    text-align: center;
}

.cast-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 0.5rem;
    border: 2px solid var(--border-color);
    background: #1e2638;
}

.cast-name {
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
}

.cast-character {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Trailer Embed */
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #000;
}

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

/* Empty State / Loading */
.loading-spinner {
    text-align: center;
    padding: 4rem 0;
    color: var(--accent-red);
    font-size: 2.5rem;
}

.spin-icon {
    animation: spin 1s infinite linear;
}

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

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    color: var(--border-light);
}

/* Footer */
footer {
    border-top: 1px solid var(--border-color);
    background: #070910;
    padding: 3rem 2rem;
    margin-top: 5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

footer a {
    color: var(--text-secondary);
    text-decoration: none;
}

footer a:hover {
    color: var(--accent-red);
}

/* Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 0.8rem 1rem;
    }
    .nav-links {
        display: none;
    }
    .search-box {
        width: 180px;
    }
    .search-input:focus {
        width: 200px;
    }
    .hero-slider {
        height: 55vh;
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-content {
        padding: 1.5rem 1rem 3rem;
    }
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
    .modal-header-content {
        flex-direction: column;
        align-items: flex-start;
    }
    .modal-poster {
        width: 100px;
    }
}

/* Ticket Reservation Buttons */
.ticket-buttons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
    margin-top: 0.8rem;
}

.ticket-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: var(--transition);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ticket-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.naver-ticket {
    background: #03c75a;
}
.naver-ticket:hover {
    background: #02b350;
}

.cgv-ticket {
    background: #e71a0f;
}
.cgv-ticket:hover {
    background: #cf140a;
}

.lotte-ticket {
    background: #ed1c24;
}
.lotte-ticket:hover {
    background: #d4141b;
}

.megabox-ticket {
    background: #361763;
}
.megabox-ticket:hover {
    background: #2a114f;
}
