/* ===== base.html ===== */
        :root {
            --bg-dark: #0f0f0f;
            --bg-card: #1a1a1a;
            --bg-hover: #252525;
            --text-primary: #ffffff;
            --text-secondary: #aaaaaa;
            --accent: #ff4444;
            --accent-hover: #ff6666;
            --border: #333333;
            --success: #4ade80;
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
            background-color: var(--bg-dark);
            color: var(--text-primary);
            line-height: 1.6;
            min-height: 100vh;
        }

        a {
            color: var(--accent);
            text-decoration: none;
        }

        a:hover {
            color: var(--accent-hover);
        }

        .container {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 20px;
        }

        /* ============ Header ============ */
        header {
            background: var(--bg-card);
            border-bottom: 1px solid var(--border);
            padding: 12px 0;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-content {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .logo {
            font-size: 1.3rem;
            font-weight: bold;
            color: var(--text-primary);
            white-space: nowrap;
        }

        .logo span {
            color: var(--accent);
        }

        .nav-links {
            display: flex;
            gap: 5px;
        }

        .nav-link {
            color: var(--text-secondary);
            padding: 8px 14px;
            border-radius: 6px;
            font-size: 0.9rem;
            transition: all 0.2s;
        }

        .nav-link:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .nav-link.active {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .search-form {
            flex: 1;
            max-width: 500px;
            position: relative;
        }

        .search-input {
            width: 100%;
            padding: 10px 18px;
            padding-right: 60px;
            border: 1px solid var(--border);
            border-radius: 25px;
            background: var(--bg-dark);
            color: var(--text-primary);
            font-size: 0.95rem;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--accent);
        }

        .search-shortcut {
            position: absolute;
            right: 14px;
            top: 50%;
            transform: translateY(-50%);
            background: var(--bg-hover);
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 0.7rem;
            color: var(--text-secondary);
            pointer-events: none;
        }

        .stats-bar {
            display: flex;
            gap: 15px;
            font-size: 0.85rem;
            color: var(--text-secondary);
            margin-left: auto;
        }

        .stat-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .stat-value {
            color: var(--text-primary);
            font-weight: 600;
        }

        .live-indicator {
            width: 8px;
            height: 8px;
            background: var(--success);
            border-radius: 50%;
            animation: pulse 2s infinite;
            margin-right: 5px;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.4; }
        }

        /* ============ Main ============ */
        main {
            padding: 25px 0;
            min-height: calc(100vh - 150px);
        }

        .section-title {
            font-size: 1.2rem;
            margin-bottom: 20px;
            color: var(--text-primary);
        }

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

        .section-header .section-title {
            margin-bottom: 0;
        }

        /* ============ Video Grid ============ */
        .video-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
            gap: 18px;
        }

        .video-card {
            background: var(--bg-card);
            border-radius: 10px;
            overflow: hidden;
            transition: transform 0.2s ease, box-shadow 0.2s ease;
            color: var(--text-primary);
            position: relative;
        }

        .video-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
            color: var(--text-primary);
        }

        .video-thumbnail {
            position: relative;
            aspect-ratio: 16 / 9;
            background: var(--bg-hover);
            overflow: hidden;
        }

        .video-thumbnail img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .video-card:hover .video-thumbnail img {
            transform: scale(1.05);
        }

        .video-duration {
            position: absolute;
            bottom: 8px;
            right: 8px;
            background: rgba(0, 0, 0, 0.9);
            padding: 3px 6px;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 500;
        }

        /* Watch Progress Bar */
        .watch-progress {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: rgba(255, 255, 255, 0.2);
        }

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

        /* Watched Badge */
        .watched-badge {
            position: absolute;
            top: 8px;
            left: 8px;
            background: rgba(0, 0, 0, 0.8);
            padding: 3px 8px;
            border-radius: 4px;
            font-size: 0.7rem;
            color: var(--success);
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .watched-badge::before {
            content: "✓";
        }

        .video-info {
            padding: 12px;
        }

        .video-title {
            font-size: 0.9rem;
            font-weight: 500;
            margin-bottom: 5px;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            line-height: 1.3;
        }

        .video-meta {
            font-size: 0.8rem;
            color: var(--text-secondary);
        }

        /* ============ Empty State ============ */
        .empty-state {
            text-align: center;
            padding: 60px 20px;
            color: var(--text-secondary);
        }

        .empty-state h2 {
            color: var(--text-primary);
            margin-bottom: 10px;
        }

        /* ============ Footer ============ */
        footer {
            border-top: 1px solid var(--border);
            padding: 15px 0;
            text-align: center;
            color: var(--text-secondary);
            font-size: 0.8rem;
        }

        .footer-content {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 20px;
            flex-wrap: wrap;
        }

        .footer-shortcuts {
            display: flex;
            gap: 15px;
            font-size: 0.75rem;
        }

        .footer-shortcuts kbd {
            background: var(--bg-hover);
            padding: 2px 6px;
            border-radius: 3px;
            margin-right: 4px;
        }

        /* ============ Command Palette ============ */
        .command-palette-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            z-index: 1000;
            display: none;
            align-items: flex-start;
            justify-content: center;
            padding-top: 15vh;
        }

        .command-palette-overlay.visible {
            display: flex;
        }

        .command-palette {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 12px;
            width: 90%;
            max-width: 600px;
            max-height: 70vh;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
            animation: paletteSlideIn 0.15s ease-out;
        }

        @keyframes paletteSlideIn {
            from {
                opacity: 0;
                transform: translateY(-20px) scale(0.95);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

        .command-input-wrapper {
            padding: 16px;
            border-bottom: 1px solid var(--border);
        }

        .command-input {
            width: 100%;
            padding: 12px 16px;
            border: none;
            background: var(--bg-dark);
            border-radius: 8px;
            color: var(--text-primary);
            font-size: 1rem;
        }

        .command-input:focus {
            outline: none;
        }

        .command-input::placeholder {
            color: var(--text-secondary);
        }

        .command-results {
            max-height: 400px;
            overflow-y: auto;
        }

        .command-section {
            padding: 8px 0;
        }

        .command-section-title {
            padding: 8px 16px;
            font-size: 0.75rem;
            color: var(--text-secondary);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .command-item {
            padding: 12px 16px;
            display: flex;
            align-items: center;
            gap: 12px;
            cursor: pointer;
            transition: background 0.1s;
        }

        .command-item:hover,
        .command-item.selected {
            background: var(--bg-hover);
        }

        .command-item-icon {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            background: var(--bg-dark);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            flex-shrink: 0;
        }

        .command-item-content {
            flex: 1;
            min-width: 0;
        }

        .command-item-title {
            font-size: 0.9rem;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .command-item-subtitle {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .command-item-shortcut {
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .command-item-shortcut kbd {
            background: var(--bg-dark);
            padding: 2px 6px;
            border-radius: 3px;
            margin-left: 4px;
        }

        .command-footer {
            padding: 12px 16px;
            border-top: 1px solid var(--border);
            display: flex;
            gap: 16px;
            font-size: 0.75rem;
            color: var(--text-secondary);
        }

        .command-footer kbd {
            background: var(--bg-dark);
            padding: 2px 6px;
            border-radius: 3px;
            margin-right: 4px;
        }

        /* ============ Toast Notifications ============ */
        .toast-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 1001;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .toast {
            background: var(--bg-card);
            border: 1px solid var(--border);
            padding: 12px 20px;
            border-radius: 8px;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
            animation: toastSlideIn 0.2s ease-out;
            display: flex;
            align-items: center;
            gap: 10px;
        }

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

        .toast.success {
            border-color: var(--success);
        }

        .toast.success::before {
            content: "✓";
            color: var(--success);
        }

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

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

        .skeleton-card {
            background: var(--bg-card);
            border-radius: 10px;
            overflow: hidden;
        }

        .skeleton-thumbnail {
            aspect-ratio: 16 / 9;
            background: var(--bg-hover);
        }

        .skeleton-info {
            padding: 12px;
        }

        .skeleton-title {
            height: 18px;
            margin-bottom: 8px;
            width: 90%;
        }

        .skeleton-meta {
            height: 14px;
            width: 60%;
        }

        /* ============ Responsive ============ */
        @media (max-width: 768px) {
            .header-content {
                flex-wrap: wrap;
            }

            .stats-bar {
                order: 3;
                width: 100%;
                justify-content: center;
                margin-top: 10px;
            }

            .search-form {
                order: 2;
                flex: 1 1 100%;
                max-width: 100%;
                margin-top: 10px;
            }

            .nav-links {
                order: 1;
            }

            .search-shortcut {
                display: none;
            }

            .footer-shortcuts {
                display: none;
            }

            .command-palette {
                width: 95%;
                margin: 10px;
            }
        }

        /* Loading overlay — shown while a search or pagination navigation
           is in flight, so the user sees something is happening. */
        .loading-overlay {
            position: fixed;
            inset: 0;
            background: rgba(15, 15, 15, 0.75);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
            backdrop-filter: blur(2px);
        }
        .loading-overlay.active {
            display: flex;
        }
        .loading-spinner {
            width: 64px;
            height: 64px;
            border: 5px solid rgba(255, 68, 68, 0.25);
            border-top-color: var(--accent);
            border-radius: 50%;
            animation: dw-spin 0.8s linear infinite;
            margin: 0 auto;
        }
        .loading-text {
            margin-top: 20px;
            text-align: center;
            color: var(--text-primary);
            font-size: 16px;
        }
        @keyframes dw-spin {
            to { transform: rotate(360deg); }
        }
    

/* ===== index.html ===== */
    .hero {
        text-align: center;
        padding: 50px 20px;
        background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-dark) 100%);
        border-radius: 12px;
        margin-bottom: 35px;
    }

    .hero h1 {
        font-size: 2.2rem;
        margin-bottom: 8px;
    }

    .hero h1 span {
        color: var(--accent);
    }

    .hero .catchphrase {
        font-style: italic;
        color: var(--text-secondary);
        font-size: 1.1rem;
        margin-bottom: 12px;
    }

    .hero p {
        color: var(--text-secondary);
        font-size: 1.05rem;
        max-width: 550px;
        margin: 0 auto 25px;
    }

    .search-hero {
        max-width: 550px;
        margin: 0 auto;
    }

    .search-hero input {
        width: 100%;
        padding: 16px 24px;
        font-size: 1.1rem;
        border-radius: 30px;
    }

    .stats-cards {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 15px;
        margin-bottom: 35px;
    }

    .stat-card {
        background: var(--bg-card);
        padding: 20px;
        border-radius: 10px;
        text-align: center;
    }

    .stat-card .value {
        font-size: 2rem;
        font-weight: 700;
        color: var(--accent);
        margin-bottom: 4px;
    }

    .stat-card .label {
        color: var(--text-secondary);
        font-size: 0.85rem;
    }

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

    .view-all {
        color: var(--text-secondary);
        font-size: 0.9rem;
        padding: 6px 12px;
        border: 1px solid var(--border);
        border-radius: 6px;
        transition: all 0.2s;
    }

    .view-all:hover {
        border-color: var(--accent);
        color: var(--text-primary);
    }

    /* Continue Watching Section */
    .continue-watching {
        margin-bottom: 35px;
    }

    .continue-watching .video-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 18px;
    }

    .continue-card {
        display: flex;
        gap: 12px;
        padding: 12px;
        background: var(--bg-card);
        border-radius: 10px;
        transition: all 0.2s;
    }

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

    .continue-thumb {
        width: 120px;
        min-width: 120px;
        aspect-ratio: 16/9;
        border-radius: 6px;
        overflow: hidden;
        background: var(--bg-dark);
        position: relative;
    }

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

    .continue-progress {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: rgba(255, 255, 255, 0.2);
    }

    .continue-progress-bar {
        height: 100%;
        background: var(--accent);
    }

    .continue-info {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    .continue-title {
        font-size: 0.9rem;
        font-weight: 500;
        color: var(--text-primary);
        margin-bottom: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .continue-meta {
        font-size: 0.8rem;
        color: var(--text-secondary);
        margin-bottom: 8px;
    }

    .continue-resume {
        margin-top: auto;
        font-size: 0.75rem;
        color: var(--accent);
    }

    /* On This Day Section */
    .on-this-day {
        margin-bottom: 35px;
        background: linear-gradient(135deg, rgba(255, 68, 68, 0.05) 0%, var(--bg-card) 100%);
        border-radius: 12px;
        padding: 25px;
    }

    .on-this-day .section-header {
        margin-bottom: 8px;
    }

    .on-this-day-subtitle {
        color: var(--text-secondary);
        font-size: 0.9rem;
        margin-bottom: 18px;
    }

    .on-this-day-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }

    .otd-card-wrapper {
        display: flex;
        flex-direction: column;
    }

    .otd-year-header {
        font-size: 1.8rem;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 10px;
        letter-spacing: -0.5px;
    }

    .otd-year-header span {
        color: var(--accent);
    }

    .otd-card {
        background: var(--bg-dark);
        border-radius: 8px;
        overflow: hidden;
        transition: all 0.2s;
    }

    .otd-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .otd-thumb {
        aspect-ratio: 16/9;
        position: relative;
    }

    .otd-thumb img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .otd-duration {
        position: absolute;
        bottom: 6px;
        right: 6px;
        background: rgba(0, 0, 0, 0.8);
        color: white;
        padding: 2px 6px;
        border-radius: 3px;
        font-size: 0.7rem;
    }

    .otd-info {
        padding: 12px;
    }

    .otd-title {
        font-size: 0.85rem;
        color: var(--text-primary);
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .empty-section {
        text-align: center;
        padding: 30px 20px;
        color: var(--text-secondary);
        background: var(--bg-card);
        border-radius: 10px;
    }

    .empty-section a {
        color: var(--accent);
    }

/* ===== browse.html ===== */
    .browse-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
        flex-wrap: wrap;
        gap: 15px;
    }

    .browse-title {
        font-size: 1.5rem;
    }

    .browse-filters {
        display: flex;
        gap: 15px;
        align-items: center;
        flex-wrap: wrap;
    }

    .filter-group {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .filter-group label {
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

    .filter-select {
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-primary);
        padding: 8px 12px;
        border-radius: 6px;
        font-size: 0.9rem;
        cursor: pointer;
    }

    .filter-select:focus {
        outline: none;
        border-color: var(--accent);
    }

    .year-pills {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }

    .year-pill {
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-secondary);
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.2s;
    }

    .year-pill:hover {
        border-color: var(--accent);
        color: var(--text-primary);
    }

    .year-pill.active {
        background: var(--accent);
        border-color: var(--accent);
        color: white;
    }

    .results-info {
        color: var(--text-secondary);
        margin-bottom: 20px;
        font-size: 0.9rem;
    }

    .pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin-top: 40px;
        flex-wrap: wrap;
    }

    .page-btn {
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-primary);
        padding: 10px 16px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
    }

    .page-btn:hover:not(:disabled) {
        border-color: var(--accent);
    }

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

    .page-btn.active {
        background: var(--accent);
        border-color: var(--accent);
    }

    .page-info {
        color: var(--text-secondary);
        padding: 0 15px;
    }

/* ===== search.html ===== */
    .search-results {
        margin-top: 20px;
    }

    .pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin-top: 40px;
        flex-wrap: wrap;
    }

    .page-btn {
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-primary);
        padding: 10px 16px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
    }

    .page-btn:hover:not(:disabled) {
        border-color: var(--accent);
    }

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

    .page-info {
        color: var(--text-secondary);
    }

    .result-video {
        background: var(--bg-card);
        border-radius: 12px;
        overflow: hidden;
        margin-bottom: 20px;
        display: flex;
        transition: box-shadow 0.2s;
    }

    .result-video:hover {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    .result-thumbnail {
        width: 280px;
        min-width: 280px;
        aspect-ratio: 16 / 9;
        background: var(--bg-hover);
        position: relative;
    }

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

    .result-duration {
        position: absolute;
        bottom: 8px;
        right: 8px;
        background: rgba(0, 0, 0, 0.8);
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.8rem;
    }

    .result-content {
        padding: 20px;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .result-title {
        font-size: 1.2rem;
        font-weight: 500;
        margin-bottom: 8px;
        color: var(--text-primary);
    }

    .result-title:hover {
        color: var(--accent);
    }

    .result-meta {
        color: var(--text-secondary);
        font-size: 0.9rem;
        margin-bottom: 15px;
    }

    .caption-matches {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: auto;
    }

    .caption-match-item {
        display: block;
        background: var(--bg-hover);
        padding: 12px 15px;
        border-radius: 8px;
        border-left: 3px solid var(--accent);
        cursor: pointer;
        transition: background 0.2s;
        text-decoration: none;
    }

    .caption-match-item:hover {
        background: var(--border);
    }

    .caption-timestamp {
        color: var(--accent);
        font-weight: 600;
        margin-right: 10px;
        font-family: monospace;
    }

    .caption-text {
        color: var(--text-secondary);
    }

    .caption-text mark {
        background: var(--accent);
        color: white;
        padding: 1px 4px;
        border-radius: 3px;
    }

    .match-badge {
        display: inline-block;
        background: var(--accent);
        color: white;
        font-size: 0.7rem;
        padding: 2px 8px;
        border-radius: 10px;
        margin-left: 10px;
        vertical-align: middle;
    }

    .no-results {
        text-align: center;
        padding: 80px 20px;
    }

    .no-results h2 {
        margin-bottom: 10px;
    }

    .search-tips {
        margin-top: 30px;
        text-align: left;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }

    .search-tips h3 {
        margin-bottom: 10px;
        color: var(--text-primary);
    }

    .search-tips ul {
        list-style: none;
        color: var(--text-secondary);
    }

    .search-tips li {
        padding: 5px 0;
    }

    .search-tips code {
        background: var(--bg-card);
        padding: 2px 6px;
        border-radius: 4px;
    }

    @media (max-width: 768px) {
        .result-video {
            flex-direction: column;
        }

        .result-thumbnail {
            width: 100%;
        }
    }

/* ===== video.html ===== */
    /* ============================================
       Video Detail Page - Premium UI/UX Design
       Inspired by Apple's attention to detail
       ============================================ */

    .video-page {
        height: calc(100vh - 70px);
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .video-layout {
        display: grid;
        grid-template-columns: 1fr 400px;
        gap: 0;
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    /* ---- Video Column ---- */
    .video-column {
        display: flex;
        flex-direction: column;
        overflow: hidden;
        background: #000;
    }

    .video-player-wrapper {
        position: relative;
        background: #000;
        flex-shrink: 0;
    }

    .video-player {
        width: 100%;
        aspect-ratio: 16 / 9;
        background: #000;
        display: block;
    }

    .video-poster {
        width: 100%;
        aspect-ratio: 16 / 9;
        object-fit: cover;
        cursor: pointer;
    }

    .play-overlay {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: rgba(0, 0, 0, 0.4);
        cursor: pointer;
        transition: background 0.3s ease;
    }

    .play-overlay:hover {
        background: rgba(0, 0, 0, 0.2);
    }

    .play-button {
        width: 80px;
        height: 80px;
        background: var(--accent);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: transform 0.2s ease;
        box-shadow: 0 4px 20px rgba(255, 68, 68, 0.4);
    }

    .play-overlay:hover .play-button {
        transform: scale(1.1);
    }

    .play-button::after {
        content: "";
        border-style: solid;
        border-width: 15px 0 15px 25px;
        border-color: transparent transparent transparent white;
        margin-left: 5px;
    }

    .no-local-msg {
        color: var(--text-secondary);
        font-size: 0.9rem;
        margin-top: 12px;
    }

    .playback-error-overlay {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.95);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        color: white;
    }

    .playback-error-overlay.visible {
        display: flex;
    }

    .playback-error-overlay p {
        margin-bottom: 15px;
    }

    .error-buttons {
        display: flex;
        gap: 10px;
    }

    /* ---- Video Info (scrollable) ---- */
    .video-info-scroll {
        flex: 1;
        overflow-y: auto;
        background: var(--bg-card);
    }

    .video-details {
        padding: 24px 28px;
    }

    .video-detail-title {
        font-size: 1.3rem;
        font-weight: 600;
        margin-bottom: 12px;
        line-height: 1.35;
        color: var(--text-primary);
    }

    .video-detail-meta {
        display: flex;
        gap: 20px;
        color: var(--text-secondary);
        margin-bottom: 16px;
        flex-wrap: wrap;
        font-size: 0.85rem;
    }

    .meta-item strong {
        color: var(--text-primary);
    }

    .video-description {
        color: var(--text-secondary);
        white-space: pre-wrap;
        line-height: 1.65;
        font-size: 0.9rem;
    }

    .video-actions {
        display: flex;
        gap: 10px;
        margin-top: 20px;
        padding-top: 20px;
        border-top: 1px solid var(--border);
        flex-wrap: wrap;
    }

    .action-btn {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        background: var(--bg-hover);
        padding: 10px 18px;
        border-radius: 8px;
        color: var(--text-primary);
        font-size: 0.85rem;
        transition: all 0.2s ease;
        border: none;
        cursor: pointer;
    }

    .action-btn:hover {
        background: var(--border);
        color: var(--text-primary);
    }

    .action-btn.favorite-btn.is-favorite {
        background: var(--accent);
        color: white;
    }

    .action-btn.favorite-btn .fav-icon {
        font-size: 1.1em;
    }

    .action-btn.favorite-btn.is-favorite .fav-icon {
        color: white;
    }

    /* ---- Transcript Panel ---- */
    .transcript-panel {
        display: flex;
        flex-direction: column;
        background: var(--bg-card);
        border-left: 1px solid var(--border);
        overflow: hidden;
    }

    .transcript-header {
        padding: 16px 20px;
        border-bottom: 1px solid var(--border);
        background: var(--bg-card);
        flex-shrink: 0;
    }

    .transcript-title-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }

    .transcript-header h2 {
        font-size: 0.95rem;
        color: var(--text-primary);
        font-weight: 600;
    }

    .auto-scroll-toggle {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.8rem;
        color: var(--text-secondary);
        cursor: pointer;
        user-select: none;
    }

    .auto-scroll-toggle input {
        display: none;
    }

    .toggle-switch {
        width: 36px;
        height: 20px;
        background: var(--bg-hover);
        border-radius: 10px;
        position: relative;
        transition: background 0.2s ease;
    }

    .toggle-switch::after {
        content: "";
        position: absolute;
        width: 16px;
        height: 16px;
        background: var(--text-secondary);
        border-radius: 50%;
        top: 2px;
        left: 2px;
        transition: all 0.2s ease;
    }

    .auto-scroll-toggle input:checked + .toggle-switch {
        background: var(--accent);
    }

    .auto-scroll-toggle input:checked + .toggle-switch::after {
        left: 18px;
        background: white;
    }

    .transcript-search {
        width: 100%;
        padding: 10px 14px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-dark);
        color: var(--text-primary);
        font-size: 0.85rem;
        transition: border-color 0.2s ease;
    }

    .transcript-search:focus {
        outline: none;
        border-color: var(--accent);
    }

    .transcript-search::placeholder {
        color: var(--text-secondary);
    }

    /* ---- Caption List ---- */
    .transcript-content {
        flex: 1;
        overflow-y: auto;
        scroll-behavior: auto; /* We control smooth scroll ourselves */
    }

    .caption-list {
        padding: 8px;
    }

    .caption-line {
        display: flex;
        padding: 12px 10px;
        margin-bottom: 2px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.15s ease;
        gap: 14px;
        border-left: 3px solid transparent;
    }

    .caption-line:hover {
        background: var(--bg-hover);
    }

    .caption-line.active {
        background: rgba(255, 68, 68, 0.08);
        border-left-color: var(--accent);
    }

    .caption-line.active .caption-time {
        color: var(--accent);
        font-weight: 600;
    }

    .caption-line.active .caption-text {
        color: var(--text-primary);
    }

    .caption-line.highlight {
        background: rgba(255, 68, 68, 0.12);
    }

    .caption-line.hidden {
        display: none;
    }

    .caption-time {
        color: var(--text-secondary);
        font-family: "SF Mono", "Monaco", "Inconsolata", monospace;
        font-size: 0.75rem;
        min-width: 48px;
        flex-shrink: 0;
        transition: color 0.15s ease;
    }

    .caption-text {
        color: var(--text-secondary);
        font-size: 0.9rem;
        line-height: 1.5;
        transition: color 0.15s ease;
    }

    .no-transcript {
        padding: 60px 20px;
        text-align: center;
        color: var(--text-secondary);
    }

    .search-status {
        padding: 12px 20px;
        font-size: 0.8rem;
        color: var(--text-secondary);
        border-bottom: 1px solid var(--border);
        display: none;
    }

    .search-status.visible {
        display: block;
    }

    /* ---- Responsive ---- */
    @media (max-width: 1024px) {
        .video-page {
            height: auto;
            overflow: visible;
        }

        .video-layout {
            grid-template-columns: 1fr;
            overflow: visible;
        }

        .video-column {
            overflow: visible;
        }

        .video-info-scroll {
            overflow: visible;
        }

        .transcript-panel {
            border-left: none;
            border-top: 1px solid var(--border);
            max-height: 50vh;
        }
    }

/* ===== favorites.html ===== */
    .favorites-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
    }

    .favorites-count {
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

    .favorites-controls {
        display: flex;
        align-items: center;
        gap: 15px;
    }

    .sort-controls {
        display: flex;
        gap: 5px;
    }

    .sort-btn {
        padding: 8px 14px;
        border-radius: 6px;
        font-size: 0.85rem;
        background: var(--bg-card);
        color: var(--text-secondary);
        border: 1px solid var(--border);
        text-decoration: none;
        transition: all 0.2s;
    }

    .sort-btn:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .sort-btn.active {
        background: var(--accent);
        border-color: var(--accent);
        color: white;
    }

    .favorites-list {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .favorite-card {
        background: var(--bg-card);
        border-radius: 10px;
        overflow: hidden;
        transition: all 0.2s;
        display: flex;
        gap: 20px;
        padding: 15px;
    }

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

    .favorite-thumbnail {
        width: 220px;
        min-width: 220px;
        aspect-ratio: 16/9;
        position: relative;
        background: var(--bg-dark);
        border-radius: 8px;
        overflow: hidden;
    }

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

    .favorite-duration {
        position: absolute;
        bottom: 8px;
        right: 8px;
        background: rgba(0, 0, 0, 0.85);
        padding: 3px 8px;
        border-radius: 4px;
        font-size: 0.8rem;
    }

    .favorite-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .favorite-title {
        font-size: 1.1rem;
        font-weight: 600;
        color: var(--text-primary);
        margin-bottom: 8px;
        text-decoration: none;
    }

    .favorite-title:hover {
        color: var(--accent);
    }

    .favorite-date {
        font-size: 0.9rem;
        color: var(--text-secondary);
        margin-bottom: 6px;
    }

    .favorite-meta {
        font-size: 0.85rem;
        color: var(--text-secondary);
        display: flex;
        gap: 15px;
        margin-bottom: 10px;
    }

    .favorite-notes {
        font-size: 0.85rem;
        color: var(--text-secondary);
        font-style: italic;
        margin-top: 8px;
    }

    .favorite-actions {
        margin-top: auto;
        display: flex;
        gap: 10px;
    }

    .favorite-btn {
        padding: 8px 16px;
        border-radius: 6px;
        font-size: 0.85rem;
        cursor: pointer;
        border: 1px solid var(--border);
        background: var(--bg-dark);
        color: var(--text-secondary);
        text-decoration: none;
        transition: all 0.2s;
    }

    .favorite-btn:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .favorite-btn.remove:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

    @media (max-width: 600px) {
        .favorite-card {
            flex-direction: column;
        }

        .favorite-thumbnail {
            width: 100%;
        }
    }

    .empty-favorites {
        text-align: center;
        padding: 80px 20px;
        color: var(--text-secondary);
    }

    .empty-favorites h2 {
        color: var(--text-primary);
        margin-bottom: 10px;
    }

    .empty-favorites p {
        margin-bottom: 20px;
    }

    .empty-favorites a {
        color: var(--accent);
    }

/* ===== history.html ===== */
    .history-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 30px;
        flex-wrap: wrap;
        gap: 15px;
    }

    .history-header h1 {
        font-size: 1.5rem;
    }

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

    .history-btn {
        padding: 10px 18px;
        border-radius: 8px;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.2s;
        border: 1px solid var(--border);
        background: var(--bg-card);
        color: var(--text-primary);
    }

    .history-btn:hover {
        background: var(--bg-hover);
    }

    .history-btn.danger {
        border-color: var(--accent);
        color: var(--accent);
    }

    .history-btn.danger:hover {
        background: var(--accent);
        color: white;
    }

    .history-tabs {
        display: flex;
        gap: 5px;
        margin-bottom: 25px;
        border-bottom: 1px solid var(--border);
        padding-bottom: 10px;
    }

    .history-tab {
        padding: 10px 20px;
        border-radius: 8px 8px 0 0;
        cursor: pointer;
        color: var(--text-secondary);
        transition: all 0.2s;
        border: none;
        background: none;
        font-size: 0.9rem;
    }

    .history-tab:hover {
        color: var(--text-primary);
        background: var(--bg-hover);
    }

    .history-tab.active {
        color: var(--text-primary);
        background: var(--bg-card);
        border-bottom: 2px solid var(--accent);
    }

    .history-stats {
        display: flex;
        gap: 30px;
        margin-bottom: 30px;
        padding: 20px;
        background: var(--bg-card);
        border-radius: 10px;
    }

    .history-stat {
        text-align: center;
    }

    .history-stat-value {
        font-size: 2rem;
        font-weight: 700;
        color: var(--accent);
    }

    .history-stat-label {
        font-size: 0.85rem;
        color: var(--text-secondary);
    }

    .history-section {
        margin-bottom: 40px;
    }

    .history-section-title {
        font-size: 1.1rem;
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .history-section-count {
        background: var(--bg-hover);
        padding: 2px 10px;
        border-radius: 12px;
        font-size: 0.8rem;
        color: var(--text-secondary);
    }

    .history-item {
        display: flex;
        gap: 15px;
        padding: 15px;
        background: var(--bg-card);
        border-radius: 10px;
        margin-bottom: 10px;
        transition: all 0.2s;
    }

    .history-item:hover {
        background: var(--bg-hover);
    }

    .history-item-thumbnail {
        width: 160px;
        min-width: 160px;
        aspect-ratio: 16/9;
        border-radius: 6px;
        overflow: hidden;
        background: var(--bg-dark);
        position: relative;
    }

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

    .history-item-progress {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 3px;
        background: rgba(255, 255, 255, 0.2);
    }

    .history-item-progress-bar {
        height: 100%;
        background: var(--accent);
    }

    .history-item-content {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    .history-item-title {
        font-size: 1rem;
        font-weight: 500;
        margin-bottom: 5px;
        color: var(--text-primary);
        text-decoration: none;
    }

    .history-item-title:hover {
        color: var(--accent);
    }

    .history-item-meta {
        font-size: 0.85rem;
        color: var(--text-secondary);
        margin-bottom: 10px;
    }

    .history-item-actions {
        margin-top: auto;
        display: flex;
        gap: 10px;
    }

    .history-item-btn {
        padding: 6px 12px;
        border-radius: 6px;
        font-size: 0.8rem;
        cursor: pointer;
        border: 1px solid var(--border);
        background: var(--bg-dark);
        color: var(--text-secondary);
        transition: all 0.2s;
    }

    .history-item-btn:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .history-item-btn.remove:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

    .empty-history {
        text-align: center;
        padding: 80px 20px;
        color: var(--text-secondary);
    }

    .empty-history h2 {
        color: var(--text-primary);
        margin-bottom: 10px;
    }

    .empty-history p {
        margin-bottom: 20px;
    }

    .empty-history a {
        color: var(--accent);
    }

    /* Confirmation Modal */
    .confirm-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        display: none;
        align-items: center;
        justify-content: center;
        z-index: 1000;
    }

    .confirm-modal.visible {
        display: flex;
    }

    .confirm-modal-content {
        background: var(--bg-card);
        padding: 30px;
        border-radius: 12px;
        max-width: 400px;
        text-align: center;
    }

    .confirm-modal-content h3 {
        margin-bottom: 10px;
    }

    .confirm-modal-content p {
        color: var(--text-secondary);
        margin-bottom: 20px;
    }

    .confirm-modal-actions {
        display: flex;
        gap: 10px;
        justify-content: center;
    }

    @media (max-width: 600px) {
        .history-item {
            flex-direction: column;
        }

        .history-item-thumbnail {
            width: 100%;
        }

        .history-stats {
            flex-wrap: wrap;
        }
    }

/* ===== quotes.html ===== */
    .quotes-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
    }

    .add-quote-btn {
        background: var(--accent);
        color: white;
        padding: 10px 20px;
        border-radius: 8px;
        font-weight: 500;
        transition: background 0.2s;
    }

    .add-quote-btn:hover {
        background: var(--accent-hover);
        color: white;
    }

    .quotes-intro {
        background: var(--bg-card);
        padding: 25px;
        border-radius: 12px;
        margin-bottom: 30px;
    }

    .quotes-intro h2 {
        margin-bottom: 10px;
        font-size: 1.2rem;
    }

    .quotes-intro p {
        color: var(--text-secondary);
        margin-bottom: 15px;
    }

    .quote-search-form {
        display: flex;
        gap: 10px;
    }

    .quote-search-form input {
        flex: 1;
        padding: 12px 18px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-dark);
        color: var(--text-primary);
        font-size: 1rem;
    }

    .quote-search-form input:focus {
        outline: none;
        border-color: var(--accent);
    }

    .quote-search-form button {
        background: var(--accent);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 500;
    }

    .quotes-list {
        display: grid;
        gap: 15px;
    }

    .quote-card {
        background: var(--bg-card);
        padding: 20px;
        border-radius: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 20px;
    }

    .quote-content {
        flex: 1;
    }

    .quote-phrase {
        font-size: 1.1rem;
        font-weight: 500;
        margin-bottom: 5px;
        color: var(--text-primary);
    }

    .quote-phrase:hover {
        color: var(--accent);
    }

    .quote-notes {
        color: var(--text-secondary);
        font-size: 0.9rem;
    }

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

    .quote-action-btn {
        padding: 8px 14px;
        border-radius: 6px;
        font-size: 0.85rem;
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .quote-action-btn:hover {
        background: var(--border);
    }

    .quote-action-btn.delete {
        color: var(--accent);
    }

    .empty-quotes {
        text-align: center;
        padding: 60px 20px;
        color: var(--text-secondary);
    }

    .empty-quotes h3 {
        color: var(--text-primary);
        margin-bottom: 10px;
    }

/* ===== quotes_search.html ===== */
    .quote-search-header {
        background: var(--bg-card);
        padding: 25px;
        border-radius: 12px;
        margin-bottom: 25px;
    }

    .quote-search-header h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }

    .quote-search-header h1 span {
        color: var(--accent);
    }

    .quote-info {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .quote-stats {
        color: var(--text-secondary);
    }

    .pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin-top: 40px;
        flex-wrap: wrap;
    }
    .page-btn {
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-primary);
        padding: 10px 16px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
    }
    .page-btn:hover:not(:disabled) { border-color: var(--accent); }
    .page-btn:disabled { opacity: 0.5; cursor: not-allowed; }
    .page-info { color: var(--text-secondary); }

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

    .quote-action-btn {
        padding: 8px 16px;
        border-radius: 6px;
        font-size: 0.9rem;
        background: var(--bg-hover);
        color: var(--text-primary);
        border: none;
        cursor: pointer;
    }

    .quote-action-btn:hover {
        background: var(--border);
    }

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

    .quote-action-btn.primary:hover {
        background: var(--accent-hover);
    }

    .saved-badge {
        background: #22c55e;
        color: white;
        padding: 4px 10px;
        border-radius: 12px;
        font-size: 0.8rem;
        margin-left: 10px;
    }

    .quote-notes-display {
        margin-top: 15px;
        padding-top: 15px;
        border-top: 1px solid var(--border);
        color: var(--text-secondary);
        font-style: italic;
    }

    .matches-list {
        display: grid;
        gap: 12px;
    }

    .match-card {
        background: var(--bg-card);
        border-radius: 10px;
        overflow: hidden;
        display: flex;
        transition: transform 0.2s;
    }

    .match-card:hover {
        transform: translateX(4px);
    }

    .match-thumbnail {
        width: 160px;
        min-width: 160px;
        aspect-ratio: 16/9;
        background: var(--bg-hover);
    }

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

    .match-content {
        padding: 15px;
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .match-title {
        font-weight: 500;
        margin-bottom: 5px;
        color: var(--text-primary);
    }

    .match-title:hover {
        color: var(--accent);
    }

    .match-meta {
        color: var(--text-secondary);
        font-size: 0.85rem;
        margin-bottom: 10px;
    }

    .match-text {
        background: var(--bg-hover);
        padding: 10px 12px;
        border-radius: 6px;
        font-size: 0.9rem;
        color: var(--text-secondary);
        border-left: 3px solid var(--accent);
        margin-top: auto;
    }

    .match-text .highlight {
        background: var(--accent);
        color: white;
        padding: 1px 4px;
        border-radius: 3px;
    }

    .match-timestamp {
        color: var(--accent);
        font-family: monospace;
        margin-right: 10px;
    }

    .no-matches {
        text-align: center;
        padding: 60px 20px;
        color: var(--text-secondary);
    }

    .no-matches h3 {
        color: var(--text-primary);
        margin-bottom: 10px;
    }

    .search-again {
        margin-top: 20px;
    }

    .search-again input {
        padding: 10px 16px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-card);
        color: var(--text-primary);
        width: 300px;
        max-width: 100%;
    }

    @media (max-width: 600px) {
        .match-card {
            flex-direction: column;
        }

        .match-thumbnail {
            width: 100%;
        }
    }

