:root {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #6366f1;
    /* Indigo 500 */
    --accent-hover: #4f46e5;
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --border-color: #334155;
    --font-main: 'Outfit', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 70px 20px 20px;
}

.hidden {
    display: none !important;
}

/* Header */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.5rem;
    margin-bottom: 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: none;
    transition: background 0.3s;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

.logo i {
    color: var(--accent-color);
    font-size: 1.8rem;
}

.logo .highlight {
    color: var(--accent-color);
}

/* User Area in Navbar */
.user-area {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.login-btn {
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    border: none;
    color: white;
    padding: 8px 18px;
    border-radius: 25px;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coin-display {
    display: flex;
    align-items: center;
    gap: 5px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    padding: 5px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    transition: all 0.3s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.coin-display:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.coin-display i {
    font-size: 0.9rem;
}

.user-avatar {
    font-size: 1.6rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: 0.2s;
}

.user-avatar:hover {
    color: var(--accent-color);
}

/* Auth Modal */
.auth-modal-content {
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px;
}

.auth-tabs {
    display: flex;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.25s;
}

.auth-tab.active {
    background: var(--accent-color);
    color: white;
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-logo {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.auth-header h2 {
    font-size: 1.4rem;
    margin-bottom: 5px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group label i {
    margin-right: 5px;
    width: 16px;
}

.form-group input {
    width: 100%;
    padding: 11px 15px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: 0.3s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.form-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.auth-submit-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    color: white;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.auth-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Profile Panel */
.profile-panel {
    padding: 10px 0;
}

.profile-header {
    text-align: center;
    margin-bottom: 20px;
}

.profile-avatar {
    font-size: 4rem;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.profile-header h2 {
    font-size: 1.3rem;
    margin-bottom: 3px;
}

.profile-header p {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.coin-balance-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    padding: 10px 25px;
    border-radius: 25px;
    margin-top: 12px;
    font-weight: 700;
    font-size: 1.4rem;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.coin-balance-large small {
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.9;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.profile-action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background: var(--card-bg);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
}

.profile-action-btn:hover {
    border-color: var(--accent-color);
    background: rgba(99, 102, 241, 0.05);
}

.profile-action-btn.danger {
    color: var(--danger-color);
}

.profile-action-btn.danger:hover {
    border-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.05);
}

/* Coin History */
.coin-history h3 {
    font-size: 1rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.history-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
}

.history-item-info {
    flex: 1;
}

.history-item-desc {
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 2px;
}

.history-item-date {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.history-item-amount {
    font-weight: 700;
    font-size: 0.9rem;
}

.history-item-amount.positive {
    color: #10b981;
}

.history-item-amount.negative {
    color: #ef4444;
}

/* Unlock Episode Prompt */
.unlock-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(10px);
    padding: 20px;
    z-index: 2000;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.unlock-prompt-text {
    text-align: center;
    font-size: 0.95rem;
}

.unlock-prompt-actions {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 400px;
}

.unlock-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-main);
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.unlock-btn.confirm {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: white;
}

.unlock-btn.cancel {
    background: var(--card-bg);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.search-container {
    display: flex;
    background: var(--card-bg);
    border-radius: 50px;
    padding: 5px 15px;
    align-items: center;
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 400px;
    transition: 0.3s;
}

.search-container:focus-within {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.search-container input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px;
    flex: 1;
    outline: none;
    font-family: var(--font-main);
}

.search-container button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.1rem;
    transition: 0.2s;
}

.search-container button:hover {
    color: var(--accent-color);
}

/* Sections */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-header h2 i {
    color: var(--accent-color);
}

.icon-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: 0.2s;
}

.icon-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* Grid */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    min-height: 200px;
}

/* Card */
.drama-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
}

.drama-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    border-color: var(--accent-color);
}

.card-poster {
    width: 100%;
    padding-top: 140%;
    /* Aspect ratio for poster */
    background-size: cover;
    background-position: center;
    background-color: #2c3e50;
    position: relative;
}

.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 700;
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    font-size: 1.1rem;
    -webkit-tap-highlight-color: transparent;
}

.close-modal:hover,
.close-modal:active {
    background: var(--danger-color);
    transform: scale(1.1);
}

.modal-body {
    overflow-y: auto;
    padding: 0;
    height: 100%;
    position: relative;
    z-index: 1;
}

.detail-layout {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .detail-layout {
        flex-direction: row;
    }
}

/* Detail Left Column (Cover + Player) */
.detail-left-col {
    position: relative;
    background: #000;
    width: 100%;
    aspect-ratio: 9 / 12;
    min-height: 250px;
}

@media (min-width: 768px) {
    .detail-left-col {
        flex: 0 0 40%;
        max-width: 40%;
        min-height: 300px;
        aspect-ratio: auto;
    }
}

/* Cover background image */
.detail-cover-bg {
    width: 100%;
    height: 100%;
    min-height: 100%;
    background-size: cover;
    background-position: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 2;
}

/* Play overlay icon */
.detail-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.8);
    pointer-events: none;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* Video player container */
.detail-player-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Detail info section */
.detail-info {
    padding: 25px;
    flex: 1;
    overflow-y: auto;
}

/* Episode section header */
.episode-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

/* Now playing label */
.now-playing-label {
    font-size: 0.9rem;
    color: var(--accent-color);
}

.detail-cover {
    width: 100%;
    height: 300px;
    background-size: cover;
    background-position: center;
    position: relative;
}

@media (min-width: 768px) {
    .detail-cover {
        width: 350px;
        min-height: 100%;
        height: auto;
    }
}

.detail-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.2;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.detail-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 25px;
    max-height: 100px;
    overflow-y: auto;
}

.episode-section h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.episode-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: 0.2s;
    text-align: center;
    text-decoration: none;
    display: block;
}

