/* Import Material Icons */
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000;
    color: #fff;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: 80px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

/* Top Navigation */
.top-nav {
    position: relative;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.2rem;
    font-weight: 700;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-selector:hover {
    background: rgba(255, 255, 255, 0.15);
}

.upgrade-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    color: #fff;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
}

/* Main Content */
.main-content {
    padding: 20px 0;
}

/* Section */
.drama-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    margin-bottom: 20px;
}

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

.section-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #EC4899 0%, #2563eb 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-all {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.view-all:hover {
    color: #fff;
}

/* Horizontal Scroll Container */
.drama-scroll {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 20px 20px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.drama-scroll::-webkit-scrollbar {
    height: 6px;
}

.drama-scroll::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.drama-scroll::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.5);
    border-radius: 3px;
}

.drama-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.8);
}

/* Drama Card */
.drama-card {
    flex: 0 0 auto;
    width: 160px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.drama-card:hover {
    transform: translateY(-8px);
}

.drama-card-poster {
    position: relative;
    width: 160px;
    height: 240px;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
}

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

.drama-card:hover .drama-card-poster img {
    transform: scale(1.05);
}

/* Corner Badge */
.corner-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 4px;
}

.corner-badge.popular {
    background: rgba(236, 72, 153, 0.9);
}

.corner-badge.new {
    background: rgba(77, 101, 237, 0.9);
}

/* Card Overlay Info */
.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, transparent 100%);
    padding: 50px 12px 12px;
}

.card-overlay-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-overlay-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 3px;
}

/* Drama Info (below card) */
.drama-card-info {
    padding: 10px 0;
}

.drama-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 0 12px;
    z-index: 1000;
}

.bottom-nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    height: 64px;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Changed from center to align top */
    gap: 2px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 6px 0;
    /* Adjusted padding */
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
    height: 100%;
    /* Fill container */
}

.nav-icon-wrapper {
    /* Removed large padding */
    padding: 0;
    border-radius: 9999px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}

.nav-item:hover .nav-icon-wrapper {
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active .nav-icon-wrapper {
    background: rgba(37, 99, 235, 0.2);
}

.nav-item.active {
    color: #2563eb;
}

.nav-item:hover {
    color: rgba(255, 255, 255, 0.8);
}

.nav-icon {
    font-size: 24px;
    /* Material Icons use font-size, not width/height */
    transition: all 0.2s ease;
}

.nav-label {
    font-size: 0.7rem;
    /* Default size */
    font-weight: 500;
    transition: all 0.2s ease;
    text-align: center;
    line-height: 1.1;
    white-space: nowrap;
    /* Prevent wrapping by default */
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.6);
}

.loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    margin-left: 15px;
    border: 4px solid rgba(37, 99, 235, 0.3);
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error State */
.error-message {
    text-align: center;
    padding: 60px 20px;
    color: #EC4899;
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .drama-card {
        width: 140px;
    }

    .drama-card-poster {
        width: 140px;
        height: 210px;
    }

    .section-title {
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .drama-card {
        width: 120px;
    }

    .drama-card-poster {
        width: 120px;
        height: 180px;
    }

    .nav-logo {
        font-size: 1rem;
    }

    .upgrade-btn {
        padding: 6px 16px;
        font-size: 0.85rem;
    }

    /* Mobile Nav Adjustments */
    .bottom-nav-items {
        height: 60px;
        /* Force height */
    }

    .nav-label {
        font-size: 0.6rem;
        /* Smaller font on very small screens */
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-icon-wrapper {
        width: 28px;
        height: 28px;
    }

    .nav-icon {
        font-size: 22px;
        /* Slightly smaller on mobile */
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection */
::selection {
    background: rgba(37, 99, 235, 0.5);
    color: #fff;
}

/* ========================================
   HERO FEATURED SECTION
   ======================================== */
.hero-section {
    position: relative;
    height: 400px;
    margin: 0 0 30px;
    overflow: hidden;
    border-radius: 0 0 16px 16px;
}

.hero-background {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hero-background img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-gradient {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.2) 100%);
}

.hero-content {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 24px;
    max-width: 600px;
}

.hero-badges {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.badge-featured {
    background: #2563eb;
    color: #fff;
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #EF4444;
}

.hero-genre {
    margin-bottom: 12px;
}

.genre-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    padding: 4px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

.hero-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-description {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.btn-play,
.btn-add {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.btn-play {
    background: #2563eb;
    color: #fff;
}

.btn-play:hover {
    background: #1d4ed8;
}

.btn-play:active {
    transform: scale(0.95);
}

.btn-add {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    color: #fff;
}

.btn-add:hover {
    background: rgba(255, 255, 255, 0.3);
}

.btn-add:active {
    transform: scale(0.95);
}

.icon-play,
.icon-add {
    width: 18px;
    height: 18px;
}

/* ========================================
   PLATFORM FILTER SECTION
   ======================================== */
.platform-filter-section {
    padding: 0 20px;
    margin-bottom: 30px;
}

.filter-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.platform-filters {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.platform-filters::-webkit-scrollbar {
    height: 4px;
}

.platform-filters::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.platform-filters::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.5);
    border-radius: 2px;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 30, 30, 0.8);
    color: rgba(255, 255, 255, 0.8);
    min-height: 40px;
}

.filter-btn:hover {
    background: rgba(50, 50, 50, 0.9);
}

.filter-btn:active {
    transform: scale(0.95);
}

.filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* ========================================
   UPDATED SECTION HEADERS
   ======================================== */
.section-title-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.platform-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.indicator-bar {
    width: 6px;
    height: 24px;
    border-radius: 3px;
}

.indicator-text {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

.icon-chevron {
    width: 14px;
    height: 14px;
    margin-left: 4px;
}

/* ========================================
   UPDATED DRAMA CARDS
   ======================================== */
.platform-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    padding: 4px 8px;
    border-radius: 9999px;
    z-index: 2;
}

.platform-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #EF4444;
}

.platform-text {
    font-size: 0.75rem;
    font-weight: 500;
    color: #fff;
}

.episode-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #fff;
    z-index: 2;
}

.corner-badge.hot {
    background: #EF4444;
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
}

.corner-badge.new {
    background: #22C55E;
    position: absolute;
    top: 8px;
    right: 8px;
    left: auto;
}

.play-icon {
    width: 48px;
    height: 48px;
    color: #fff;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

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

.drama-card-desc {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */
@media (max-width: 768px) {
    .hero-section {
        height: 350px;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .hero-description {
        font-size: 0.8125rem;
    }

    .btn-play,
    .btn-add {
        padding: 10px 20px;
        font-size: 0.8125rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        height: 300px;
    }

    .hero-content {
        padding: 16px;
    }

    .hero-title {
        font-size: 1.125rem;
    }

    .hero-description {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }

    .hero-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-play,
    .btn-add {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }

    .filter-title {
        font-size: 1rem;
    }
}

/* ========================================
   SEARCH/DISCOVER PAGE
   ======================================== */
.search-page {
    padding: 20px;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Search Section */
.search-section {
    margin-bottom: 24px;
}

.search-form {
    position: relative;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 16px;
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.6);
    pointer-events: none;
}

.search-input {
    width: 100%;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.5);
    padding: 12px 180px 12px 48px;
    font-size: 0.875rem;
    color: #fff;
    outline: none;
    transition: all 0.2s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.search-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.search-submit-btn {
    position: absolute;
    right: 8px;
    border-radius: 9999px;
    background: #2563eb;
    color: #fff;
    padding: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-submit-btn:hover {
    background: #1d4ed8;
}

.search-submit-btn:active {
    transform: scale(0.95);
}

.search-submit-icon {
    width: 18px;
    height: 18px;
}

/* Discover Filter Section */
.discover-filter-section {
    margin-bottom: 32px;
}

.filter-section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 12px;
}

.discover-filters {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.discover-filters::-webkit-scrollbar {
    height: 4px;
}

.discover-filters::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.discover-filters::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.5);
    border-radius: 2px;
}

.discover-filter-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(30, 30, 30, 0.8);
    color: rgba(255, 255, 255, 0.8);
    min-height: 40px;
}

.discover-filter-btn:hover {
    background: rgba(50, 50, 50, 0.9);
}

.discover-filter-btn:active {
    transform: scale(0.95);
}

.discover-filter-btn.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

/* Search Results */
.search-results {
    margin-bottom: 20px;
}

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

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    color: rgba(255, 255, 255, 0.3);
}

.empty-text {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

/* Responsive for Search Page */
@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.25rem;
    }

    .search-input {
        padding: 10px 52px 10px 44px;
        font-size: 0.8125rem;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }
}

/* ========================================
   DRAMA GRID LAYOUT (Vertical Scrolling)
   ======================================== */
.page-header {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0;
    line-height: 1;
}

.page-subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

.drama-grid-section {
    padding: 0 20px 40px;
}

.drama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.drama-grid-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.drama-grid-card:hover {
    transform: translateY(-8px);
}

.card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.drama-grid-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, #1f1f1f 0%, #2a2a2a 100%);
    margin-bottom: 12px;
}

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