/* ===== guests.html ===== */
    .guests-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 25px;
    }

    .add-guest-btn {
        background: var(--accent);
        color: white;
        padding: 10px 20px;
        border-radius: 8px;
        font-weight: 500;
        transition: background 0.2s;
    }

    .add-guest-btn:hover {
        background: var(--accent-hover);
        color: white;
    }

    .guests-intro {
        background: var(--bg-card);
        padding: 25px;
        border-radius: 12px;
        margin-bottom: 30px;
    }

    .guests-intro h2 {
        margin-bottom: 10px;
        font-size: 1.2rem;
    }

    .guests-intro p {
        color: var(--text-secondary);
        margin-bottom: 15px;
    }

    .guest-search-form {
        display: flex;
        gap: 10px;
    }

    .guest-search-form input {
        flex: 1;
        padding: 12px 18px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg-dark);
        color: var(--text-primary);
        font-size: 1rem;
    }

    .guest-search-form input:focus {
        outline: none;
        border-color: var(--accent);
    }

    .guest-search-form button {
        background: var(--accent);
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 8px;
        cursor: pointer;
        font-weight: 500;
    }

    .guests-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
    }

    .guest-card {
        background: var(--bg-card);
        padding: 20px;
        border-radius: 10px;
        transition: all 0.2s;
    }

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

    .guest-name {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 5px;
        color: var(--text-primary);
    }

    .guest-name:hover {
        color: var(--accent);
    }

    .guest-notes {
        color: var(--text-secondary);
        font-size: 0.9rem;
        margin-bottom: 12px;
    }

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

    .guest-action-btn {
        padding: 8px 14px;
        border-radius: 6px;
        font-size: 0.85rem;
        background: var(--bg-hover);
        color: var(--text-primary);
        border: none;
        cursor: pointer;
    }

    .guest-action-btn:hover {
        background: var(--border);
    }

    .guest-action-btn.delete {
        color: var(--accent);
    }

    .empty-guests {
        text-align: center;
        padding: 60px 20px;
        color: var(--text-secondary);
    }

    .empty-guests h3 {
        color: var(--text-primary);
        margin-bottom: 10px;
    }

