@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --bg: #141414;
    --bg-darker: #0a0a0a;
    --surface: #1a1a1a;
    --surface-hover: #222;
    --border: #2a2a2a;
    --text: #e5e5e5;
    --text-dim: #808080;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.4);
    --green: #46d369;
    --red: #e50914;
    --font-display: 'Bebas Neue', sans-serif;
    --font-body: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --side-pad: clamp(16px, 4vw, 60px);
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.6);
    --shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.8), 0 0 30px rgba(99, 102, 241, 0.15);
    --radius: 6px;
    --radius-lg: 8px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ═══════════════════════════════════════
   CONTAINER & LAYOUT
   ═══════════════════════════════════════ */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3rem);
    color: #fff;
    margin: 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 20px var(--side-pad) 0;
    background: linear-gradient(180deg, var(--accent) 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.5vw, 1.35rem);
    color: #fff;
    text-transform: none;
    letter-spacing: -0.3px;
    margin: 0;
    font-weight: 700;
}

/* ═══════════════════════════════════════
   TAB NAVIGATION (Netflix-style nav)
   ═══════════════════════════════════════ */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-bottom: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px var(--side-pad);
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 8px 20px;
    background: none;
    border: none;
    border-bottom: none;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: color var(--transition-fast);
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    letter-spacing: 0.2px;
}

.tab:hover {
    color: #fff;
}

.tab.active {
    color: #fff;
    font-weight: 700;
    border-bottom: none;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ═══════════════════════════════════════
   SEARCH / INPUT ROW
   ═══════════════════════════════════════ */
.input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 0;
    padding: 12px var(--side-pad) 20px;
}

.input-row input {
    flex: 1;
    padding: 14px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 400;
    outline: none;
    min-width: 0;
    transition: border-color var(--transition-fast), background var(--transition-fast);
}

.input-row input::placeholder {
    color: #555;
}

.input-row input:focus {
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 0 0 1px var(--accent-glow);
}

.input-row button {
    padding: 14px 28px;
    border-radius: var(--radius);
    border: none;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    letter-spacing: 0.3px;
}

.input-row button:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.input-row button:disabled {
    background: #333;
    cursor: default;
    transform: none;
}

/* ═══════════════════════════════════════
   SECTION HEADERS
   ═══════════════════════════════════════ */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0;
    padding: 28px var(--side-pad) 14px;
}

.section-header h2 {
    margin: 0;
}

.btn-clear-search {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-dim);
    padding: 6px 16px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-clear-search:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* ═══════════════════════════════════════
   CONTINUE WATCHING — Netflix horizontal rail
   ═══════════════════════════════════════ */
.continue-watching-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 var(--side-pad) 20px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.continue-watching-grid::-webkit-scrollbar {
    display: none;
}

.continue-card {
    flex-shrink: 0;
    width: 300px;
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    position: relative;
    scroll-snap-align: start;
}

.continue-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
    z-index: 10;
    border-color: transparent;
}

.continue-thumbnail {
    width: 100%;
    height: 170px;
    object-fit: cover;
    background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
    position: relative;
}

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

.continue-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #333;
}

.continue-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(60, 60, 60, 0.7);
}

.continue-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s;
}

.continue-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    width: 50px;
    height: 50px;
    background: rgba(99, 102, 241, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-smooth);
    backdrop-filter: blur(8px);
}

.continue-card:hover .continue-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.continue-play-overlay::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 16px solid white;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    margin-left: 4px;
}

.continue-info {
    padding: 10px 12px;
    background: linear-gradient(180deg, var(--surface) 0%, rgba(20,20,20,0.95) 100%);
}

.continue-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.continue-meta {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.continue-time {
    color: #aaa;
}

.continue-badge {
    background: var(--green);
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.continue-badge.downloaded {
    background: var(--accent);
    color: #fff;
}

.continue-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.75);
    border: none;
    color: #aaa;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all var(--transition-fast);
    backdrop-filter: blur(4px);
}

