@import url('https://fonts.googleapis.com/css2?family=Niramit:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,600&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
    --bg-zinc-950: #09090b;
    --bg-zinc-900: #18181b;
    --bg-zinc-800: #27272a;
    --bg-zinc-700: #3f3f46;
    
    --red-500: #ef4444;
    --red-600: #dc2626;
    --red-gradient: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    --red-glow: rgba(239, 68, 68, 0.25);
    
    --text-white: #ffffff;
    --text-zinc-300: #d4d4d8;
    --text-zinc-400: #a1a1aa;
    --text-zinc-500: #71717a;
    
    --border-white-5: rgba(255, 255, 255, 0.05);
    --border-white-10: rgba(255, 255, 255, 0.1);
    
    --font-family: 'Niramit', 'Plus Jakarta Sans', -apple-system, sans-serif;
}

/* Global Reset & Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-zinc-950);
    color: var(--text-white);
    font-family: var(--font-family);
    font-size: 15px;
    line-height: 1.5;
    overflow-x: hidden;
    padding-bottom: 75px; /* for mobile bottom nav */
    -webkit-overflow-scrolling: touch;
}

/* GPU Hardware Acceleration for 60fps Smooth Transitions */
.drama-card, .card-thumb, .hero-card, .cat-tab, .btn-play-hero, .platform-trigger {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .container {
        padding: 0 32px;
    }
}

/* Fixed Header Bar */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(9, 9, 11, 0.9);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-white-5);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

@media (min-width: 768px) {
    .header-inner {
        padding: 0 32px;
    }
}

.logo-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: var(--red-gradient);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 4px 12px var(--red-glow);
}

.logo-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(180deg, #ffffff 0%, #a1a1aa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Desktop Nav Links */
.desktop-nav {
    display: none;
    align-items: center;
    gap: 4px;
}

@media (min-width: 768px) {
    .desktop-nav {
        display: flex;
    }
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-zinc-400);
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: #fff;
    background: var(--border-white-5);
}

.nav-link.active {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* Platform Switcher Dropdown */
.platform-dropdown {
    position: relative;
}

.platform-trigger {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: rgba(24, 24, 27, 0.8);
    border: 1px solid var(--border-white-10);
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-zinc-300);
    cursor: pointer;
    transition: all 0.2s ease;
}

.platform-trigger:hover {
    background: var(--bg-zinc-800);
    color: #fff;
}

.platform-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    width: 240px;
    background: rgba(24, 24, 27, 0.96);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-white-10);
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8);
    z-index: 1050;
    display: none;
}

.platform-menu.show {
    display: block;
}

.platform-menu-header {
    padding: 6px 10px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-zinc-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-white-5);
    margin-bottom: 4px;
}

.platform-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    color: var(--text-zinc-300);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.platform-option:hover {
    background: var(--border-white-5);
    color: #fff;
}

.platform-option.active {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    font-weight: 700;
}

.badge-tag {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--bg-zinc-800);
    color: var(--text-zinc-400);
}

/* Mobile Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(9, 9, 11, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--border-white-5);
    z-index: 1000;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
}

@media (min-width: 768px) {
    .bottom-nav {
        display: none;
    }
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 6px 12px;
    border-radius: 12px;
    color: var(--text-zinc-500);
    font-size: 10px;
    font-weight: 500;
}

.bottom-nav-item.active {
    color: #f87171;
}

.bottom-nav-item.active .icon-box {
    background: rgba(239, 68, 68, 0.15);
}

.icon-box {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 18px;
}

/* Main Content Padding Top for Fixed Header */
.main-wrapper {
    padding-top: 80px;
}

/* Featured Hero Banner 2026 Redesign */
.hero-card {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 20px;
    overflow: hidden;
    background-size: cover;
    background-position: center top;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8), 0 0 0 1px var(--border-white-10);
    display: flex;
    align-items: flex-end;
    margin-bottom: 35px;
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1), box-shadow 0.4s ease;
}

@media (min-width: 768px) {
    .hero-card {
        aspect-ratio: 21/9;
        border-radius: 28px;
    }
}

.hero-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.9), 0 0 30px rgba(239, 68, 68, 0.2);
}

.hero-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, var(--bg-zinc-950) 5%, rgba(9, 9, 11, 0.75) 45%, transparent 100%),
                linear-gradient(90deg, var(--bg-zinc-950) 5%, rgba(9, 9, 11, 0.7) 40%, transparent 80%),
                radial-gradient(circle at top right, rgba(239, 68, 68, 0.15), transparent 60%);
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 24px;
    max-width: 720px;
}

@media (min-width: 768px) {
    .hero-content {
        padding: 44px;
    }
}

.hero-chips {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.chip-red {
    background: var(--red-gradient);
    color: #fff;
    font-size: 11.5px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 20px;
    box-shadow: 0 4px 15px var(--red-glow);
}

.chip-glass {
    background: rgba(24, 24, 27, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-white-10);
    color: var(--text-zinc-300);
    font-size: 11.5px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 20px;
}

.hero-title {
    font-size: 24px;
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 12px;
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.9);
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 38px;
    }
}

