/* TMDB Cinema Hub Modern Dark UI Stylesheet */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700;800;900&family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap');

:root {
    --bg-primary: #0a0c10;
    --bg-secondary: #121620;
    --bg-card: #181d2a;
    --bg-card-hover: #22293b;
    --bg-glass: rgba(24, 29, 42, 0.75);
    
    --accent-red: #e50914;
    --accent-red-glow: rgba(229, 9, 20, 0.4);
    --accent-gold: #ffb703;
    --accent-cyan: #00f2fe;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(229, 9, 20, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 25px rgba(229, 9, 20, 0.25);
    
    --font-heading: 'Outfit', 'Noto Sans KR', sans-serif;
    --font-body: 'Noto Sans KR', sans-serif;
}

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

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

/* Header & Navigation */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--accent-red), #b91c1c);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
    font-size: 1.5rem;
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

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

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-box {
    position: relative;
    width: 280px;
    transition: all 0.3s ease;
}

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

.search-box input:focus {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--accent-red);
    box-shadow: 0 0 15px var(--accent-red-glow);
    width: 340px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.icon-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-btn:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    box-shadow: var(--shadow-glow);
}

/* Hero Banner */
.hero-banner {
    position: relative;
    width: 100%;
    height: 480px;
    background-size: cover;
    background-position: center top;
    display: flex;
    align-items: flex-end;
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
    transition: background-image 0.6s ease;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--bg-primary) 0%, rgba(10, 12, 16, 0.65) 50%, rgba(10, 12, 16, 0.2) 100%);
}

.hero-content {
    position: relative;
    z-index: 10;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    width: 100%;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--accent-red);
    color: #fff;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 0.8rem;
    text-shadow: 0 4px 15px rgba(0,0,0,0.8);
}

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

.rating-badge {
    color: var(--accent-gold);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

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

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

.btn-hero {
    background: linear-gradient(135deg, var(--accent-red), #b91c1c);
    color: #fff;
    border: none;
    padding: 0.8rem 1.8rem;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: var(--shadow-glow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px rgba(229, 9, 20, 0.6);
}

/* Category Tabs & Filter Bar */
.main-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 2rem;
}

.category-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.tabs-group {
    display: flex;
    gap: 0.5rem;
}

.tab-btn {
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 0.65rem 1.2rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

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

/* Genre Pills Scrollbar */
.genre-pills {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.6rem;
    margin-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-red) transparent;
}

.genre-pill {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.45rem 1rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.genre-pill:hover, .genre-pill.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
    font-weight: 700;
}

/* Movie Grid */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.movies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.8rem;
    margin-bottom: 3rem;
}

/* Movie Card */
.movie-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    flex-direction: column;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    border-color: var(--border-glow);
}

.poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: var(--bg-secondary);
}

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

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

.card-badges {
    position: absolute;
    top: 0.6rem;
    left: 0.6rem;
    right: 0.6rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
}

.badge-rating {
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 183, 3, 0.4);
    color: var(--accent-gold);
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
}

.btn-bookmark {
    background: rgba(10, 12, 16, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-color);
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-bookmark.bookmarked {
    background: var(--accent-red);
    color: #fff;
    border-color: var(--accent-red);
}

.card-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-release {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.card-genres {
    display: flex;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-top: auto;
}

.tag-mini {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    font-size: 0.72rem;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.9);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    z-index: 20;
    background: rgba(10, 12, 16, 0.8);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: var(--accent-red);
}

.modal-header-bg {
    position: relative;
    height: 280px;
    background-size: cover;
    background-position: center;
}

.modal-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--bg-secondary) 0%, rgba(18, 22, 32, 0.4) 100%);
}

.modal-body {
    padding: 2rem;
    margin-top: -80px;
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
}

.modal-poster {
    width: 200px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border: 2px solid var(--border-color);
}

.modal-details {
    display: flex;
    flex-direction: column;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    line-height: 1.2;
}

.modal-orig-title {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.modal-tags-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
}

.modal-overview {
    font-size: 0.98rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.trailer-container {
    margin-top: 1.5rem;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--border-color);
}

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

/* Footer */
.app-footer {
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 3rem;
}

/* Responsive Breakpoints */
@media (max-width: 768px) {
    .navbar {
        padding: 0.8rem 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    .search-box {
        width: 100%;
    }
    .search-box input:focus {
        width: 100%;
    }
    .hero-banner {
        height: 360px;
    }
    .hero-title {
        font-size: 1.8rem;
    }
    .modal-body {
        grid-template-columns: 1fr;
        margin-top: -40px;
    }
    .modal-poster {
        width: 140px;
        margin: 0 auto;
    }
}