.continue-card:hover .continue-remove {
    opacity: 1;
}

.continue-remove:hover {
    background: rgba(229, 9, 20, 0.85);
    color: white;
}

/* ═══════════════════════════════════════
   SEARCH RESULTS — Netflix poster grid
   ═══════════════════════════════════════ */
.search-section-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 20px 0 12px;
    padding: 0 var(--side-pad);
    font-weight: 600;
}

.search-results-inline {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-bottom: 24px;
    padding: 0 var(--side-pad);
}

@media (min-width: 640px) {
    .search-results-inline {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 10px;
    }
}

@media (min-width: 1024px) {
    .search-results-inline {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
}

.local-result {
    border: 2px solid var(--green) !important;
}

.local-result:hover {
    border-color: var(--green) !important;
    box-shadow: 0 0 20px rgba(70, 211, 105, 0.15);
}

/* Library Controls */
.library-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    padding: 0 var(--side-pad);
}

.library-controls input {
    flex: 1;
    min-width: 200px;
    padding: 14px 20px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.9rem;
    outline: none;
}

.library-controls input:focus {
    border-color: var(--accent);
}

.btn-new-folder {
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-new-folder:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
}

/* ═══════════════════════════════════════
   SEARCH RESULTS CARDS
   ═══════════════════════════════════════ */
.search-results {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 0;
    padding: 0 var(--side-pad);
}

@media (min-width: 640px) {
    .search-results {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        gap: 10px;
    }
}

@media (min-width: 1024px) {
    .search-results {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 12px;
    }
}

.search-result {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
}

.search-result:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-hover);
    z-index: 10;
    border-color: transparent;
}

.search-result-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    background: #1a1a1a;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    position: relative;
}

@media (min-width: 640px) {
    .search-result-image {
        height: 260px;
    }
}

@media (min-width: 1024px) {
    .search-result-image {
        height: 280px;
    }
}

.search-result-info {
    padding: 10px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.search-result-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    min-height: 2.6em;
}

