/* DRAMABOS - Main Styles */

/* Custom Subtitle Overlay */
.custom-subtitle {
    position: absolute;
    bottom: 60px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 90%;
    padding: 0;
    background: none;
    color: #fff;
    font-size: 18px;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    text-align: center;
    z-index: 50;
    pointer-events: none;
    line-height: 1.5;
    text-shadow:
        1px 1px 1px #000,
        -1px -1px 1px #000,
        1px -1px 1px #000,
        -1px 1px 1px #000,
        0 2px 4px rgba(0,0,0,0.8);
}

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #242424;
    --bg-card: #1f1f1f;
    --accent-primary: #e6b854;
    --accent-secondary: #f5d289;
    --accent-glow: rgba(230, 184, 84, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --border-color: rgba(255, 255, 255, 0.08);
    --gradient-gold: linear-gradient(135deg, #e6b854 0%, #f5d289 50%, #c9983a 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ========== NAVIGATION ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 0.75rem 2rem;
    background: rgba(13, 13, 13, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 0.25rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--accent-primary);
    background: rgba(230, 184, 84, 0.1);
}

/* ========== SEARCH ========== */
.search-container {
    position: relative;
    flex: 1;
    max-width: 350px;
}

.search-box {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.2s ease;
}

.search-box:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.search-box::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 16px;
    height: 16px;
}

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    max-height: 350px;
    overflow-y: auto;
    z-index: 100;
}

.search-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.search-result-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--bg-tertiary);
}

.search-result-item img {
    width: 45px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.search-result-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.search-result-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.search-loading {
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========== MAIN CONTENT ========== */
main {
    padding-top: 100px;
    min-height: 100vh;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    border-radius: 100px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: var(--gradient-gold);
    color: #0d0d0d;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.15);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Load More Container */
.load-more-container {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    padding: 1rem 0;
}

.load-more-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #0d0d0d;
    border: none;
    padding: 0.9rem 2.5rem;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.4);
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Hide mobile search bar on desktop */
.mobile-search-bar {
    display: none;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    text-decoration: none;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: var(--accent-primary);
}

/* ========== HOME PAGE ========== */
.home-page {
    display: block;
}

.home-page.hidden {
    display: none;
}

/* Source Selector */
.source-selector {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    padding: 12px 2rem;
    padding-top: 80px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.source-selector .source-pills {
    max-width: 1400px;
    margin: 0 auto;
}

.source-pills {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.source-pills::-webkit-scrollbar {
    display: none;
}

.source-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 50px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.pill-icon {
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: inherit;
}

.source-pill:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.15);
}

.source-pill.active {
    background: var(--accent-primary);
    color: #000;
    border-color: var(--accent-primary);
    font-weight: 600;
}

.source-pill.active .pill-icon {
    background: rgba(0, 0, 0, 0.2);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 500px;
    display: flex;
    align-items: center;
    padding: 3rem 2rem;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    opacity: 0.5;
}

.hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(13,13,13,1) 0%, rgba(13,13,13,0.8) 40%, rgba(13,13,13,0.4) 100%),
                linear-gradient(180deg, transparent 50%, rgba(13,13,13,1) 100%);
}

.hero-content {
    position: relative;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 3rem;
    align-items: center;
    width: 100%;
}

.hero-info {
    animation: fadeIn 0.6s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(230, 184, 84, 0.15);
    border: 1px solid rgba(230, 184, 84, 0.3);
    padding: 0.4rem 0.875rem;
    border-radius: 100px;
    font-size: 0.7rem;
    color: var(--accent-primary);
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.75rem;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 1rem;
}

.hero-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.25rem;
    max-width: 550px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hero-meta {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.hero-meta-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.hero-meta-item svg {
    color: var(--accent-primary);
    width: 16px;
    height: 16px;
}

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

.hero-poster {
    animation: fadeIn 0.6s ease 0.2s both;
}

.hero-poster img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Sections */
.section {
    padding: 2.5rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '';
    width: 3px;
    height: 1.25rem;
    background: var(--accent-primary);
    border-radius: 2px;
}

/* ========== DRAMA GRID ========== */
.drama-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.25rem;
}

.drama-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-card);
}

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

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

.drama-cover-wrapper {
    position: relative;
    aspect-ratio: 2/3;
    overflow: hidden;
}

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

.drama-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--accent-primary);
    color: #0d0d0d;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
}

.drama-info {
    padding: 0.75rem;
}

