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

:root {
    --bg-color: #0a0a0e;
    --bg-secondary: #111116;
    --bg-tertiary: #18181f;
    --card-bg: #1a1a22;
    --card-bg-hover: #222230;
    --text-primary: #e8e8ec;
    --text-secondary: #9a9aaa;
    --text-muted: #6b6b7b;
    --accent: #e50914;
    --accent-hover: #ff1a26;
    --accent-glow: rgba(229, 9, 20, 0.3);
    --accent-soft: rgba(229, 9, 20, 0.12);
    --border-color: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.14);
    --nav-height: 56px;
    --gradient-accent: linear-gradient(135deg, #e50914, #ff4d58);
    --gradient-dark: linear-gradient(180deg, rgba(10, 10, 14, 0) 0%, rgba(10, 10, 14, 0.95) 100%);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.6);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: 'Noto Sans KR', system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ========== Top Navigation Bar ========== */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(10, 10, 14, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    justify-content: space-between;
}

.nav-logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.nav-logo img {
    height: 60px;
}

.nav-logo span {
    font-size: 22px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: 30px;
    flex: 1;
    justify-content: center;
}

.nav-menu a {
    padding: 8px 18px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-menu a:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
}

.nav-menu a.active {
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.nav-search-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.nav-search-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* Search Modal */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 200;
    backdrop-filter: blur(8px);
    align-items: flex-start;
    justify-content: center;
    padding-top: 120px;
}

.search-overlay.active {
    display: flex;
}

.search-box {
    width: 90%;
    max-width: 600px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    padding: 6px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    box-shadow: var(--shadow-lg);
}

.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 18px;
    padding: 14px 16px;
    outline: none;
    font-family: inherit;
}

.search-box button {
    background: var(--accent);
    border: none;
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 6px;
}

.mobile-menu-btn svg {
    width: 26px;
    height: 26px;
}

.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    z-index: 150;
}

.mobile-menu-overlay.active {
    display: block;
}

.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    z-index: 160;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding: 20px;
    overflow-y: auto;
}

.mobile-menu.open {
    transform: translateX(0);
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.mobile-menu a {
    display: block;
    padding: 14px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.mobile-menu a:hover,
.mobile-menu a.active {
    color: #fff;
    background: var(--accent-soft);
}

.mobile-menu a.active {
    color: var(--accent);
    font-weight: 700;
}

/* ========== Main Container ========== */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 20px) 20px 40px;
}

/* ========== Section ========== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 0 2px;
}

.section-title {
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 22px;
    background: var(--accent);
    border-radius: 2px;
}

.section-more {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color var(--transition-fast);
}

.section-more:hover {
    color: var(--accent);
}

/* ========== Ranking Tabs ========== */
.ranking-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 32px;
}

.ranking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.ranking-tab {
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.ranking-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.ranking-tab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.ranking-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.ranking-item {
    position: relative;
}

.ranking-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ranking-item:nth-child(1) .ranking-badge {
    background: var(--accent);
    border-color: var(--accent);
}

.ranking-item:nth-child(2) .ranking-badge {
    background: #f59e0b;
    border-color: #f59e0b;
}

.ranking-item:nth-child(3) .ranking-badge {
    background: #8b5cf6;
    border-color: #8b5cf6;
}

/* ========== Video Grid (5 columns) ========== */
.video-grid-5 {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin-bottom: 36px;
}

/* ========== Video Grid (list) ========== */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}

/* ========== Video Card ========== */
.video-card {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    /* border: 1px solid var(--border-color); */
    cursor: pointer;
}

.video-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-hover);
}

.video-card:hover .video-thumb-wrap::after {
    opacity: 1;
}

.video-card:hover .video-thumb-wrap img {
    transform: scale(1.05);
}

.video-thumb-wrap {
    position: relative;
    aspect-ratio: 16/9;
    background: #000;
    overflow: hidden;
}

.video-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.video-thumb-wrap::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44px;
    height: 44px;
    background: rgba(229, 9, 20, 0.85);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
    opacity: 0;
    transition: opacity var(--transition-fast);
    text-indent: 2px;
    line-height: 44px;
    text-align: center;
}

.watched-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #10b981;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.highlight-clicked .video-thumb-wrap {
    border: 3px solid #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}

.thumb-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: linear-gradient(135deg, rgba(229, 9, 20, 0.9), rgba(180, 0, 50, 0.9));
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.thumb-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 2;
}

.video-meta {
    padding: 10px 12px;
}

.video-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.video-info {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
}