.search-result-meta {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.search-result-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

.type-movie {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.type-tvSeries {
    background: rgba(192, 132, 252, 0.15);
    color: #c084fc;
}

/* ═══════════════════════════════════════
   JOBS & VIDEO CARDS
   ═══════════════════════════════════════ */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: background var(--transition-fast);
}

.card:hover {
    background: var(--surface-hover);
}

@media (min-width: 640px) {
    .card {
        padding: 16px 20px;
    }
}

.card-content {
    display: flex;
    gap: 14px;
}

.card-thumbnail {
    width: 80px;
    height: 120px;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
    background: linear-gradient(135deg, #222 0%, #111 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 2rem;
}

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

@media (min-width: 640px) {
    .card-thumbnail {
        width: 90px;
        height: 135px;
    }
}

.card-details {
    flex: 1;
    min-width: 0;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.card-title {
    font-size: 0.88rem;
    color: #fff;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

@media (min-width: 640px) {
    .card-title {
        font-size: 0.95rem;
    }
}

.badge {
    font-size: 0.62rem;
    padding: 3px 10px;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.badge-pending {
    background: rgba(255, 255, 255, 0.08);
    color: #888;
}

.badge-active {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.badge-done {
    background: rgba(70, 211, 105, 0.15);
    color: var(--green);
}

.badge-failed {
    background: rgba(229, 9, 20, 0.15);
    color: #f87171;
}

.badge-resolution {
    background: rgba(167, 139, 250, 0.15);
    color: #a78bfa;
}

.card-badges {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.progress-bar {
    height: 3px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.card-meta {
    font-size: 0.72rem;
    color: var(--text-dim);
    margin-top: 6px;
}

.error-text {
    color: #f87171;
    font-size: 0.75rem;
    margin-top: 4px;
    word-break: break-word;
}

/* ═══════════════════════════════════════
   FOLDER CARD — Netflix collection style
   ═══════════════════════════════════════ */
.folder-card {
    background: var(--surface);
    border: 2px dashed #333;
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition-smooth);
    cursor: pointer;
}

.folder-card:hover {
    border-color: var(--accent);
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
    z-index: 10;
}

.folder-card.drag-over {
    border-color: var(--green);
    background: rgba(70, 211, 105, 0.05);
}

.folder-thumbnail {
    width: 100%;
    height: 180px;
    background: #111;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    overflow: hidden;
}

@media (min-width: 640px) {
    .folder-thumbnail {
        height: 200px;
    }
}

@media (min-width: 1024px) {
    .folder-thumbnail {
        height: 240px;
    }
}

.folder-thumbnail-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #1a1a1a;
}

.folder-thumbnail-empty {
    background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 1.5rem;
}

.folder-info {
    padding: 10px 12px;
}

.folder-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.folder-count {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.folder-actions {
    display: flex;
    gap: 6px;
}

/* ═══════════════════════════════════════
   VIDEO GRID — Netflix poster layout
   ═══════════════════════════════════════ */
.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    margin-top: 0;
    padding: 0 var(--side-pad);
}

@media (min-width: 640px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        gap: 10px;
    }
}

@media (min-width: 1024px) {
    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
    }
}

.video-card {
    background: var(--surface);
    border: none;
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth);
    cursor: pointer;
    position: relative;
}

.video-card:hover {
    transform: scale(1.08);
    box-shadow: var(--shadow-hover);
    z-index: 10;
    border-color: transparent;
}

.video-card.dragging {
    opacity: 0.4;
}

.video-thumbnail {
    width: 100%;
    height: 180px;
    object-fit: cover;
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #111 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 3rem;
    position: relative;
}

@media (min-width: 640px) {
    .video-thumbnail {
        height: 200px;
    }
}

@media (min-width: 1024px) {
    .video-thumbnail {
        height: 240px;
    }
}

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

/* Netflix-style gradient overlay on thumbnails */
.video-card:hover .video-thumbnail::after,
.search-result:hover .search-result-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.7) 100%);
    pointer-events: none;
}

.video-info {
    padding: 10px 12px;
}

.video-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.3;
    min-height: 2.6em;
}