.drama-grid-card:hover .drama-grid-poster img {
    transform: scale(1.05);
}

.drama-grid-info {
    padding: 0 4px;
}

.drama-grid-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.drama-grid-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.play-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.meta-icon {
    width: 14px;
    height: 14px;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px 0;
}

.pagination-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 9999px;
    color: #2563eb;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.pagination-btn:hover {
    background: rgba(37, 99, 235, 0.2);
    border-color: rgba(37, 99, 235, 0.5);
    transform: translateY(-2px);
}

.pagination-btn svg {
    width: 16px;
    height: 16px;
}

.pagination-info {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
}

/* Responsive Grid */
@media (max-width: 768px) {
    .drama-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 16px;
    }

    .page-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .drama-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .page-title {
        font-size: 1.3rem;
    }

    .drama-grid-title {
        font-size: 0.85rem;
    }
}

/* ========================================
   DETAIL PAGE STYLES
   ======================================== */
.detail-page {
    padding-bottom: 100px;
}

.breadcrumb {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    flex-wrap: wrap;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.6);
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: #2563eb;
}

.breadcrumb .separator {
    color: rgba(255, 255, 255, 0.3);
}

.breadcrumb .current {
    color: #fff;
}

.detail-header {
    display: flex;
    gap: 24px;
    padding: 0 20px 32px;
    flex-wrap: wrap;
}

.detail-poster {
    position: relative;
    flex-shrink: 0;
    width: 200px;
}

.detail-poster img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.platform-badge-large {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    padding: 6px 12px;
    border-radius: 9999px;
}

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

.detail-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.detail-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.detail-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.detail-meta .meta-icon {
    width: 18px;
    height: 18px;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tag {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 9999px;
    font-size: 0.8rem;
    color: #60a5fa;
    font-weight: 500;
}

.detail-description {
    margin-bottom: 24px;
}

.detail-description h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.detail-description p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.8);
}

.detail-actions {
    display: flex;
    gap: 12px;
}

.btn-watch-now {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    border-radius: 9999px;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.btn-watch-now:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.btn-icon {
    width: 20px;
    height: 20px;
}

.episodes-section {
    padding: 0 20px 40px;
}

.episodes-section .section-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.episodes-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.episode-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.2s ease;
}

.episode-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.error-container {
    padding: 60px 20px;
    text-align: center;
}

.back-btn {
    display: inline-block;
    padding: 10px 24px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 9999px;
    color: #2563eb;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background: rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
}

/* Responsive Detail Page */
@media (max-width: 768px) {
    .detail-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .detail-poster {
        width: 180px;
    }

    .detail-title {
        font-size: 1.5rem;
    }

    .detail-meta {
        justify-content: center;
    }

    .detail-tags {
        justify-content: center;
    }

    .detail-actions {
        justify-content: center;
    }


}

@media (max-width: 480px) {
    .detail-poster {
        width: 160px;
    }

    .detail-title {
        font-size: 1.3rem;
    }

    .btn-watch-now {
        padding: 12px 24px;
        font-size: 0.9rem;
    }


}

/* ========================================
   WATCH PAGE STYLES
   ======================================== */
