/* =========================================
   1. GLOBAL VARIABLES & RESET
   ========================================= */
:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --accent-color: #e5a00d;
    --border-color: #333;
    --input-bg: #111;
    --success: #2ecc71;
    --error: #e74c3c;
    --info: #3498db;
}

[data-theme="light"] {
    --bg-color: #f4f4f9;
    --card-bg: #ffffff;
    --text-color: #333333;
    --accent-color: #d48e00;
    --border-color: #ddd;
    --input-bg: #f0f0f0;
}

body { 
    font-family: 'Inter', sans-serif; 
    background-color: var(--bg-color); 
    color: var(--text-color); 
    margin: 0; padding: 0;
    min-height: 100vh;
    display: flex; flex-direction: column;
    transition: background 0.3s, color 0.3s;
}

.container { 
    max-width: 1200px; margin: 0 auto; padding: 20px; 
    width: 100%; box-sizing: border-box; flex: 1;
}

a { text-decoration: none; color: inherit; transition: color 0.2s; }
ul { list-style: none; padding: 0; margin: 0; }

/* =========================================
   2. COMPONENTS (Cards, Buttons, Inputs)
   ========================================= */
.card h3, .card h4, .setting-card h3, .setting-card h4 {
    color: var(--text-color);
    margin-top: 0;
    font-weight: 700;
    border-bottom: 1px solid #333;
    padding-bottom: 10px;
    margin-bottom: 20px;
}
.card {
    background: var(--card-bg); padding: 25px; border-radius: 12px;
    border: 1px solid var(--border-color); margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.btn {
    padding: 12px 20px; border-radius: 8px; border: none; 
    font-weight: bold; cursor: pointer; transition: opacity 0.2s;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--accent-color); color: #121212; }
.btn-secondary { background: transparent; border: 1px solid var(--accent-color); color: var(--accent-color); }

input[type="text"], input[type="password"], input[type="number"], select, textarea {
    padding: 12px; border-radius: 6px; 
    border: 1px solid var(--border-color); 
    background: var(--input-bg); 
    color: var(--text-color); 
    box-sizing: border-box; width: 100%;
    font-size: 1em;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-color); }