.video-meta {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.video-resolution {
    color: var(--green);
    font-weight: 700;
    margin-bottom: 2px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.btn-sm {
    flex: 1;
    min-width: 60px;
    padding: 7px 10px;
    border-radius: var(--radius);
    border: none;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

@media (min-width: 640px) {
    .btn-sm {
        padding: 8px 14px;
        font-size: 0.75rem;
    }
}

.btn-play {
    background: var(--accent);
    color: #fff;
}

.btn-play:hover {
    background: var(--accent-hover);
}

.btn-stream {
    background: var(--green);
    color: #000;
    font-weight: 800;
}

.btn-stream:hover {
    background: #3ec95d;
}

.btn-dl {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
}

.btn-dl:hover {
    background: rgba(99, 102, 241, 0.25);
}

.btn-del {
    background: rgba(255, 255, 255, 0.06);
    color: #888;
}

.btn-del:hover {
    background: rgba(229, 9, 20, 0.2);
    color: #f87171;
}

.btn-retry {
    background: #f59e0b;
    color: #000;
    margin-left: 8px;
    font-weight: 800;
}

.btn-retry:hover {
    background: #d97706;
}

.empty {
    color: #555;
    font-size: 0.9rem;
    font-style: normal;
    font-weight: 400;
    padding: 40px 20px;
    text-align: center;
}

/* ═══════════════════════════════════════
   MODAL — Netflix immersive player
   ═══════════════════════════════════════ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 100;
    justify-content: center;
    align-items: center;
    padding: 0;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: #181818;
    border-radius: 12px;
    padding: 0;
    width: 100%;
    max-width: 960px;
    max-height: 95vh;
    overflow: auto;
    overflow-y: scroll;
    -ms-overflow-style: none;
    scrollbar-width: none;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
}

.modal-content::-webkit-scrollbar {
    display: none;
}

@media (min-width: 640px) {
    .modal-content {
        margin: 20px;
    }
}

.modal-content video {
    width: 100%;
    border-radius: 0;
    background: #000;
    max-height: 70vh;
}

/* Video container for overlay positioning */
.video-container {
    position: relative;
    width: 100%;
    background: #000;
}

.video-container.fullscreen {
    background: #000;
}

.video-container:fullscreen,
.video-container:-webkit-full-screen {
    background: #000;
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-container:fullscreen video,
.video-container:-webkit-full-screen video {
    max-width: 100%;
    max-height: 100%;
    width: 100%;
    height: 100%;
}

.video-container:fullscreen .next-episode-overlay,
.video-container:-webkit-full-screen .next-episode-overlay {
    border-radius: 0;
    position: fixed;
    z-index: 2147483647;
}

/* Next episode countdown overlay */
.next-episode-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 0;
    z-index: 2147483647;
    backdrop-filter: blur(8px);
}

.next-episode-overlay.active {
    display: flex;
}

video:fullscreen~.next-episode-overlay,
video:-webkit-full-screen~.next-episode-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 0;
}

.next-episode-title {
    color: var(--text-dim);
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
}

.next-episode-name {
    color: #fff;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 24px;
    text-align: center;
    padding: 0 20px;
}

.countdown-circle {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 24px;
}

.countdown-circle svg {
    transform: rotate(-90deg);
    width: 80px;
    height: 80px;
}

.countdown-circle circle {
    fill: none;
    stroke-width: 4;
}

.countdown-circle .bg {
    stroke: #333;
}

.countdown-circle .progress {
    stroke: var(--accent);
    stroke-linecap: round;
    stroke-dasharray: 226;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear;
}

.countdown-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
}

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

.btn-play-now {
    background: #fff;
    color: #000;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.3px;
}

.btn-play-now:hover {
    background: rgba(255, 255, 255, 0.85);
}

.btn-cancel-next {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

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

.btn-play-fullscreen {
    background: var(--green);
    color: #000;
}

.btn-play-fullscreen:hover {
    background: #3ec95d;
}

.fullscreen-hint {
    margin-top: 16px;
    color: var(--text-dim);
    font-size: 0.8rem;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    gap: 12px;
    margin-bottom: 0;
    background: linear-gradient(180deg, rgba(24,24,24,1) 0%, rgba(24,24,24,0.95) 100%);
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-header h3 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .modal-header h3 {
        font-size: 1.1rem;
    }
}

.btn-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-fast);
}

.btn-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Loading indicator */
.loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #333;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.breadcrumb {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 12px;
    cursor: pointer;
    padding: 0 var(--side-pad);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.breadcrumb:hover {
    color: #fff;
}

/* ═══════════════════════════════════════
   FOOTBALL — Match cards
   ═══════════════════════════════════════ */
.football-section-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    text-transform: none;
    letter-spacing: -0.2px;
    margin: 24px 0 12px;
    padding: 0 var(--side-pad);
}

.football-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 0 var(--side-pad);
}

@media (min-width: 640px) {
    .football-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

@media (min-width: 1024px) {
    .football-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 14px;
    }
}

.football-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: all var(--transition-smooth);
}

.football-card:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.football-card.live {
    border-color: var(--red);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.1);
}