.episode-btn:hover {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.episode-btn.vip-episode {
    border-color: rgba(245, 158, 11, 0.4);
    background: rgba(245, 158, 11, 0.05);
}

.episode-btn.vip-episode:hover {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border-color: #f59e0b;
    color: white;
}

.episode-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.episode-btn.unlocked-episode {
    border-color: rgba(34, 197, 94, 0.4);
    background: rgba(34, 197, 94, 0.08);
}

.episode-btn.unlocked-episode:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-color: #22c55e;
    color: white;
}

.loading-spinner {
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top: 3px solid var(--accent-color);
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 50px auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    z-index: 2000;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.btn-primary {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
    margin-bottom: 20px;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

/* Skeleton Loading */
.card-skeleton {
    background: #2c3e50;
    border-radius: 12px;
    padding-top: 140%;
    animation: pulse 1.5s infinite;
}


/* Tabs */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 0 20px;
}

.tab-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 10px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: 0.3s;
    display: flex;
    align-items: center;
}

.tab-btn:hover {
    background: #2d3748;
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.tab-content.hidden {
    display: none;
}

.tab-content {
    animation: fadeIn 0.4s ease;
}

@keyframes pulse {
    0% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.6;
    }
}

/* Video Modal specific */
.video-content {
    width: 90%;
    max-width: 900px;
    background: #000;
    padding: 20px;
    border: 1px solid #333;
}

.video-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #000;
}

/* Updated Video Modal Styling */
.modal-content.video-content-split {
    width: 90%;
    max-width: 850px;
    /* Even smaller max-width */
    height: 480px;
    /* Compact height */
    max-height: 85vh;
    background: #0f172a;
    /* Main bg color */
    padding: 0;
    display: flex;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    /* Add shadow for pop-out effect */
    margin: auto;
    /* Ensure centering */
}

.video-section-main {
    flex: 2;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    max-width: 70%;
}

#mainVideoPlayer {
    width: 100%;
    max-height: 100%;
}

.video-section-side {
    flex: 1;
    background: #1e293b;
    /* Card bg */
    padding: 20px;
    overflow-y: auto;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    gap: 15px;
    border-left: 1px solid #334155;
    min-width: 350px;
}

/* Close button repositioning for split modal */
.modal-content.video-content-split .close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Side Panel Elements */
.side-header h3 {
    font-size: 1.2rem;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.drama-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.tag-badge {
    background: #334155;
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

.side-plot h4 {
    font-size: 0.95rem;
    margin-bottom: 5px;
    color: var(--text-secondary);
}

#videoPlot {
    font-size: 0.9rem;
    color: #cbd5e1;
    line-height: 1.5;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-link {
    font-size: 0.85rem;
    color: var(--accent-color);
    text-decoration: none;
    margin-top: 5px;
    display: inline-block;
}

.side-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #334155;
}

.meta-rating,
.meta-eps {
    font-size: 0.9rem;
    font-weight: 600;
}

.btn-icon {
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.1rem;
}

.btn-outline-sm {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: 0.2s;
}

.btn-outline-sm:hover {
    background: var(--accent-color);
    color: white;
}

/* Episode List */
.ep-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.ep-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.ep-tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding-bottom: 2px;
}

.ep-tab-btn.active {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    font-weight: bold;
}

.ep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 8px;
}

.grid-ep-btn {
    aspect-ratio: 1;
    background: #334155;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.grid-ep-btn:hover {
    background: #475569;
}

.grid-ep-btn.active {
    background: #eab308;
    /* Yellow-500 from screenshot style */
    color: #000;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

/* Simulate the playing icon in active button */
.grid-ep-btn.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 6px;
    height: 6px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
}

/* Tablets/Mobile Responsiveness */
@media (max-width: 1024px) {
    .modal-content.video-content-split {
        flex-direction: column;
        height: 100vh;
        max-height: 100vh;
        width: 100%;
        overflow-y: auto;
        border-radius: 0;
    }

    .video-section-main {
        max-width: 100%;
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
        flex: none;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .video-section-side {
        flex: none;
        height: auto;
        min-width: auto;
        border-left: none;
        border-top: 1px solid #334155;
        padding-bottom: 50px;
    }
}

/* Category Filter */
.category-filter-wrapper {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--bg-color);
    padding: 10px 0 6px;
}