/* ===== guests_search.html ===== */
    .guest-header {
        background: var(--bg-card);
        padding: 25px;
        border-radius: 12px;
        margin-bottom: 25px;
    }

    .guest-header-top {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 20px;
        flex-wrap: wrap;
    }

    .guest-info h1 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .guest-info h1 .saved-badge {
        display: inline-block;
        background: #22c55e;
        color: white;
        font-size: 0.7rem;
        padding: 4px 10px;
        border-radius: 12px;
        vertical-align: middle;
        margin-left: 10px;
        font-weight: 500;
    }

    .guest-stats {
        color: var(--text-secondary);
        font-size: 0.95rem;
    }

    .guest-notes {
        margin-top: 12px;
        color: var(--text-secondary);
        font-style: italic;
    }

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

    .guest-action-btn {
        padding: 10px 18px;
        border-radius: 8px;
        font-size: 0.9rem;
        cursor: pointer;
        border: 1px solid var(--border);
        background: var(--bg-hover);
        color: var(--text-primary);
        text-decoration: none;
    }

    .guest-action-btn:hover {
        background: var(--border);
    }

    .guest-action-btn.primary {
        background: var(--accent);
        border-color: var(--accent);
        color: white;
    }

    .guest-action-btn.danger {
        border-color: var(--accent);
        color: var(--accent);
    }

    .results-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
    }

    .result-card {
        background: var(--bg-card);
        border-radius: 10px;
        overflow: hidden;
        transition: all 0.2s;
    }

    .result-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }

    .result-thumbnail {
        aspect-ratio: 16/9;
        position: relative;
        background: var(--bg-dark);
    }

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

    .result-duration {
        position: absolute;
        bottom: 8px;
        right: 8px;
        background: rgba(0, 0, 0, 0.85);
        padding: 3px 8px;
        border-radius: 4px;
        font-size: 0.8rem;
    }

    .result-match-type {
        position: absolute;
        top: 8px;
        left: 8px;
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 0.75rem;
        font-weight: 600;
    }

    .result-match-type.title {
        background: var(--accent);
        color: white;
    }

    .result-match-type.description {
        background: #3b82f6;
        color: white;
    }

    .result-match-type.caption {
        background: var(--bg-hover);
        color: var(--text-primary);
    }

    .mention-count {
        position: absolute;
        top: 8px;
        right: 8px;
        background: rgba(0, 0, 0, 0.85);
        padding: 4px 10px;
        border-radius: 4px;
        font-size: 0.75rem;
    }

    .result-info {
        padding: 15px;
    }

    .result-title {
        font-size: 0.95rem;
        font-weight: 500;
        color: var(--text-primary);
        margin-bottom: 6px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .result-meta {
        font-size: 0.85rem;
        color: var(--text-secondary);
    }

    .no-results {
        text-align: center;
        padding: 60px 20px;
        color: var(--text-secondary);
    }

    .no-results h2 {
        color: var(--text-primary);
        margin-bottom: 10px;
    }

    .pagination {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 10px;
        margin-top: 40px;
        flex-wrap: wrap;
    }
    .page-btn {
        background: var(--bg-card);
        border: 1px solid var(--border);
        color: var(--text-primary);
        padding: 10px 16px;
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.2s;
        text-decoration: none;
    }
    .page-btn:hover:not(:disabled) {
        border-color: var(--accent);
    }
    .page-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    .page-info {
        color: var(--text-secondary);
    }

/* ===== error.html ===== */
    .error-container {
        max-width: 720px;
        margin: 80px auto;
        padding: 60px 40px;
        text-align: center;
        background: var(--bg-card);
        border-radius: 12px;
        border: 1px solid var(--border);
    }
    .error-title {
        font-size: 28px;
        margin-bottom: 16px;
        color: var(--accent);
    }
    .error-message {
        font-size: 17px;
        line-height: 1.7;
        color: var(--text-secondary);
        margin-bottom: 32px;
    }
    .error-actions {
        display: flex;
        gap: 12px;
        justify-content: center;
        flex-wrap: wrap;
    }
    .error-button {
        display: inline-block;
        padding: 12px 24px;
        background: var(--accent);
        color: white;
        border-radius: 8px;
        font-weight: 600;
        font-size: 16px;
        transition: background 0.2s;
    }
    .error-button:hover {
        background: var(--accent-hover);
        color: white;
    }
    .error-button.secondary {
        background: var(--bg-hover);
        color: var(--text-primary);
        border: 1px solid var(--border);
    }

/* ===== online edition: YouTube embed fills the 16:9 player box ===== */
.video-player { position: relative; }
.video-player #ytplayer,
.video-player iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ===== online edition: client-side add controls render as buttons ===== */
.add-quote-btn, .add-guest-btn { border: none; cursor: pointer; font: inherit; }

/* ===== footer credit (Yendra Digital) — subtle, site-wide ===== */
.footer-credit {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    opacity: 0.85;
}
.footer-credit a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-credit a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}