.football-card .fc-league {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    padding: 3px 10px;
    border-radius: 3px;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.football-card .fc-teams {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.football-card .fc-team {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
}

.football-card .fc-team:last-of-type {
    text-align: right;
}

.football-card .fc-vs {
    font-size: 0.7rem;
    color: #555;
    font-weight: 800;
    flex-shrink: 0;
}

.football-card .fc-status {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.football-card.live .fc-status {
    color: #f87171;
    font-weight: 700;
}

.football-card .fc-status .live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
    margin-right: 5px;
    animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.football-card .fc-actions {
    display: flex;
    gap: 8px;
}

.btn-generate-link {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: none;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-generate-link:hover {
    background: var(--accent-hover);
}

.btn-generate-link:active {
    transform: scale(0.97);
}

.btn-generate-link:disabled {
    background: #2a2a2a;
    color: #555;
    cursor: not-allowed;
}

.btn-generate-link.pending {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.btn-stream-football {
    flex: 1;
    padding: 10px 14px;
    border-radius: var(--radius);
    border: none;
    background: var(--red);
    color: #fff;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-stream-football:hover {
    background: #cc0812;
}

.btn-stream-football:active {
    transform: scale(0.97);
}

.btn-stream-football:disabled {
    background: #2a1515;
    color: #f87171;
    cursor: not-allowed;
}

.btn-stream-football.pending {
    background: #2a1515;
    color: #fca5a5;
}

.fc-link-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.fc-link-actions button {
    padding: 6px 12px;
    border-radius: var(--radius);
    border: none;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-copy-link {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
}

.btn-copy-link:hover {
    background: rgba(99, 102, 241, 0.3);
}

.btn-open-link {
    background: rgba(70, 211, 105, 0.1);
    color: var(--green);
}

.btn-open-link:hover {
    background: rgba(70, 211, 105, 0.2);
}

.fc-link-result {
    margin-top: 8px;
    padding: 8px 10px;
    background: rgba(99, 102, 241, 0.06);
    border-radius: var(--radius);
    font-size: 0.78rem;
    color: var(--text-dim);
    word-break: break-all;
}

.fc-link-result a {
    color: #a5b4fc;
    text-decoration: none;
}

.fc-link-result a:hover {
    text-decoration: underline;
}

/* ═══════════════════════════════════════
   EPISODE MODAL — Netflix episode selector
   ═══════════════════════════════════════ */
.modal-large {
    max-width: 960px;
    max-height: 90vh;
    overflow-y: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.modal-large::-webkit-scrollbar {
    display: none;
}

.loading-container {
    text-align: center;
    padding: 60px;
    color: var(--text-dim);
}

.loading-container .loading {
    width: 40px;
    height: 40px;
    border-width: 3px;
    margin: 0 auto 20px;
}

.episode-selector {
    padding: 20px;
}

.season-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    flex-wrap: wrap;
    border-bottom: 1px solid #333;
    padding-bottom: 0;
}

.season-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-dim);
    padding: 12px 20px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 0;
}

.season-tab:hover {
    color: #fff;
}

.season-tab.active {
    color: #fff;
    background: transparent;
    border-bottom-color: var(--accent);
    border-left: none;
    border-right: none;
    border-top: none;
}

.episode-count {
    font-size: 0.85rem;
    opacity: 0.7;
}

.seasons-container {
    position: relative;
}

.season-episodes {
    display: none;
}

.season-episodes.active {
    display: block;
}

.episode-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.episode-item {
    display: flex;
    gap: 16px;
    background: transparent;
    padding: 16px 12px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.episode-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: transparent;
}

.episode-image {
    flex-shrink: 0;
    width: 140px;
    height: 78px;
    border-radius: var(--radius);
    overflow: hidden;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

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

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

.episode-title {
    font-weight: 600;
    color: #fff;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.episode-number {
    display: inline-block;
    background: var(--accent);
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right: 8px;
    font-weight: 700;
}

.episode-plot {
    color: var(--text-dim);
    font-size: 0.82rem;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.episode-meta {
    color: #666;
    font-size: 0.78rem;
    display: flex;
    gap: 12px;
}

.btn-download-episode {
    background: var(--accent);
    color: white;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-download-episode:hover {
    background: var(--accent-hover);
}

.btn-stream-episode {
    background: var(--green);
    color: #000;
    border: none;
    padding: 10px 22px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.btn-stream-episode:hover {
    background: #3ec95d;
}

.episode-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .episode-buttons {
        flex-direction: row;
    }
}

.season-actions {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #333;
    display: flex;
    justify-content: center;
}

.btn-download-season {
    background: var(--accent);
    color: white;
    border: none;
    padding: 14px 36px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1rem;
    transition: all var(--transition-fast);
    letter-spacing: 0.3px;
}

.btn-download-season:hover {
    background: var(--accent-hover);
    transform: scale(1.02);
}

.notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ═══════════════════════════════════════
   STREAMING MODAL
   ═══════════════════════════════════════ */
.stream-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    color: var(--text-dim);
}

.stream-loading .loading {
    width: 50px;
    height: 50px;
    border-width: 3px;
    margin-bottom: 16px;
}

.stream-error {
    text-align: center;
    padding: 40px;
    color: #f87171;
}

.stream-error button {
    margin-top: 16px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius);
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 600;
    transition: all var(--transition-fast);
}

.stream-error button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.stream-info {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 0;
    padding: 10px 16px;
    font-size: 0.8rem;
    color: var(--text-dim);
    background: rgba(0, 0, 0, 0.3);
}

.stream-quality {
    background: var(--green);
    color: #000;
    padding: 2px 8px;
    border-radius: 3px;
    font-weight: 700;
    font-size: 0.7rem;
    text-transform: uppercase;
}

/* Search result action buttons */
.search-result-actions {
    display: flex;
    gap: 4px;
    padding: 0 10px 10px;
}

.search-result-actions button {
    flex: 1;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: none;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.btn-stream-small {
    background: var(--green);
    color: #000;
    font-weight: 800;
}

.btn-stream-small:hover {
    background: #3ec95d;
}

.btn-download-small {
    background: var(--accent);
    color: white;
}

.btn-download-small:hover {
    background: var(--accent-hover);
}

.btn-disabled,
.btn-download-small.btn-disabled,
.btn-download-episode.btn-disabled {
    background: #222 !important;
    color: #555 !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.btn-disabled:hover {
    transform: none !important;
    background: #222 !important;
}

/* ═══════════════════════════════════════
   DOWNLOADS TAB
   ═══════════════════════════════════════ */
#tab-jobs {
    padding: 0 var(--side-pad);
}

#tab-jobs h2 {
    margin: 24px 0 14px;
}

/* ═══════════════════════════════════════
   MOVIEORCA TAB
   ═══════════════════════════════════════ */
#tab-movieorca .input-row {
    max-width: 700px;
}

/* ═══════════════════════════════════════
   RESPONSIVE: Mobile first adjustments
   ═══════════════════════════════════════ */
@media (max-width: 639px) {
    .continue-card {
        width: 260px;
    }
    
    .football-card {
        padding: 14px;
    }
    
    .episode-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .episode-image {
        width: 100%;
        height: 160px;
    }
    
    .episode-buttons {
        width: 100%;
    }
    
    .episode-buttons button {
        flex: 1;
    }
}

/* ═══════════════════════════════════════
   SCROLLBAR GLOBAL
   ═══════════════════════════════════════ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #444;
}

/* ═══════════════════════════════════════
   SELECTION
   ═══════════════════════════════════════ */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: #fff;
}

/* ---------------------------------------------------------------------------
   LATEST MOVIES & EPISODES — Grid Layout (Desktop)
   --------------------------------------------------------------------------- */

/* Grid layout for the full tab view */
.latest-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    padding: 0 var(--side-pad) 20px;
}

/* Load more row */
.latest-load-more-row {
    text-align: center;
    padding: 20px 0 10px;
}

/* Card styling */
.latest-card {
    background: #1a1a2e;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.latest-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Poster area */
.latest-poster {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    background: linear-gradient(135deg, #1c1c2e 0%, #0d0d1a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.latest-poster-text {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px;
    word-break: break-word;
    line-height: 1.3;
}

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

.latest-play-overlay::after {
    content: '▶';
    font-size: 2rem;
    color: #fff;
}

.latest-card:hover .latest-play-overlay {
    opacity: 1;
}

/* Info section */
.latest-info {
    padding: 10px 12px 4px;
    flex: 1;
}

.latest-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e5e5e5;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.latest-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.latest-quality {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
}

.latest-ep-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
}

/* Action buttons */
.latest-actions {
    display: flex;
    gap: 6px;
    padding: 6px 12px 12px;
}

.latest-actions .btn-stream-small,
.latest-actions .btn-download-small {
    flex: 1;
    padding: 6px 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: background 0.15s ease;
}

.btn-stream-small {
    background: #7c3aed;
    color: #fff;
}

.btn-stream-small:hover {
    background: #6d28d9;
}

.btn-download-small {
    background: #374151;
    color: #d1d5db;
}

.btn-download-small:hover {
    background: #4b5563;
}

/* Responsive breakpoints */
@media (max-width: 640px) {
    .latest-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
}

@media (min-width: 1200px) {
    .latest-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}
/* ═══════════════════════════════════════
   VIDEO CARD WATCH PROGRESS BAR
   ═══════════════════════════════════════ */
.video-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(60, 60, 60, 0.7);
}

.video-progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.video-progress-fill.watched {
    background: var(--green);
}
/* ═══════════════════════════════════════════
   SSE PROGRESS BARS
   ═══════════════════════════════════════════ */
.sse-progress-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px 0;
}
.sse-progress-label {
    font-size: 0.95rem;
    color: #e2e4e9;
    font-weight: 500;
}
.sse-progress-bar-track {
    width: 100%;
    height: 6px;
    background: #1e2030;
    border-radius: 3px;
    overflow: hidden;
}
.sse-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #818cf8);
    border-radius: 3px;
    transition: width 0.4s ease;
    min-width: 0;
}
.sse-progress-detail {
    font-size: 0.8rem;
    color: #6b7280;
}
/* ---------------------------------------------------------------------------
   RECENT SEARCHES
   --------------------------------------------------------------------------- */