/* ========== Sort Bar ========== */
.sort-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    align-items: center;
}

.sort-btn {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    text-decoration: none;
    transition: all var(--transition-fast);
    border: 1px solid var(--border-color);
}

.sort-btn:hover {
    color: #fff;
    border-color: var(--border-hover);
}

.sort-btn.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ========== Pagination ========== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.pagination a {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.pagination a:hover {
    background: var(--card-bg-hover);
    color: #fff;
}

.pagination .current {
    background: var(--accent);
    color: #fff;
}

/* ========== Video Player Page ========== */
.player-container {
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

.player-container iframe,
.player-container video {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    display: block;
}

.video-details {
    background: var(--card-bg);
    padding: 20px;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.video-details h1 {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.video-page-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
}

.video-main-col {
    min-width: 0;
}

/* Popular sidebar */
.popular-sidebar {
    position: sticky;
    top: calc(var(--nav-height) + 20px);
    max-height: calc(100vh - var(--nav-height) - 40px);
    overflow-y: auto;
}

.popular-sidebar::-webkit-scrollbar {
    width: 3px;
}

.popular-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar-section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.popular-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popular-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    transition: all var(--transition-fast);
}

.popular-item:hover {
    background: var(--card-bg-hover);
    transform: translateX(2px);
}

.popular-rank {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-muted);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.popular-item:nth-child(1) .popular-rank {
    background: var(--accent);
    color: #fff;
}

.popular-item:nth-child(2) .popular-rank {
    background: #f59e0b;
    color: #fff;
}

.popular-item:nth-child(3) .popular-rank {
    background: #8b5cf6;
    color: #fff;
}

.popular-thumb {
    flex-shrink: 0;
    width: 90px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}

.popular-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-info {
    flex: 1;
    min-width: 0;
}

.popular-title {
    font-size: 12px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* Related grid */
.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
}

/* ========== Footer ========== */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 30px 20px;
    margin-top: 40px;
}

.footer-inner {
    max-width: 1400px;
    margin: 0 auto;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.7;
}

.footer-links {
    display: flex;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

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

.footer-disclaimer {
    max-width: 800px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.footer-copyright {
    border-top: 1px solid var(--border-color);
    padding-top: 16px;
    margin-top: 16px;
}

/* ========== Contact Form ========== */
.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.contact-form textarea,
.contact-form input[type="text"] {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 15px;
    padding: 12px 16px;
    outline: none;
    font-family: inherit;
    transition: border-color var(--transition-fast);
}

.contact-form textarea:focus,
.contact-form input[type="text"]:focus {
    border-color: var(--accent);
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

.contact-form .submit-btn {
    background: var(--gradient-accent);
    color: #fff;
    border: none;
    padding: 12px 32px;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.contact-form .submit-btn:hover {
    box-shadow: 0 4px 20px var(--accent-glow);
    transform: translateY(-1px);
}

.msg-alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-weight: 600;
    background: var(--accent-soft);
    color: var(--accent);
    border: 1px solid var(--accent);
}

/* ========== Admin ========== */
.admin-container {
    max-width: 900px;
    margin: 60px auto;
    padding: 20px;
}

.admin-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 24px;
    margin-bottom: 20px;
}

.admin-card h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th,
.admin-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.admin-table th {
    color: var(--text-secondary);
    font-weight: 600;
}

.admin-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.admin-btn-danger {
    background: var(--accent);
    color: #fff;
}

.admin-btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.admin-login-form {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
}

.admin-login-form h1 {
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 30px;
    color: var(--accent);
}

.admin-login-form input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 15px;
    margin-bottom: 16px;
    outline: none;
    font-family: inherit;
}

.admin-login-form button {
    width: 100%;
    padding: 12px;
    background: var(--gradient-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

/* ========== Responsive ========== */
@media (max-width: 1200px) {
    .video-page-layout {
        grid-template-columns: 1fr;
    }

    .popular-sidebar {
        position: static;
        max-height: none;
    }

    .ranking-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .video-grid-5 {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 900px) {
    .nav-menu {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

    .ranking-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .video-grid-5 {
        grid-template-columns: repeat(3, 1fr);
    }

    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 10px;
    }
}

@media (max-width: 600px) {
    .ranking-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .video-grid-5 {
        grid-template-columns: repeat(2, 1fr);
    }

    .ranking-section {
        padding: 16px;
    }

    .video-details h1 {
        font-size: 16px;
    }

    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: 16px;
    }
}

/* Honeypot */
.hp-field {
    position: absolute;
    left: -9999px;
}