/* 넷플릭스 스타일 다크 테마 변수 설정 */
:root {
    --bg-color: #141414;
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-muted: #a3a3a3;
    --primary-color: #e50914; /* 넷플릭스 레드 */
    --hover-color: #f40612;
    --modal-bg: #181818;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 20px 4%;
    display: flex;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    z-index: 100;
    transition: background-color 0.4s;
}
.header.scrolled {
    background-color: var(--bg-color);
}
.logo {
    font-size: 24px;
    font-weight: 900;
    margin-right: 40px;
    letter-spacing: -1px;
}
.logo-red {
    color: var(--primary-color);
}
.nav {
    display: flex;
    gap: 20px;
}
.nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
}
.nav a:hover, .nav a.active {
    color: var(--text-primary);
    font-weight: 600;
}
.header-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 20px;
}
.search-icon {
    font-size: 18px;
    cursor: pointer;
}
.user-profile {
    width: 32px;
    height: 32px;
    background-color: #333;
    border-radius: 4px;
}

/* Hero Section */
.hero {
    position: relative;
    height: 80vh;
    min-height: 500px;
    display: flex;
    align-items: center;
    padding: 0 4%;
    overflow: hidden;
}
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; /* 클릭 방지 */
}
.hero-bg iframe {
    width: 100vw;
    height: 56.25vw; /* 16:9 비율 유지 */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 비율 유지 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, rgba(20,20,20,0.8) 0%, rgba(20,20,20,0.3) 50%, rgba(20,20,20,0) 100%),
                linear-gradient(to top, rgba(20,20,20,1) 0%, rgba(20,20,20,0) 20%);
    z-index: 2;
}
.hero-content {
    position: relative;
    z-index: 3;
    max-width: 500px;
    margin-top: 50px;
}
.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    line-height: 1.2;
}
.hero-desc {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.hero-buttons button {
    padding: 10px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}
.btn-play {
    background-color: white;
    color: black;
    margin-right: 15px;
}
.btn-play:hover {
    background-color: rgba(255,255,255,0.7);
}
.btn-info {
    background-color: rgba(109, 109, 110, 0.7);
    color: white;
}
.btn-info:hover {
    background-color: rgba(109, 109, 110, 0.4);
}

/* AdMob Placeholder */
.ad-container {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 20px 4%;
}
.admob-placeholder {
    width: 100%;
    max-width: 970px;
    min-height: 90px;
    background-color: #222;
    border: 2px dashed #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-muted);
}
.admob-placeholder span {
    font-weight: bold;
    font-size: 14px;
}
.admob-placeholder small {
    font-weight: normal;
    display: block;
    margin-top: 5px;
}
.infeed-ad {
    margin: 30px 0;
}

/* Main Content (Sliders) */
.main-content {
    padding: 0 0 50px 0;
    margin-top: -50px;
    position: relative;
    z-index: 10;
}
.slider-section {
    margin-bottom: 40px;
    position: relative;
}
.section-title {
    font-size: 1.4vw;
    font-weight: 700;
    margin-bottom: 15px;
    padding: 0 4%;
    color: var(--text-secondary);
}
@media (max-width: 768px) {
    .section-title { font-size: 18px; }
}

.slider-wrapper {
    position: relative;
    padding: 0 4%;
}
.slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    /* Hide scrollbar */
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.slider::-webkit-scrollbar {
    display: none;
}
.card {
    flex: 0 0 20%;
    min-width: 200px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.card:hover {
    transform: scale(1.05);
    z-index: 2;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8);
}
.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 16/9;
    display: block;
}
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 20px 10px 10px;
    opacity: 0;
    transition: opacity 0.3s;
}
.card:hover .card-overlay {
    opacity: 1;
}
.card-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-meta {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: bold;
}

/* Shorts Slider (Vertical aspect ratio) */
.shorts-wrapper .card {
    flex: 0 0 15%;
    min-width: 150px;
}
.shorts-wrapper .card img {
    aspect-ratio: 9/16;
}

/* Slider Buttons */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    width: 4%;
    height: 100%;
    font-size: 24px;
    cursor: pointer;
    z-index: 5;
    opacity: 0;
    transition: var(--transition);
}
.slider-wrapper:hover .slider-btn {
    opacity: 1;
}
.slider-btn:hover {
    background: rgba(0,0,0,0.8);
}
.slider-btn.left { left: 0; border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.slider-btn.right { right: 0; border-top-left-radius: 4px; border-bottom-left-radius: 4px; }


/* Modal */
.video-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.video-modal.active {
    opacity: 1;
    pointer-events: auto;
}
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay-bg);
}
.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    background-color: var(--modal-bg);
    border-radius: 12px;
    overflow-y: auto;
    max-height: 90vh;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5);
    z-index: 1001;
    animation: modalPop 0.3s ease-out;
}
@keyframes modalPop {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #181818;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.modal-close:hover {
    background: #333;
}
.modal-video-container {
    width: 100%;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
}
.modal-video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}
.modal-info {
    padding: 30px 40px;
}
.modal-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 15px;
}
.modal-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}
.match-score { color: #46d369; font-weight: bold; }
.badge { border: 1px solid rgba(255,255,255,0.4); padding: 1px 4px; border-radius: 3px; font-size: 12px; }
.modal-desc {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 30px;
}
.modal-seo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
}
.modal-seo-tags span {
    background: #333;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: #ccc;
}

/* Footer */
.footer {
    padding: 40px 4%;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 50px;
}
.footer-links {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 20px;
}
.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}
.footer-links a:hover {
    text-decoration: underline;
}


/* =========================================================================
   모바일 최적화 (Mobile Optimization)
   ========================================================================= */
@media (max-width: 768px) {
    .hero {
        min-height: 400px;
        height: 60vh;
        padding-top: 60px; /* 헤더 겹침 방지 */
    }
    .hero-content {
        margin-top: 20px;
        max-width: 100%;
        padding-right: 15px;
    }
    .hero-title {
        font-size: 1.8rem !important; /* 엄청나게 큰 텍스트 축소 */
        line-height: 1.3;
        margin-bottom: 10px;
        text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
    }
    .hero-desc {
        font-size: 0.95rem;
        -webkit-line-clamp: 2; /* 2줄까지만 표시 */
        margin-bottom: 15px;
    }
    .hero-buttons button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
    .btn-play {
        margin-right: 10px;
    }

    /* 팝콘각 겹치는 현상 방지 */
    .section-title {
        font-size: 1.2rem;
        margin-top: 20px;
        margin-bottom: 10px;
    }
    .main-content {
        margin-top: -20px; /* 겹침 줄임 */
    }

    /* 광고 여백 정리 */
    .ad-container {
        padding: 10px 4%;
    }
    .admob-placeholder {
        min-height: 60px;
        margin-bottom: 10px;
    }
    .infeed-ad {
        margin: 15px 0;
    }

    /* 미드폼 (숏츠) 가로 비율 (16:9) 적용 */
    .shorts-wrapper .card img {
        aspect-ratio: 16/9 !important;
    }
    .shorts-wrapper .card {
        flex: 0 0 45%; /* 모바일에서 여러개 보이게 */
        min-width: 140px;
    }
    .card {
        flex: 0 0 70%;
        min-width: 160px;
    }
}