.drama-title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.drama-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* ========== DETAIL PAGE ========== */
.detail-page {
    display: none;
}

.detail-page.active {
    display: block;
}

.detail-hero {
    position: relative;
    padding: 2rem;
    padding-top: 80px;
}

.detail-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center 20%;
    opacity: 0.4;
}

.detail-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(13,13,13,0.5) 0%, rgba(13,13,13,1) 100%);
}

.detail-content {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: flex-start;
}

.detail-poster img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.detail-info {
    padding-top: 1rem;
}

h1.detail-title,
.detail-info h1.detail-title,
#detailTitle {
    font-size: 1.75rem !important;
    font-weight: 700 !important;
    margin-bottom: 0.5rem !important;
    margin-top: 0 !important;
    line-height: 1.3 !important;
    font-family: 'Playfair Display', serif !important;
    color: #ffffff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.detail-tag {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.3rem 0.6rem;
    border-radius: 100px;
    font-size: 0.7rem;
}

.detail-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.detail-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.detail-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.detail-synopsis {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ========== EPISODES ========== */
.episodes-section {
    padding: 1.5rem 2rem 3rem;
    max-width: 1200px;
    margin: 0 auto;
}


.episodes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.episodes-header h2 {
    font-size: 1rem;
    font-weight: 600;
}

.episode-count {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.episode-btn {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
    font-family: 'Outfit', sans-serif;
    position: relative;
    padding: 0.6rem 0.3rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateZ(0);
    -webkit-tap-highlight-color: transparent;
}

.episode-btn:hover {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: #0d0d0d;
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(230, 184, 84, 0.4);
    transform: translateZ(0) scale(1.02);
}

.episode-btn.active {
    background: var(--accent-primary);
    color: #0d0d0d;
    border-color: var(--accent-primary);
}

/* Episode that has stream available */
.episode-btn.available {
    border-color: var(--accent-secondary);
    background: rgba(230, 184, 84, 0.1);
}

/* Episode not yet loaded - still clickable */
.episode-btn:not(.available):not(.active) {
    opacity: 0.7;
}

.episode-btn:not(.available):not(.active):hover {
    opacity: 1;
    background: var(--accent-primary);
    color: #0d0d0d;
    border-color: var(--accent-primary);
}

.episode-btn .lock-icon {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    color: var(--text-muted);
}

.episode-btn.loading-ep {
    opacity: 0.5;
    pointer-events: none;
}

.episode-btn.loading-ep::after {
    content: '';
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ========== PLAYER PAGE - DESKTOP ========== */
.player-page {
    display: none;
}

.player-page.active {
    display: block;
}

.player-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1.5rem;
}

.video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

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

.player-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.quality-selector {
    display: flex;
    gap: 0.4rem;
}

.quality-btn {
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.quality-btn:hover,
.quality-btn.active {
    background: var(--accent-primary);
    color: #0d0d0d;
    border-color: var(--accent-primary);
}

.speed-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.speed-selector .speed-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.speed-selector .speed-buttons {
    display: flex;
    gap: 0.4rem;
}

.speed-selector .speed-btn {
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.speed-selector .speed-btn:hover,
.speed-selector .speed-btn.active {
    background: var(--accent-primary);
    color: #0d0d0d;
    border-color: var(--accent-primary);
}

.player-info h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.player-info p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.episode-nav {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.episode-nav .btn {
    flex: 1;
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
}

/* ========== LOADING ========== */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    gap: 0.75rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.loading-text {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-card) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-card .skeleton-cover {
    aspect-ratio: 2/3;
    border-radius: 12px 12px 0 0;
}

.skeleton-card .skeleton-text {
    height: 14px;
    margin: 0.75rem;
}

.skeleton-card .skeleton-text-sm {
    height: 10px;
    width: 50%;
    margin: 0 0.75rem 0.75rem;
}

/* ========== MOBILE PLAYER - DRAMABOX STYLE ========== */
.mobile-player {
    display: none;
}

/* ========== DESKTOP ADJUSTMENTS ========== */
@media (min-width: 769px) {
    .mobile-player {
        display: none !important;
    }
    
    .episode-sheet {
        display: none;
    }
}

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

    .episodes-grid {
        grid-template-columns: repeat(6, 1fr);
        max-width: 600px;
    }
}

@media (min-width: 1400px) {
    .episodes-grid {
        grid-template-columns: repeat(8, 1fr);
        max-width: 800px;
    }
}