.category-filter {
    display: flex;
    gap: 8px;
    padding: 0 16px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap;
    mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 16px, black calc(100% - 16px), transparent);
}

.category-filter::-webkit-scrollbar {
    display: none;
}

.category-chip {
    padding: 6px 14px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.category-chip:hover {
    border-color: var(--accent-color);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.category-chip.active {
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    border-color: transparent;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Load More Button */
.load-more-container {
    display: flex;
    justify-content: center;
    padding: 15px 20px 5px;
}

.load-more-btn {
    padding: 10px 30px;
    border-radius: 25px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-secondary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.load-more-btn:hover {
    background: linear-gradient(135deg, var(--accent-color), #8b5cf6);
    border-color: transparent;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.load-more-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.load-more-btn.loading {
    pointer-events: none;
}

.load-more-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */

/* Hidden by default (desktop) */
.bottom-nav {
    display: none;
}

/* Mobile styles */
@media (max-width: 768px) {

    /* Show bottom nav */
    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        background: rgba(15, 23, 42, 0.97);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border-color);
        padding: 6px 0;
        padding-bottom: max(6px, env(safe-area-inset-bottom));
        justify-content: space-around;
        align-items: center;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .bottom-nav-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-family: var(--font-main);
        font-size: 0.65rem;
        font-weight: 500;
        cursor: pointer;
        padding: 6px 12px;
        border-radius: 12px;
        transition: all 0.25s ease;
        position: relative;
    }

    .bottom-nav-item i {
        font-size: 1.2rem;
        transition: all 0.25s ease;
    }

    .bottom-nav-item.active {
        color: #fff;
    }

    .bottom-nav-item.active i {
        color: var(--accent-color);
        filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.6));
        transform: scale(1.1);
    }

    .bottom-nav-item.active::before {
        content: '';
        position: absolute;
        top: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 3px;
        background: linear-gradient(90deg, var(--accent-color), #8b5cf6);
        border-radius: 0 0 3px 3px;
    }

    /* Hide top navbar tabs & search on mobile */
    .navbar .tabs-container {
        display: none !important;
    }

    .navbar .search-container {
        display: none !important;
    }

    /* Simplify navbar on mobile */
    .navbar {
        justify-content: space-between;
        padding: 0.7rem 1rem;
        margin-bottom: 0.5rem;
    }

    .logo {
        font-size: 1.2rem;
    }

    .logo i {
        font-size: 1.4rem;
    }

    /* Mobile user area */
    .login-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .coin-display {
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    .user-avatar {
        font-size: 1.3rem;
    }

    .auth-modal-content {
        padding: 20px;
    }

    /* Add padding at bottom for the bottom nav */
    .app-container {
        padding-bottom: 70px;
    }

    /* Mobile search bar (appears when search is active) */
    .mobile-search-active .navbar {
        flex-direction: column;
        gap: 10px;
    }

    .mobile-search-active .navbar .search-container {
        display: flex !important;
        max-width: 100%;
    }

    /* Category filter: compact on mobile */
    .category-filter-wrapper {
        padding: 6px 0 2px;
    }

    .category-filter {
        padding: 0 12px 6px;
        gap: 6px;
    }

    .category-chip {
        padding: 5px 11px;
        font-size: 0.7rem;
        border-radius: 14px;
    }

    /* Grid adjustments */
    .grid-container {
        gap: 10px;
    }

    /* Section header smaller */
    .section-header h2 {
        font-size: 1rem;
    }

    .section {
        padding: 10px 0;
    }

    /* Card adjustments */
    .card-poster {
        height: 180px;
    }

    .card-title {
        font-size: 0.8rem;
    }

    .card-meta {
        font-size: 0.7rem;
    }

    /* Toast above bottom nav */
    .toast {
        bottom: 80px !important;
    }

    /* Detail Modal - Mobile Full Screen */
    .modal-content {
        width: 100%;
        max-width: 100%;
        max-height: 100vh;
        height: 100vh;
        border-radius: 0;
        border: none;
    }

    .detail-left-col {
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: 200px;
        max-height: 280px;
    }

    .detail-play-overlay {
        font-size: 2.5rem;
    }

    .detail-info {
        padding: 15px;
    }

    .detail-title {
        font-size: 1.3rem;
    }

    .detail-tags {
        gap: 5px;
        margin-bottom: 10px;
    }

    .tag {
        padding: 3px 8px;
        font-size: 0.7rem;
    }

    .detail-desc {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }

    .episode-grid {
        max-height: 250px !important;
    }

    .episode-btn {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    /* Fullscreen Video Player Modal - Mobile */
    .modal-content.video-content-split {
        height: 100vh;
        max-height: 100vh;
        width: 100%;
        border-radius: 0;
    }

    .video-section-main video {
        width: 100% !important;
        height: 100% !important;
    }
}