/* Darken select options */
select option { background-color: #333; color: white; }

.input-group { margin-bottom: 20px; }
.input-label { display: block; font-weight: 600; margin-bottom: 8px; color: var(--text-color); }
.helper-text { font-size: 0.85em; color: #888; margin-top: -5px; margin-bottom: 8px; }

/* Flash Messages */
.flash { padding: 15px; margin-bottom: 20px; border-radius: 8px; text-align: center; font-weight: bold; }
.flash.success { background: rgba(46, 204, 113, 0.2); border: 1px solid #2ecc71; color: #2ecc71; }
.flash.error { background: rgba(231, 76, 60, 0.2); border: 1px solid #e74c3c; color: #e74c3c; }
.flash.info { background: rgba(52, 152, 219, 0.2); border: 1px solid #3498db; color: #3498db; }

/* =========================================
   3. NAVIGATION
   ========================================= */
.nav { 
    display: flex; justify-content: space-between; align-items: center; 
    margin-bottom: 40px; padding: 20px 0; 
    border-bottom: 1px solid var(--border-color); 
}
.nav-logo { font-size: 1.5em; font-weight: bold; color: var(--accent-color); }
.nav-links a { color: var(--text-color); margin-left: 20px; font-weight: 600; }
.nav-links a:hover { color: var(--accent-color); }
.theme-switch { background: none; font-size: 1.5em; border: none; cursor: pointer; margin-left: 20px; }

/* =========================================
   4. DASHBOARD STYLES
   ========================================= */

/* Discovery Card */
.discovery-card { 
    max-width: 700px; margin: 0 auto 30px auto; 
    border-top: 4px solid var(--accent-color); text-align: left; 
}
.info-box {
    background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; 
    margin-bottom: 20px; font-size: 0.9em; line-height: 1.5; 
    color: #bbb; border: 1px solid #333;
}
.scan-btn-group { display: flex; gap: 15px; margin-bottom: 15px; }
.btn-scan { flex: 1; color: white; border: none; }
.btn-scan.movie { background: #e5a00d; }
.btn-scan.tv { background: #01d277; }
.btn-lucky { 
    width: 100%; max-width: 400px; margin: 0 auto; display:block;
    background: #9b59b6; color: white; border: none; 
}

/* Input Controls in Dashboard */
.history-limit-input {
    width: 70px; padding: 10px; border-radius: 8px; 
    background: #111; border: 1px solid #444; 
    color: white; text-align: center;
}
.critic-label {
    cursor: pointer; display: inline-flex; align-items: center; 
    justify-content: center; gap: 8px; 
    background: rgba(255,255,255,0.05); padding: 8px 15px; 
    border-radius: 20px; border: 1px solid #333; transition: 0.2s;
}
.critic-input {
    width: 45px; padding: 2px 4px; border-radius: 4px; 
    border: 1px solid #555; background: #222; color: #fff; 
    font-size: 0.9em; display: none;
}

/* Search */
.main-search {
    width: 100%; padding: 20px; font-size: 1.2em; border-radius: 50px; 
    border: 2px solid var(--border-color); background: var(--card-bg); 
    color: var(--text-color); box-shadow: 0 5px 15px rgba(0,0,0,0.2); 
    margin-top: 10px;
}
#search-results {
    display: none; position: absolute; top: 80px; left: 0; right: 0; 
    background: var(--card-bg); border-radius: 10px; 
    border: 1px solid var(--border-color); z-index: 100; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); overflow: hidden; text-align: left;
}
.search-result-item {
    padding: 15px; border-bottom: 1px solid var(--border-color); 
    cursor: pointer; display: flex; align-items: center; gap: 10px;
}
.search-result-item:hover { background: rgba(255,255,255,0.05); }

/* =========================================
   5. LOGIN & AUTH STYLES
   ========================================= */
.login-wrapper { display: flex; justify-content: center; align-items: center; min-height: 70vh; }
.login-card { width: 100%; max-width: 400px; background: #1a1a1a; border: 1px solid #333; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); overflow: hidden; padding: 0; text-align: left; }
.auth-toggle { display: flex; border-bottom: 1px solid #333; background: #111; }
.toggle-btn { flex: 1; padding: 20px; border: none; background: transparent; color: #777; font-weight: bold; cursor: pointer; transition: all 0.2s; font-size: 1em; outline: none; text-align: center; }
.toggle-btn:hover { color: #aaa; background: #161616; }
.toggle-btn.active { color: white; background: #1a1a1a; border-bottom: 3px solid var(--accent-color); }
.auth-body { padding: 30px; }
.auth-body .form-group { margin-bottom: 20px; text-align: left; }
.auth-body label { display: block; margin-bottom: 8px; font-size: 0.9em; color: #ccc; font-weight: 600; }
.auth-body input { width: 100%; padding: 12px; background: #252525; border: 1px solid #444; border-radius: 6px; color: white; outline: none; transition: border-color 0.2s; }
.auth-body input:focus { border-color: var(--accent-color); }
.login-btn { width: 100%; padding: 12px; margin-top: 10px; background: var(--accent-color); color: black; font-weight: 800; border: none; border-radius: 6px; cursor: pointer; transition: opacity 0.2s; }
.login-btn:hover { opacity: 0.9; }
.hidden-field { display: none; opacity: 0; transform: translateY(-10px); }
.visible-field { display: block; opacity: 1; transform: translateY(0); transition: all 0.3s ease; }
.auth-footer { margin-top: 20px; text-align: center; font-size: 0.85em; color: #666; }

/* =========================================
   6. PLAYLISTS & SETTINGS & OTHER PAGES
   ========================================= */
.playlist-header { text-align: center; margin-bottom: 40px; }
.stats-bar {
    background: rgba(255,255,255,0.05); padding: 10px 20px; 
    border-radius: 20px; display: inline-flex; gap: 20px; 
    border: 1px solid var(--border-color); margin-bottom: 30px;
}
.stats-label { color: #555; } /* Divider pipe */

/* Action Bar */
.action-bar { margin: 25px 0; }
.btn-builder, .btn-import {
    padding: 12px 25px; 
    font-weight: bold; 
    border: none; 
    border-radius: 30px; 
    font-size: 1em; 
    cursor: pointer; 
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s;
}
.btn-builder {
    background: linear-gradient(45deg, #e5a00d, #f1c40f); 
    color: black;
    box-shadow: 0 5px 15px rgba(229, 160, 13, 0.4);
    margin-right: 10px;
}
.btn-import {
    background: linear-gradient(45deg, #9b59b6, #8e44ad); 
    color: white;
    box-shadow: 0 5px 15px rgba(155, 89, 182, 0.4); 
}
.btn-builder:hover, .btn-import:hover { transform: scale(1.05); }

/* Type Toggles */
.type-toggle-group { margin: 30px 0; }
.type-toggle-btn {
    background: transparent; border: 2px solid var(--accent-color);
    color: var(--text-color); padding: 10px 20px; font-weight: bold;
    cursor: pointer; border-radius: 5px; margin: 0 5px; transition: 0.2s;
}
.type-toggle-btn.active, .type-toggle-btn:hover { background: var(--accent-color); color: #121212; }

/* Categories & Grid */
.category-header {
    font-size: 1.4em; font-weight: bold; color: var(--accent-color);
    margin: 40px 0 20px 0; padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 10px;
}

.playlist-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 20px; margin-bottom: 40px;
}

.playlist-card {
    border-top: 4px solid var(--accent-color); padding: 25px; 
    display: flex; flex-direction: column; justify-content: space-between;
}
.playlist-header-row { display: flex; justify-content: space-between; align-items: flex-start; }
.playlist-icon { font-size: 3em; margin-bottom: 10px; }
.playlist-title { margin: 0; color: var(--text-color); }
.playlist-desc { font-size: 0.9em; color: #888; line-height: 1.5; }

.playlist-controls { margin-top: 20px; }
.schedule-row {
    display: flex; align-items: center; justify-content: space-between; 
    margin-bottom: 10px; background: rgba(0,0,0,0.2); padding: 8px; border-radius: 5px;
}
.schedule-select { background: transparent; color: white; border: none; font-size: 0.9em; cursor: pointer; text-align: right; }
.sync-row { display: flex; gap: 10px; }
.btn-preview { padding: 12px; background: #444; color: white; border: 1px solid #555; border-radius: 5px; cursor: pointer; }
.btn-sync { flex: 1; padding: 12px; background: #333; color: white; border: 1px solid #555; transition: 0.2s; cursor: pointer; border-radius: 5px; }

.btn-delete {
    background: transparent; color: var(--error); border: 1px solid var(--error);
    padding: 5px 10px; font-size: 0.8em; border-radius: 4px; cursor: pointer; transition: all 0.2s;
}
.btn-delete:hover { background: var(--error); color: white; }

.static-badge {
    margin-bottom: 10px; padding: 8px; color: #777; font-size: 0.85em; 
    font-style: italic; text-align: center; border: 1px dashed #444; border-radius: 5px;
}
.btn-synced-disabled {
    width: 100%; padding: 12px; background: #222; color: #555; 
    border: 1px solid #333; cursor: not-allowed; border-radius: 5px;
}

/* Import Modal Specifics */
.import-modal {
    display: none; position: fixed; z-index: 2000; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8); backdrop-filter: blur(5px); overflow-y: auto;
}
.import-content {
    background-color: var(--card-bg); margin: 5% auto; padding: 30px; border: 1px solid var(--border-color);
    width: 80%; max-width: 600px; border-radius: 12px; position: relative; animation: slideIn 0.3s; margin-bottom: 50px;
}
.import-content.wide { max-width: 800px; } /* For Preview Modal */

/* Help Box (Details) */
details.help-box {
    background: rgba(255,255,255,0.05); border: 1px dashed #555; 
    border-radius: 8px; padding: 10px 15px; margin-bottom: 15px;
}
details.help-box summary { cursor: pointer; color: var(--accent-color); font-weight: bold; outline: none; }
details.help-box ol { margin: 10px 0 0 0; padding-left: 20px; color: #ccc; font-size: 0.9em; line-height: 1.5; }
details.help-box li { margin-bottom: 8px; }

/* Import Inputs */
.import-textarea { 
    width: 100%; padding: 10px; background: #222; color: white; 
    border: 1px solid #444; border-radius: 5px; margin-bottom: 15px; 
}
.import-input-row { display: flex; gap: 10px; margin-bottom: 15px; }
.import-input-row input {
    flex: 1;       /* Force the text box to fill available space */
    width: auto;   /* Override global width:100% to prevent layout bugs */
}

.import-input-row select {
    flex: 0 0 auto; /* Prevent the dropdown from shrinking or growing */
    width: auto;
}
.import-select { padding: 10px; border-radius: 5px; background: #333; color: white; border: 1px solid #444; }

.btn-analyze { width: 100%; padding: 12px; background: var(--accent-color); color: black; font-weight: bold; border: none; border-radius: 5px; cursor: pointer; }
.btn-create-import { width: 100%; padding: 12px; background: #2ecc71; color: white; font-weight: bold; border: none; border-radius: 5px; margin-top: 15px; display: none; cursor: pointer; }

/* Import Results Table */
.import-results-container { 
    margin-top: 20px; max-height: 200px; overflow-y: auto; 
    display: none; border-top: 1px solid #444; padding-top: 10px; 
}
.result-table { width: 100%; border-collapse: collapse; font-size: 0.9em; }
.result-row { border-bottom: 1px solid #333; }
.result-cell { padding: 5px; }
.result-cell.query { color: #aaa; }
.result-cell.status-found { color: var(--success); font-weight: bold; }
.result-cell.status-missing { color: var(--error); font-weight: bold; }

/* Preview Grid (Live Data) */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 15px; margin-top: 20px; }
.preview-item { text-align: center; }
.preview-poster { width: 100%; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.3); }
.preview-title { font-size: 0.85em; margin-top: 5px; font-weight: bold; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.preview-meta { font-size: 0.75em; color: #aaa; }
.close-btn { float: right; cursor: pointer; font-size: 24px; color: #aaa; }

/* =========================================
   7. SETTINGS PAGE
   ========================================= */
.settings-container { max-width: 800px; margin: 0 auto; }
.settings-header { text-align: center; margin-bottom: 40px; }

.setting-card { position: relative; overflow: hidden; }
.border-orange { border-top: 4px solid #e5a00d; }
.border-green { border-top: 4px solid #01d277; }
.border-purple { border-top: 4px solid #5c6bc0; }
.border-blue { border-top: 4px solid #3498db; }

.password-wrapper { position: relative; display: flex; align-items: center; }
.password-wrapper input { padding-right: 45px; }
.toggle-pass {
    position: absolute; right: 10px; background: none; border: none; 
    color: #888; cursor: pointer; font-size: 1.2em;
}

.test-wrapper {
    display: flex;
    gap: 10px;
}
.btn-test {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 0 15px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}
.btn-test:hover {
    background: var(--accent-color);
    color: black;
    border-color: var(--accent-color);
}
/* ------------------ */

.btn-save {
    width: 100%; padding: 15px; background: var(--accent-color);
}

.btn-save {
    width: 100%; padding: 15px; background: var(--accent-color); 
    color: #121212; font-weight: bold; font-size: 1.1em; margin-top: 20px;
    border: none; border-radius: 8px; cursor: pointer;
}

.danger-zone {
    margin-top: 50px; border: 1px solid var(--error); 
    background: rgba(231, 76, 60, 0.05); padding: 25px; border-radius: 12px;
}

#message-container { text-align: center; margin-bottom: 20px; min-height: 50px; }

.info-panel {
    background: rgba(0,0,0,0.2); padding: 15px; 
    border-radius: 8px; margin-top: 10px;
}

.highlight-box {
    padding: 15px; border-radius: 8px;
}
.highlight-box.green-dashed {
    background: rgba(1, 210, 119, 0.05); 
    border: 1px dashed #01d277;
}

.ignore-label { color: var(--accent-color); font-weight: 600; display:block; margin-bottom:10px; }

.ignore-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
    gap: 10px; margin-top: 10px;
}
.ignore-check-label {
    font-weight: normal; font-size: 0.9em; cursor: pointer; color: var(--text-color);
}

.flex-row-wrap { display: flex; gap: 20px; flex-wrap: wrap; }
.flex-item { flex: 1; min-width: 200px; }

.backup-controls {
    display:flex; justify-content:space-between; align-items:center; margin-bottom:15px;
}
.backup-list {
    max-height:200px; overflow-y:auto; background:rgba(0,0,0,0.2); 
    border-radius:4px; padding:10px;
}

/* =========================================
   8. REVIEW & GENERATE PAGE
   ========================================= */
.step-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.btn-lucky-glow {
    background: linear-gradient(45deg, #FFD700, #FFA500); color: black; 
    padding: 10px 25px; border-radius: 30px; 
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.filter-grid { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 25px; }
.filter-col { flex: 1; min-width: 250px; }

.provider-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.provider-check input { display: none; }
.provider-check label { 
    cursor: pointer; border: 2px solid transparent; border-radius: 10px; 
    overflow: hidden; display: block; opacity: 0.4; transition: 0.2s;
}
.provider-check img { width: 50px; height: 50px; display: block; }
.provider-check input:checked + label { border-color: var(--accent-color); opacity: 1; transform: scale(1.1); }

/* Selection Cards */
.selection-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 20px; }
.selection-card {
    background: #1e1e1e; border-radius: 12px; overflow: hidden;
    border: 1px solid #333; position: relative; transition: transform 0.2s, opacity 0.3s;
}
.selection-poster { position: relative; aspect-ratio: 2/3; background: #111; }
.selection-poster img { width: 100%; height: 100%; object-fit: cover; }
.no-poster {
    height: 100%; display: flex; flex-direction: column; 
    align-items: center; justify-content: center; color: #555;
}

.selection-overlay { position: absolute; top: 10px; right: 10px; z-index: 2; }
.custom-check { width: 25px; height: 25px; cursor: pointer; accent-color: var(--accent-color); }

.btn-block-floating {
    position: absolute; top: 10px; left: 10px; z-index: 3;
    background: rgba(0, 0, 0, 0.6); border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--error); border-radius: 50%; width: 30px; height: 30px;
    display: flex; align-items: center; justify-content: center; transition: all 0.2s; padding: 0;
}
.btn-block-floating:hover { background: var(--error); color: white; transform: scale(1.1); border-color: var(--error); }

.selection-info { padding: 12px; }
.selection-title { 
    font-weight: bold; 
    font-size: 1.0em; /* Increased size */
    color: #ffffff !important; /* Force White */
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    margin-bottom: 2px;
}

/* Loading Overlay */
#loadingOverlay {
    display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.9); z-index: 9999; flex-direction: column;
    justify-content: center; align-items: center;
}
.spinner {
    width: 60px; height: 60px; border: 6px solid rgba(255,255,255,0.1);
    border-radius: 50%; border-top-color: var(--accent-color); animation: spin 1s linear infinite;
}
@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}
/* GENRE GRID STYLES */
    .genre-selector {
        background: #1a1a1a;
        border: 1px solid #444;
        border-radius: 6px;
        padding: 15px;
    }
    .genre-header {
        display: flex;
        justify-content: space-between;
        margin-bottom: 10px;
        font-size: 0.85em;
        color: #888;
        border-bottom: 1px solid #333;
        padding-bottom: 5px;
    }
    .genre-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Two side by side */
        gap: 10px;
    }
    .genre-check {
        display: flex;
        align-items: center;
        background: #252525;
        padding: 8px 12px;
        border-radius: 4px;
        border: 1px solid #333;
        cursor: pointer;
        font-size: 0.9em;
        transition: 0.2s;
    }
    .genre-check:hover { background: #333; border-color: var(--accent-color); }
    .genre-check input { 
        accent-color: var(--accent-color); 
        margin-right: 10px; 
        cursor: pointer;
        transform: scale(1.2);
    }
    .genre-check label { 
        cursor: pointer; 
        width: 100%; 
        white-space: nowrap; 
        overflow: hidden; 
        text-overflow: ellipsis; 
        color: #ddd;
    }
    
    /* HIDDEN STATE */
    .hidden-genre { display: none; }
    
    .genre-expand {
        text-align: center;
        margin-top: 10px;
        padding-top: 8px;
        border-top: 1px dashed #333;
        font-size: 0.85em;
        color: var(--accent-color);
        cursor: pointer;
        font-weight: bold;
    }
    .genre-expand:hover { text-decoration: underline; }
	
/* =========================================
   9. BUILDER PAGE
   ========================================= */
.builder-container { max-width: 800px; margin: 20px auto; padding: 20px; }
.builder-card { 
    background: #1a1a1a; padding: 30px; border-radius: 12px; 
    border: 1px solid #333; box-shadow: 0 4px 15px rgba(0,0,0,0.3); 
}

.form-row { display: flex; gap: 20px; margin-bottom: 5px; }
.form-col { flex: 1; }
.year-inputs { display: flex; gap: 10px; }

.tag-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.keyword-tag { 
    background: var(--accent-color); color: black; padding: 4px 12px; 
    border-radius: 20px; font-size: 0.85em; font-weight: bold; 
    display: flex; align-items: center; gap: 5px;
}
.keyword-tag span { cursor: pointer; font-size: 1.2em; }

.keyword-dropdown {
    background: #2a2a2a; border: 1px solid #444; position: absolute; z-index: 100;
    width: 100%; max-height: 200px; overflow-y: auto; display: none; margin-top: 60px;
}
.dropdown-item { padding: 10px; cursor: pointer; border-bottom: 1px solid #333; }
.dropdown-item:hover { background: #333; }

.tag-help-box {
    margin-top: 15px; padding: 12px; background: rgba(241, 196, 15, 0.1);
    border-left: 4px solid var(--accent-color); border-radius: 4px; 
    font-size: 0.85em; color: #ccc; line-height: 1.4;
}
.tag-help-box strong { color: var(--accent-color); display: block; margin-bottom: 4px; }

.preview-card { 
    background: #111; padding: 20px; border-radius: 12px; 
    margin-top: 20px; border: 1px solid var(--accent-color); display: none;
}
.preview-list { list-style: none; padding: 0; }
.btn-request-all {
    background: var(--error); color: white; border: none; padding: 10px; 
    width: 100%; border-radius: 6px; cursor: pointer; margin-top: 15px; font-weight: bold; display: none;
}

/* =========================================
   10. BLOCKLIST & STATS
   ========================================= */
.tab-btn { padding: 10px 20px; background: #444; color: #aaa; border: none; cursor: pointer; font-size: 1.1em; }
.tab-btn.active { background: var(--accent-color); color: black; font-weight: bold; }

.block-list-container { margin-top: 20px; }
.block-grid { display: grid; gap: 10px; }

.block-item {
    background: var(--card-bg); padding: 15px; border-radius: 8px; border: 1px solid #333;
    display: flex; justify-content: space-between; align-items: center; text-align: left;
}
.block-title { font-size: 1.1em; font-weight: 500; }
.btn-unblock {
    background: transparent; border: 1px solid var(--error); 
    color: var(--error); padding: 5px 10px; cursor: pointer; border-radius: 4px;
}
.btn-unblock:hover { background: var(--error); color: white; }

#suggestions {
    position: absolute; width: 100%; background: #333; z-index: 100; 
    border: 1px solid #555; display: none; max-height: 300px; overflow-y: auto;
}
.suggestion-item {
    padding: 10px; border-bottom: 1px solid #444; cursor: pointer;
    display: flex; align-items: center; gap: 10px;
}
.suggestion-item:hover { background: #444; }

/* Stats Chart Containers */
.chart-card { background: #252525; padding: 15px; border-radius: 8px; border: 1px solid #333; }
.stats-controls {
    display: flex; gap: 10px; align-items: center; background: #252525; 
    padding: 5px; border-radius: 8px; border: 1px solid #333;
}

/* =========================================
   11. FORM FIXES (Slider & Buttons)
   ========================================= */

/* 1. Custom Range Slider (Gold Theme) */
input[type=range] {
    -webkit-appearance: none; /* Override default look */
    width: 100%; 
    background: transparent; 
    margin: 10px 0;
}

input[type=range]:focus { outline: none; }

/* The Track (Grey Line) */
input[type=range]::-webkit-slider-runnable-track {
    width: 100%; 
    height: 6px; 
    cursor: pointer;
    background: #444; 
    border-radius: 3px;
}

/* The Thumb (Gold Dot) */
input[type=range]::-webkit-slider-thumb {
    height: 20px; 
    width: 20px; 
    border-radius: 50%;
    background: var(--accent-color); 
    cursor: pointer;
    -webkit-appearance: none; 
    margin-top: -7px; /* Centers thumb on track */
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* 3. Fix Button Widths in Builder */
.builder-card .btn-secondary {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    font-size: 1.1em;
    margin-top: 25px;
    background: rgba(229, 160, 13, 0.1); /* Slight gold tint background */
}

.builder-card .btn-secondary:hover {
    background: rgba(229, 160, 13, 0.2);
}

/* 4. Firefox Support (Add this to style.css) */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #444;
    border-radius: 3px;
}

input[type=range]::-moz-range-thumb {
    height: 20px;
    width: 20px;
    border: none;
    border-radius: 50%;
    background: var(--accent-color); 
    cursor: pointer;
}

/* =========================================
   12. RESULTS PAGE SPECIFIC
   ========================================= */

/* --- Top Header & Navigation --- */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 0 10px;
}

.back-link {
    color: #888;
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.2s;
}
.back-link:hover { color: #fff; }

.results-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2em;
    font-weight: 700;
    color: #fff;
}

/* --- Main Layout --- */
.results-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* --- Horizontal Filter Card --- */
.filter-card {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 25px;
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.top-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    align-items: start;
}

.filter-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #ccc;
    font-weight: bold;
}

.filter-input {
    background: #111;
    border: 1px solid #444;
    color: white;
    padding: 12px;
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
}

/* --- Genre Grid (Horizontal) --- */
.genre-selector {
    background: #151515;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.genre-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #888;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.genre-check {
    display: flex;
    align-items: center;
    background: #252525;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #333;
    cursor: pointer;
    font-size: 0.9em;
    transition: 0.2s;
}
.genre-check:hover { background: #333; border-color: var(--accent-color); }

.genre-check input {
    accent-color: var(--accent-color);
    margin-right: 10px;
    cursor: pointer;
    transform: scale(1.1);
}

.genre-check label {
    cursor: pointer;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #ddd;
}

.hidden-genre { display: none; }

.genre-expand {
    text-align: center;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #333;
    font-size: 0.85em;
    color: var(--accent-color);
    cursor: pointer;
    font-weight: bold;
}
.genre-expand:hover { text-decoration: underline; }

/* --- Spin Button --- */
#spin-btn {
    background: linear-gradient(45deg, #e5a00d, #f1c40f);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 4px 15px rgba(229,160,13,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}
#spin-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(229,160,13,0.5);
}
#spin-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* --- Results Grid & Cards --- */
.results-main { width: 100%; }

#results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
}

/* --- Movie Card Styling --- */
.result-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    background: #1e1e1e;
    border: 1px solid #333;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}
.result-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 20px rgba(0,0,0,0.4); 
    border-color: var(--accent-color); 
    z-index: 5;
}

/* Poster */
.poster-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    background: #000;
}
.poster-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- OVERLAY LAYOUT (Fixed) --- */
.card-icon-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.5) 40%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Push everything to bottom */
    opacity: 0;
    transition: opacity 0.2s;
}
.result-card:hover .card-icon-overlay { opacity: 1; }

@media (hover: none) {
    .card-icon-overlay { opacity: 1; background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.1)); }
}

/* Block Button Wrapper (Pushes to right, sits above bottom row) */
.overlay-top-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px; /* Space between Block and Bottom Row */
}

/* Bottom Row (Overseerr Left - Gap - Right Icons) */
.overlay-bottom-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.icon-group-right {
    display: flex;
    gap: 10px;
}

/* Icon Buttons */
.icon-btn {
    width: 36px; height: 36px;
    background: rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    display: flex; 
    justify-content: center; 
    align-items: center;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    cursor: pointer;
    color: white;
    font-size: 1.1em;
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
.icon-btn:hover { 
    background: var(--accent-color); 
    color: black; 
    transform: scale(1.1); 
    border-color: var(--accent-color);
}

/* Request Button (Highlight - Bottom Left) */
.btn-request {
    border-color: var(--accent-color);
    color: var(--accent-color);
}
.btn-request:hover {
    background: var(--accent-color);
    color: black;
}

/* --- Card Text Info --- */
.card-info {
    padding: 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #1e1e1e;
    border-top: 1px solid #333;
}

.movie-title {
    margin: 0 0 6px 0;
    font-size: 0.95rem;
    line-height: 1.3;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Ratings Line (Year Left | Rating Right) */
.movie-meta-row {
    display: flex;
    justify-content: space-between; /* Pushes Year to left, Ratings to right */
    align-items: center;
    font-size: 0.85em;
    color: #aaa;
    margin-top: 4px;
    line-height: 1.2;
}

.meta-year { 
    font-weight: bold; 
    color: #ddd; 
    flex-shrink: 0;
}

.meta-right {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta-sep { color: #444; font-size: 0.8em; }

.meta-rating { 
    display: inline-flex; 
    align-items: center; 
    gap: 3px; 
    font-weight: bold;
}

/* Rating Colors */
.tmdb-score { color: var(--accent-color); } /* Gold */
.rt-fresh { color: #2ecc71; } /* Green */
.rt-rotten { color: #e74c3c; } /* Red */
.imdb-score { color: #f5c518; } /* Yellow */

/* TV Status (Top Right Overlay) */
.status-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    pointer-events: none;
}
.status-overlay.ended, .status-overlay.canceled { background-color: #dc3545; }
.status-overlay.returning-series { background-color: #198754; }
.status-overlay.in-production { background-color: #ffc107; color: #000; }
.status-overlay.planned { background-color: #0d6efd; }
.status-overlay.unknown { background-color: #6c757d; }

/* --- Wheel Animations --- */
.highlight-card {
    transform: scale(1.05);
    box-shadow: 0 0 20px #e5a00d !important;
    border-color: #e5a00d !important;
    z-index: 10;
    transition: all 0.1s;
}
.winner-card {
    animation: pulseGold 2s infinite;
    border: 3px solid #2ecc71 !important;
    box-shadow: 0 0 30px #2ecc71 !important;
}
@keyframes pulseGold {
    0% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(46, 204, 113, 0); }
    100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0); }
}

/* --- Load More & Spinner --- */
.load-more-wrapper { text-align: center; margin: 40px 0; }
.loading-container { text-align: center; padding: 60px 20px; }
.loader {
    margin: 0 auto 20px;
    border: 4px solid #333;
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    width: 50px; height: 50px;
    animation: spin 1s linear infinite;
}

/* --- CUSTOM MODAL (Fixed Overlay) --- */
.k-modal { 
    display: none; 
    position: fixed; 
    z-index: 3000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    overflow: hidden; 
    background-color: rgba(0,0,0,0.85); 
    backdrop-filter: blur(5px);
    align-items: center;
    justify-content: center;
}

.k-modal-content { 
    background-color: #1e1e1e; 
    padding: 0; 
    border: 1px solid #444; 
    width: 90%; 
    max-width: 850px; 
    max-height: 90vh; 
    overflow-y: auto; 
    border-radius: 12px; 
    position: relative; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    animation: zoomIn 0.2s ease-out;
}

@keyframes zoomIn { 
    from { transform: scale(0.95); opacity: 0; } 
    to { transform: scale(1); opacity: 1; } 
}

.k-close-modal { 
    color: #ddd; 
    position: absolute; 
    top: 10px; 
    right: 15px; 
    font-size: 35px; 
    font-weight: bold; 
    cursor: pointer; 
    z-index: 100;
    line-height: 1;
    transition: color 0.2s;
}
.k-close-modal:hover { color: #fff; text-shadow: 0 0 10px rgba(255,255,255,0.5); }

.modal-body { 
    padding: 30px; 
    display: flex; 
    gap: 30px; 
    flex-wrap: wrap; 
}

.modal-poster { 
    flex: 1; 
    min-width: 250px; 
    max-width: 300px; 
}

.modal-poster img { 
    width: 100%; 
    border-radius: 8px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); 
}

.modal-info { 
    flex: 2; 
    min-width: 280px; 
    display: flex;
    flex-direction: column;
}

.modal-info h2 { margin-top: 0; color: white; line-height: 1.2; }
.modal-overview { line-height: 1.6; color: #ddd; font-size: 1rem; margin-top: 10px; }

.request-btn {
    width: 100%; margin-top: 20px; padding: 12px;
    background: var(--accent-color); color: #121212;
    font-weight: bold; font-size: 1.1em; border: none;
    border-radius: 8px; cursor: pointer; transition: opacity 0.2s;
}
.request-btn:hover { opacity: 0.9; }

/* Mobile Tweaks */
@media (max-width: 700px) {
    .modal-body { flex-direction: column; }
    .modal-poster { max-width: 100%; margin: 0 auto; }
    .k-modal-content { width: 95%; max-height: 85vh; }
}

/* =========================================
   12. RATING BADGES (Poster Overlay)
   ========================================= */
.poster-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
    pointer-events: none; /* Let clicks pass through to the movie */
}

.badge-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    color: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    width: fit-content;
    line-height: 1;
}

.badge-tmdb {
    background: rgba(1, 180, 228, 0.9); /* TMDB Blue */
    border: 1px solid rgba(255,255,255,0.15);
}

.badge-rt-fresh {
    background: rgba(250, 50, 10, 0.9); /* Fresh Red */
    border: 1px solid rgba(255,255,255,0.15);
}

.badge-rt-rotten {
    background: rgba(89, 158, 160, 0.9); /* Rotten Green/Splash */
    border: 1px solid rgba(255,255,255,0.15);
}

/* =========================================
   13. SETTINGS MODAL (Success/Error Popup)
   ========================================= */

/* Modal Background Overlay */
.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(3px);
    z-index: 9999;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
}

/* Modal Box */
.custom-modal-box {
    background: #1e1e1e; /* Dark theme background */
    border: 1px solid #333;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 15px 40px rgba(0,0,0,0.6);
    transform: translateY(20px);
    animation: slideUp 0.3s forwards;
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

/* Icon Styling */
.modal-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
    display: block;
}

/* Text Styling */
.modal-title { margin: 0 0 10px 0; color: white; font-weight: 700; }
.modal-message { color: #aaa; margin-bottom: 25px; line-height: 1.5; }

/* Button Styling */
.modal-btn {
    background: var(--accent-color, #e5a00d);
    color: black;
    border: none;
    padding: 10px 30px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.1s;
}
.modal-btn:hover { transform: scale(1.05); }

/* --- ADDED FOR RESULTS LOADER --- */
.loader-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}
.load-more-btn {
    background: transparent;
    border: 2px solid #444;
    color: var(--text-color);
    padding: 12px 30px;
    font-size: 1.1em;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.load-more-btn:hover { border-color: var(--accent-color); color: var(--accent-color); 
}
/* =========================================
   GLOBAL LOADER (Required for base.html)
   ========================================= */
#global-loader {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: rgba(0,0,0,0.95);
    z-index: 2147483647; /* Max Z-Index to stay on top */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(5px);
}

.global-spinner {
    width: 60px; 
    height: 60px;
    border: 6px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color, #e5a00d);
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}
#global-loader {
    display: none;
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background: rgba(0,0,0,0.95);
    z-index: 2147483647; /* Max integer value to be on top of EVERYTHING */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    backdrop-filter: blur(5px);
}

.global-spinner {
    width: 60px; 
    height: 60px;
    border: 6px solid rgba(255,255,255,0.1);
    border-radius: 50%;
    border-top-color: var(--accent-color, #e5a00d);
    animation: spin 1s linear infinite;
    margin-bottom: 25px;
}

@keyframes spin { 
    to { transform: rotate(360deg); } 
}

/* 2. Auto-Grey Out Buttons */
/* This automatically makes any disabled button look processed */
.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
    pointer-events: none;
}
/* =========================================
   RESULTS PAGE LAYOUT (SIDEBAR + ICONS)
   ========================================= */

.results-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    max-width: 1400px;
    margin: 0 auto;
}

.filter-sidebar {
    width: 280px;
    background: #1e1e1e;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #333;
    position: sticky;
    top: 20px;
    flex-shrink: 0;
}
.filter-group { margin-bottom: 25px; }
.filter-label { display: block; color: var(--accent-color); font-weight: bold; margin-bottom: 10px; }
.filter-input { 
    width: 100%; padding: 10px; background: #111; 
    border: 1px solid #444; color: white; border-radius: 6px; 
}

.results-main { flex: 1; width: 100%; }
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.result-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #111;
    border: 1px solid #333;
    transition: transform 0.2s;
}
.result-card:hover { transform: scale(1.03); border-color: var(--accent-color); z-index: 10; }

.card-icon-overlay {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 10px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    display: flex;
    justify-content: space-between; 
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.2s;
}
.result-card:hover .card-icon-overlay { opacity: 1; 
}

.icon-btn {
    width: 36px; height: 36px; /* Slightly larger touch target */
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex; 
    justify-content: center; 
    align-items: center;
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    cursor: pointer;
    color: white;
    text-decoration: none;
    font-size: 1.1em; /* Fixes emoji alignment */
    line-height: 1;
    padding: 0;
}

.icon-btn:hover { 
    background: var(--accent-color); 
    color: black; 
    transform: scale(1.1); 
    border-color: var(--accent-color);
}

/* Fix the text buttons in the Modal */
.btn-secondary {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}
.btn-secondary:hover {
    background: #555;
    border-color: #777;
}
@media (max-width: 900px) {
    .results-container {
        flex-direction: column;
    }
    .filter-sidebar {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 20px;
        box-sizing: border-box; 
    }
    .card-icon-overlay {
        opacity: 1 !important; 
        background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.1));
    }
}

/* CONTENT MANAGEMENT (Settings Page) */
.btn-content {
    width: 100%;
    border: 1px solid #666;
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.2s;
}
.btn-content:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
}
/* =========================================
   14. SYNC & CACHE SETTINGS
   ========================================= */
.border-info { border-top: 4px solid #3498db; }

.sync-warning-box {
    background: rgba(255, 255, 255, 0.05); padding: 10px; 
    border-radius: 5px; border-left: 3px solid #f39c12; 
    margin-bottom: 20px; font-size: 0.9em;
}

.cache-control-row {
    display: flex; gap: 20px; align-items: flex-end; 
    flex-wrap: wrap; border-top: 1px solid #333; padding-top: 15px;
}

.scanner-row {
    display: flex; align-items: flex-end; gap: 15px; flex-wrap: wrap;
}

/* Spacer column for layout */
.spacer-col-1 { width: 8.33%; } 

@media (max-width: 768px) {
    .spacer-col-1 { display: none; }
    .scanner-row { flex-direction: column; align-items: stretch; }
}
/* =========================================
   15. SETTINGS TABS (New)
   ========================================= */
.settings-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    border-bottom: 1px solid #333;
}

.tab-link {
    padding: 15px 30px;
    background: transparent;
    border: none;
    color: #777;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 3px solid transparent;
}

.tab-link:hover {
    color: #aaa;
}

.tab-link.active {
    color: var(--accent-color);
    border-bottom: 3px solid var(--accent-color);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
/* --- FIX: Force Header Text Visibility --- */
.text-muted, .form-text, small {
    color: #cccccc !important; /* Light grey so it's visible on dark backgrounds */
}

/* --- FIX: Force Tag Visibility --- */
.keyword-tag {
    background-color: var(--accent-color) !important;
    color: #000000 !important; /* Force black text on the gold tag */
    font-weight: bold;
    border: 1px solid #fff;
}

/* --- FIX: Input Text Visibility --- */
input, select, textarea {
    color: #ffffff !important;
    background-color: #222 !important;
}
input::placeholder {
    color: #888 !important;
}
.nav-icon-group {
    display: flex;
    align-items: center;
    gap: 20px; /* Space between icons */
    margin-right: 25px; /* Space between icons and Logout button */
    padding-right: 25px;
    border-right: 1px solid #444; /* Optional separator line */
}

.nav-icon-group a {
    text-decoration: none;
    font-size: 1.3em;
    transition: transform 0.2s;
    display: flex;
    align-items: center;
}

.nav-icon-group a:hover {
    transform: scale(1.15);
    filter: brightness(1.2);
}
.scanner-row label {
    color: #ffffff !important;
    margin-bottom: 5px;
    display: block;
}

.dropdown-item {
    color: #ffffff !important;
    background-color: #2a2a2a;
    padding: 10px;
    border-bottom: 1px solid #444;
}
.dropdown-item:hover {
    background-color: var(--accent-color) !important;
    color: #000000 !important;
}

.card-icon-group {
    display: flex;
    gap: 10px;
}
.scanner-row label {
    color: #ffffff !important;
    display: block;
    margin-bottom: 5px;
}

.keyword-dropdown {
    background-color: #2a2a2a;
    border: 1px solid #444;
}
.dropdown-item {
    color: #ffffff !important;
    padding: 10px;
    border-bottom: 1px solid #333;
    cursor: pointer;
}
.dropdown-item:hover {
    background-color: var(--accent-color);
    color: #000000 !important;
}

.card-icon-group {
    display: flex;
    gap: 10px;
}
.btn-save:hover {
    background-color: var(--accent-color) !important;
    color: #000000 !important; /* Force text to be black */
    opacity: 1 !important;
    filter: brightness(1.1); /* Slightly brighter on hover */
}

.backup-actions i {
    cursor: pointer;
    font-size: 1.1em;
    transition: transform 0.2s;
}
.backup-actions i:hover {
    transform: scale(1.2);
}
.btn-lucky:hover {
    background-color: #8e44ad !important; /* Force darker purple */
    color: #ffffff !important;           /* Force white text */
    opacity: 1 !important;
    transform: scale(1.02);              /* Slight pop effect */
    box-shadow: 0 0 15px rgba(155, 89, 182, 0.6); /* Purple Glow */
}
.btn-scan:hover {
    color: #ffffff !important;
    filter: brightness(1.1);
    opacity: 1 !important;
}
/* =========================================
   16. MISSING ANIMATIONS
   ========================================= */
.status-badge {
    font-size: 1.2em;
    display: inline-block;
    vertical-align: middle;
}

.pulse-live {
    animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); text-shadow: 0 0 0 rgba(46, 204, 113, 0.7); }
    70% { transform: scale(1.0); text-shadow: 0 0 10px rgba(46, 204, 113, 0); }
    100% { transform: scale(0.95); text-shadow: 0 0 0 rgba(46, 204, 113, 0); }
}
/* =========================================
   17. TV STATUS OVERLAYS
   ========================================= */
.status-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    z-index: 10;
    pointer-events: none;
}

/* Color Coding */
.status-overlay.ended { background-color: #dc3545; } /* Red */
.status-overlay.canceled { background-color: #dc3545; } /* Red */
.status-overlay.returning-series { background-color: #198754; } /* Green */
.status-overlay.in-production { background-color: #ffc107; color: #000; } /* Yellow */
.status-overlay.planned { background-color: #0d6efd; } /* Blue */
.status-overlay.unknown { background-color: #6c757d; } /* Grey */

.section-title {
    font-size: 1.5em;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