.hero-desc {
    font-size: 14px;
    color: var(--text-zinc-300);
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 600px;
}

.btn-play-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red-gradient);
    color: #ffffff;
    padding: 12px 26px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 14.5px;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.45);
    transition: all 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.btn-play-hero:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 12px 35px rgba(239, 68, 68, 0.65);
    color: #ffffff;
}

.btn-detail-hero {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-white-10);
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.25s ease;
}

.btn-detail-hero:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Category & Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 28px 0 16px 0;
}

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

.indicator-bar {
    width: 4px;
    height: 20px;
    background: var(--red-500);
    border-radius: 10px;
}

/* Grid & Drama Cards */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (min-width: 640px) {
    .drama-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

@media (min-width: 768px) {
    .drama-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 1024px) {
    .drama-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

.drama-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    background: var(--bg-zinc-900);
    border: 1px solid var(--border-white-5);
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
}

.drama-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-white-10);
}

.card-thumb-outer {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    background: #000;
}

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

.drama-card:hover .card-thumb {
    transform: scale(1.08);
}

.hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease;
}

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

.play-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
}

.card-body {
    padding: 10px;
}

.card-name {
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text-white);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.card-sub {
    font-size: 11px;
    color: var(--text-zinc-500);
    margin-top: 4px;
}

/* Category Tabs */
.category-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 20px;
    scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
    display: none;
}

.cat-tab {
    padding: 8px 18px;
    border-radius: 20px;
    background: rgba(39, 39, 42, 0.8);
    border: 1px solid var(--border-white-5);
    color: var(--text-zinc-400);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cat-tab:hover {
    background: var(--bg-zinc-700);
    color: #fff;
}

.cat-tab.active {
    background: var(--red-gradient);
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 4px 15px var(--red-glow);
}

/* Rank Cards Layout */
.top-3-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (min-width: 768px) {
    .top-3-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.rank-card-featured {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(24, 24, 27, 0.5);
    border: 1px solid var(--border-white-5);
    transition: all 0.3s ease;
}

.rank-card-featured:hover {
    border-color: rgba(239, 68, 68, 0.3);
}

.rank-badge-num {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
}

.rank-1 { background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%); }
.rank-2 { background: linear-gradient(135deg, #9ca3af 0%, #4b5563 100%); }
.rank-3 { background: linear-gradient(135deg, #d97706 0%, #78350f 100%); }

/* Watch Page 2-Column Layout & Stable Viewport Sizing */
.watch-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.watch-player-outer {
    width: 100%;
    display: flex;
    justify-content: center;
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-white-10);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
    height: calc(100vh - 160px);
    max-height: 800px;
    min-height: 480px;
}

.watch-video-wrapper {
    height: 100%;
    aspect-ratio: 9/16;
    max-width: 100%;
    position: relative;
}

.watch-video-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Prevent Video Zoom/Crop in Fullscreen Mode */
video:fullscreen,
video:-webkit-full-screen,
video:-moz-full-screen,
video:-ms-fullscreen,
:fullscreen video,
:-webkit-full-screen video {
    object-fit: contain !important;
    background: #000 !important;
    width: 100vw !important;
    height: 100vh !important;
}

@media (min-width: 1024px) {
    .watch-layout {
        grid-template-columns: 460px 1fr;
        align-items: start;
    }

    .watch-player-col {
        position: sticky;
        top: 76px;
    }

    .watch-info-col {
        height: calc(100vh - 100px);
        overflow-y: auto;
        padding-right: 6px;
        scrollbar-width: thin;
        scrollbar-color: var(--bg-zinc-700) transparent;
    }
}

/* Mobile Responsive Optimization (< 768px) */
@media (max-width: 767px) {
    .watch-player-outer {
        height: auto;
        min-height: 380px;
        max-height: 70vh;
        border-radius: 16px;
    }

    .watch-video-wrapper {
        width: 100%;
        max-width: 340px;
        aspect-ratio: 9/16;
    }

    .drama-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .hero-title {
        font-size: 20px;
    }

    .hero-desc {
        font-size: 12.5px;
        -webkit-line-clamp: 2;
    }
}

/* Shimmer Skeleton Loading Effect */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.skeleton {
    background: linear-gradient(90deg, rgba(39, 39, 42, 0.6) 25%, rgba(63, 63, 70, 0.8) 37%, rgba(39, 39, 42, 0.6) 63%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease infinite;
    border-radius: 12px;
}

/* Floating Random Button */
.btn-random-floating {
    position: fixed;
    bottom: 85px;
    left: 20px;
    background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 13.5px;
    box-shadow: 0 10px 25px rgba(239, 68, 68, 0.4);
    z-index: 995;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

.btn-random-floating:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 14px 30px rgba(239, 68, 68, 0.6);
}

/* Player Container */
.player-container {
    max-width: 1050px;
    margin: 0 auto;
    background: var(--bg-zinc-900);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--border-white-10);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}
