/* ============================================
   ROOT VARIABLES (DARK MODE DEFAULT)
   ============================================ */
:root {
    --bg-primary: #000000;
    --bg-secondary: #1a1a2e;
    --bg-card: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #aaa;
    --text-muted: #888;
    --border-color: rgba(255, 255, 255, 0.1);
    --navbar-bg: rgba(0, 0, 0, 0.95);
    --hero-bg: transparent;
    --btn-primary: linear-gradient(135deg, #667eea, #764ba2);
    --btn-secondary-bg: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(255, 255, 255, 0.1);
    --autocomplete-bg: #1a1a2e;
    --gradient-text: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

[data-theme="light"] {
    --bg-primary: linear-gradient(135deg, #f5f7fa 0%, #e4e8f0 100%);
    --bg-secondary: #ffffff;
    --bg-card: rgba(0, 0, 0, 0.05);
    --text-primary: #1a1a2e;
    --text-secondary: #555;
    --text-muted: #888;
    --border-color: rgba(0, 0, 0, 0.1);
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --hero-bg: linear-gradient(135deg, #667eea08 0%, #764ba208 100%);
    --btn-primary: linear-gradient(135deg, #667eea, #764ba2);
    --btn-secondary-bg: rgba(0, 0, 0, 0.05);
    --input-bg: rgba(0, 0, 0, 0.05);
    --autocomplete-bg: #ffffff;
    --gradient-text: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

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

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

.logo-icon-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
}

.nav-links {
    display: flex;
    gap: 2rem;
    flex-shrink: 0;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s;
    font-weight: 500;
    cursor: pointer;
}

.nav-links a:hover,
.nav-links a.active {
    color: #667eea;
}

/* Search Bar */
.nav-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--input-bg);
    border-radius: 40px;
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s;
    flex: 1;
    max-width: 400px;
}

.nav-search:focus-within {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
}

.search-input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 8px 12px;
    flex: 1;
    font-size: 0.9rem;
    outline: none;
    min-width: 150px;
}

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

.search-btn {
    background: var(--btn-primary);
    border: none;
    color: white;
    padding: 6px 16px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.search-btn:hover {
    transform: scale(1.02);
}

.clear-history-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 6px 8px;
    border-radius: 30px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.clear-history-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ff6b6b;
}

/* Nav Actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.theme-toggle {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    color: var(--text-primary);
}

.theme-toggle:hover {
    transform: scale(1.05);
}

.nav-profile {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--btn-secondary-bg);
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
}

/* ============================================
   AUTOCOMPLETE DROPDOWN
   ============================================ */
.autocomplete-items {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--autocomplete-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin-top: 8px;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.autocomplete-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.autocomplete-item:hover {
    background: rgba(102, 126, 234, 0.1);
}

.autocomplete-term {
    flex: 1;
}

.autocomplete-item .delete-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 5px;
    opacity: 0;
    transition: opacity 0.2s;
}

.autocomplete-item:hover .delete-item {
    opacity: 1;
}

.autocomplete-item .delete-item:hover {
    color: #ff6b6b;
}

.autocomplete-match {
    font-weight: 600;
    color: #667eea;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    text-align: center;
    padding: 20px 20px;
    background: var(--hero-bg);
    border-radius: 0 0 20px 20px;
    margin-bottom: 10px;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.hero-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
	font-size: 0.9rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 40px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary {
    background: var(--btn-primary);
    color: white;
}

.btn-secondary {
    background: var(--btn-secondary-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */
.section {
    max-width: 1400px;
    margin: 0 auto 60px;
    padding: 0 20px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 10px;
}

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
}

.view-all {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    cursor: pointer;
}

.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.movie-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.movie-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.4);
}

.movie-poster {
    width: 100%;
    aspect-ratio: 2/3;
    object-fit: cover;
}

.movie-info {
    padding: 12px;
}

.movie-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.watchlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 30px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}

.watchlist-btn:hover {
    transform: scale(1.1);
}

.watchlist-btn.in-watchlist {
    background: #ffd700;
    color: #1a1a2e;
}

/* ============================================
   DETAIL PAGE
   ============================================ */
.detail-container {
    background: var(--bg-secondary);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 40px;
}

.detail-backdrop {
    position: relative;
    height: 200px;
    background-size: cover;
    background-position: center;
}

.detail-backdrop::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, var(--bg-secondary), transparent);
}

.detail-content {
    padding: 30px;
    margin-top: -100px;
    position: relative;
    z-index: 2;
}

.detail-poster {
    display: inline-block;
    width: 200px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    margin-bottom: 20px;
}

.detail-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.detail-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.detail-rating {
    color: #ffd700;
}

.detail-overview {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 800px;
}

/* ============================================
   EPISODE SECTION (SEASON SELECTOR + EPISODE LIST)
   ============================================ */
.episode-section {
    margin: 30px 0;
    padding: 20px;
    background: var(--bg-card);
    border-radius: 16px;
}