.watch-page-body {
    background: #000;
    padding-bottom: 0;
}

.watch-main {
    margin-top: 60px;
    display: flex;
    gap: 20px;
    padding: 20px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

.video-container {
    flex: 1;
    min-width: 0;
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    margin-bottom: 20px;
}

.video-info {
    margin-bottom: 20px;
}

.video-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.video-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.episode-label {
    color: #2563eb;
    font-weight: 600;
}

.episode-navigation {
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.nav-episode-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 9999px;
    color: #2563eb;
    font-weight: 500;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.nav-episode-btn:hover {
    background: rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
}

.nav-episode-btn svg {
    width: 16px;
    height: 16px;
}

.episodes-sidebar {
    width: 320px;
    flex-shrink: 0;
    background: rgba(20, 20, 20, 0.8);
    border-radius: 12px;
    padding: 20px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.episodes-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.episode-item {
    display: flex;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.episode-item:hover {
    background: rgba(37, 99, 235, 0.1);
}

.episode-item.active {
    background: rgba(37, 99, 235, 0.2);
    border: 1px solid rgba(37, 99, 235, 0.4);
}

.episode-item-thumbnail {
    position: relative;
    width: 80px;
    aspect-ratio: 16/9;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.episode-item-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playing-indicator {
    position: absolute;
    inset: 0;
    background: rgba(37, 99, 235, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
}

.playing-indicator svg {
    width: 24px;
    height: 24px;
    color: #fff;
}

.episode-item-info {
    flex: 1;
    display: flex;
    align-items: center;
}

.episode-item-number {
    font-size: 0.9rem;
    font-weight: 500;
}

.back-to-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.back-to-detail:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive Watch Page */
@media (max-width: 1024px) {
    .watch-main {
        flex-direction: column;
    }

    .episodes-sidebar {
        width: 100%;
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .video-title {
        font-size: 1.25rem;
    }

    .episode-navigation {
        gap: 10px;
    }

    .nav-episode-btn {
        flex: 1;
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
        /* Prevent text wrap if possible */
    }

    .episodes-sidebar {
        padding: 16px;
    }

    .episode-item-thumbnail {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .watch-main {
        padding: 12px;
    }

    .video-title {
        font-size: 1.1rem;
    }

    .back-to-detail span {
        display: none;
    }
}

/* Dramabox Grid Overrides */
.dramabox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px 16px;
    margin-bottom: 40px;
}

.dramabox-grid .drama-card {
    width: 100% !important;
    flex: none !important;
    margin: 0 !important;
}

.dramabox-grid .drama-card-poster {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2/3;
}

@media (max-width: 480px) {
    .dramabox-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px 12px;
    }
}

/* Pagination Styles override if needed */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    margin-bottom: 40px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s;
    font-weight: 600;
}

.pagination-btn.active,
.pagination-btn:hover:not(.disabled) {
    background: #2563eb;
    border-color: #2563eb;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: default;
}

/* Platform Select Style */
.platform-select {
    border: none;
    background: transparent;
    color: var(--text-color);
    padding: 0 10px;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    border-left: 1px solid var(--border-color);
    margin-right: 5px;
    height: 100%;
}

.platform-select option {
    background: var(--card-bg);
    color: var(--text-color);
    padding: 10px;
}

/* Dropdown Arrow Fix */
.platform-select {
    padding-right: 28px !important;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    background-size: 16px;
}

/* Robust Dropdown Wrapper */
.platform-select-wrapper {
    position: absolute;
    right: 52px;
    display: flex;
    align-items: center;
    border-left: 1px solid var(--border-color);
    height: 100%;
    z-index: 5;
}

.platform-select-wrapper .platform-select {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: none;
    background: transparent !important;
    color: var(--text-color);
    padding: 0 32px 0 16px !important;
    font-size: 0.95rem;
    outline: none;
    cursor: pointer;
    height: 100%;
    width: 100%;
    z-index: 2;
}

.select-arrow {
    position: absolute;
    right: 8px;
    width: 16px;
    height: 16px;
    pointer-events: none;
    color: #9ca3af;
    z-index: 1;
}