.recent-searches-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 var(--side-pad) 20px;
}
.recent-search-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 8px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    max-width: 260px;
    white-space: nowrap;
}
.recent-search-pill:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.25);
}
.recent-search-pill img {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}
.recent-search-pill .pill-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: #1e2030;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.recent-search-pill .pill-label {
    font-size: 0.82rem;
    font-weight: 500;
    color: #c8cad0;
    overflow: hidden;
    text-overflow: ellipsis;
}
.recent-search-pill .pill-type {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6366f1;
    flex-shrink: 0;
}
.recent-search-pill .pill-remove {
    background: none;
    border: none;
    color: #4b5060;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 2px 0 2px 4px;
    line-height: 1;
    transition: color 0.15s;
    flex-shrink: 0;
}
.recent-search-pill .pill-remove:hover {
    color: #f87171;
}
/* ═══════════════════════════════════════
   SEARCH RESULT PROGRESS BARS
   Shows previously-watched progress on search result cards.
   ═══════════════════════════════════════ */

.search-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0 0 4px 4px;
    overflow: hidden;
    z-index: 2;
}

.search-progress-fill {
    height: 100%;
    background: #6366f1;
    border-radius: 0 0 0 4px;
    transition: width 0.3s ease;
}

.search-progress-fill.watched {
    background: #22c55e;
}

.search-watched-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: rgba(99, 102, 241, 0.9);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    z-index: 3;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

/* ═══════════════════════════════════════
   EPISODE PROGRESS BARS (in episode selector)
   ═══════════════════════════════════════ */

.episode-image {
    position: relative;
}

.ep-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0 0 var(--radius) var(--radius);
    overflow: hidden;
}

.ep-progress-fill {
    height: 100%;
    background: #6366f1;
    transition: width 0.3s ease;
}

.ep-progress-fill.watched {
    background: #22c55e;
}