.season-selector-container {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.season-selector-container label {
    font-weight: 600;
    color: var(--text-secondary);
}

/* PERBAIKAN UTAMA: Season Select Dropdown */
.season-select {
    background: #2a2a3e;
    border: 1px solid var(--border-color);
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Hover effect */
.season-select:hover {
    border-color: #667eea;
    background: #3a3a55;
}

/* Styling untuk option di dalam dropdown */
.season-select option {
    background: #1e1e2e;
    color: #ffffff;
    padding: 10px;
}

/* LIGHT MODE OVERRIDE */
[data-theme="light"] .season-select {
    background: #e8e8ee;
    color: #1a1a2e;
    border-color: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .season-select:hover {
    background: #d4d4dc;
    border-color: #667eea;
}

[data-theme="light"] .season-select option {
    background: #ffffff;
    color: #1a1a2e;
}

/* Jika masih ada select lain yang bermasalah, force dengan ini */
select.season-select,
select.season-select:focus {
    outline: none;
}

.episode-list-container {
    max-height: 400px;
    overflow-y: auto;
}

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

.episode-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.episode-card:hover {
    background: rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
    border-color: #667eea;
}

.episode-number {
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
    font-size: 0.8rem;
}

.episode-name {
    font-size: 0.85rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.loading-episodes {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.episode-list-container::-webkit-scrollbar {
    width: 6px;
}

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

.episode-list-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ============================================
   DETAIL ACTIONS
   ============================================ */
.detail-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.play-btn {
    background: var(--btn-primary);
    border: none;
    color: white;
    padding: 12px 32px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.play-btn:hover {
    transform: scale(1.02);
}

.watchlist-detail-btn {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 32px;
    border-radius: 40px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.watchlist-detail-btn.in-watchlist {
    background: #ffd700;
    color: #1a1a2e;
    border-color: #ffd700;
}

.back-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 40px;
    cursor: pointer;
    margin-bottom: 20px;
    display: inline-block;
}

/* ============================================
   MODAL PLAYER
   ============================================ */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    width: 90%;
    max-width: 1000px;
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
}

.modal-header {
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-refresh {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 30px;
    transition: all 0.2s;
}

.modal-refresh:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(180deg);
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
    line-height: 1;
}

.modal-close:hover {
    transform: scale(1.1);
    color: #ff6b6b;
}

.modal-body iframe {
    width: 100%;
    height: 450px;
    border: none;
}

.modal-footer {
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.5);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .nav-search {
        max-width: 300px;
    }
}

@media (max-width: 900px) {
    .nav-container {
        flex-wrap: wrap;
    }
    
    .nav-search {
        order: 3;
        max-width: 100%;
        width: 100%;
        margin-top: 10px;
    }
    
    .nav-links {
        order: 2;
    }
    
    .nav-actions {
        order: 4;
    }
    
    .search-input {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .movie-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
    
    .nav-links {
        gap: 1rem;
    }
    
    .modal-body iframe {
        height: 300px;
    }
    
    .detail-title {
        font-size: 1.5rem;
    }
    
    .detail-poster {
        width: 120px;
    }
    
    .detail-backdrop {
        height: 200px;
    }
    
    .episode-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
	
	/* ============================================
   SCRAP TMDB CODES TABLE
   ============================================ */
.watchlist-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.scrap-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: transform 0.2s;
}

.scrap-btn:hover {
    transform: scale(1.02);
}

.scrap-table-container {
    margin-top: 40px;
    background: var(--bg-card);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.scrap-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.scrap-table-header h3 {
    font-size: 1.3rem;
    color: var(--text-primary);
}

.scrap-table-actions {
    display: flex;
    gap: 10px;
}

.export-btn, .close-scrap-btn {
    background: var(--btn-secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 15px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.export-btn:hover, .close-scrap-btn:hover {
    background: rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.table-wrapper {
    overflow-x: auto;
    max-height: 500px;
    overflow-y: auto;
}

.scrap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

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

.scrap-table th {
    background: rgba(102, 126, 234, 0.2);
    font-weight: 600;
    position: sticky;
    top: 0;
}

.scrap-table tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

.tmdb-code {
    font-family: monospace;
    cursor: pointer;
    background: var(--btn-secondary-bg);
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
    transition: all 0.2s;
}

.tmdb-code:hover {
    background: #667eea;
    color: white;
}

.badge-valid {
    background: #10b981;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.badge-invalid {
    background: #ef4444;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.badge-checking {
    background: #f59e0b;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

.relay-badge {
    font-family: monospace;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 600;
}

.relay-angka {
    background: #10b981;
    color: white;
}

.relay-tt {
    background: #3b82f6;
    color: white;
}

.relay-imdb {
    background: #8b5cf6;
    color: white;
}

.test-link {
    color: #667eea;
    text-decoration: none;
    cursor: pointer;
    font-size: 0.8rem;
}

.test-link:hover {
    text-decoration: underline;
}

.copy-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 1000;
    animation: fadeOut 2s ease-out;
}

@keyframes fadeOut {
    0% { opacity: 1; transform: translateY(0); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-20px); visibility: hidden; }
}
}
