/* ============================================
   MODERN UI DESIGN SYSTEM v2.0
   TVscribe
   ============================================ */

/* === CSS Variables === */
:root {
    /* Colors - Dark Theme */
    --bg-primary: #0a0a0f;
    --bg-secondary: #13131a;
    --bg-tertiary: #1c1c24;
    --bg-elevated: #24242e;

    /* Glass/Card backgrounds */
    --glass-bg: rgba(28, 28, 36, 0.7);
    --card-bg: rgba(36, 36, 46, 0.8);
    --card-hover: rgba(42, 42, 52, 0.9);

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #b4b4b4;
    --text-muted: #6b6b7b;
    --text-disabled: #4a4a5a;

    /* Accent Colors */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-hover: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);

    /* Status Colors */
    --success: #22c55e;
    --success-bg: rgba(34, 197, 94, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --error: #ef4444;
    --error-bg: rgba(239, 68, 68, 0.1);
    --info: #3b82f6;
    --info-bg: rgba(59, 130, 246, 0.1);

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.1);
    --border-strong: rgba(255, 255, 255, 0.15);

    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.6);
    --shadow-xl: 0 12px 32px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.3);

    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Helvetica Neue', sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;

    /* Z-index scale */
    --z-base: 0;
    --z-dropdown: 50;
    --z-sticky: 100;
    --z-overlay: 200;
    --z-modal: 300;
    --z-toast: 400;
}

/* === Reset & Base === */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* === Scrollbar === */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    border: 2px solid var(--bg-secondary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* === App Container === */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   HEADER - Modern & Compact
   ============================================ */
.header {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
}

.header-content {
    max-width: 1800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
}

/* Logo */
.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
}

.logo-svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* Search */
.search-container {
    position: relative;
    flex: 1;
    max-width: 500px;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: var(--transition-base);
}

#searchInput:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

/* Date Switch */
.date-switch {
    display: flex;
    gap: 0.375rem;
    padding: 0.375rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
}

.date-option {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.date-option:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.date-option.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

/* Header Right */
.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.icon-btn.spinning svg,
.btn.spinning svg,
.spinning svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Auth */
.auth-container {
    position: relative;
}

.login-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-full);
    color: white;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.login-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.user-profile {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--accent-primary);
    transition: var(--transition-fast);
}

.user-avatar:hover {
    box-shadow: var(--shadow-glow);
}

.user-profile-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   CHANNEL TABS
   ============================================ */
.tabs-container {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    scrollbar-width: none;
}

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

.tabs-list {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.channel-tab {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition-fast);
}

.channel-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.channel-tab.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.tab-count {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.125rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

.channel-tab.active .tab-count {
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent-primary);
}

.settings-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
}

.settings-btn:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    max-width: 1800px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
}

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

.content.full-width {
    width: 100%;
}

.content-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.content-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.content-header-actions {
    display: flex;
    gap: 0.75rem;
}

/* ============================================
   BUTTONS - Unified System
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

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

.btn-secondary:hover {
    background: var(--card-hover);
    border-color: var(--border-strong);
}

.btn-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--accent-primary);
    color: white;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    margin-left: 0.5rem;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-summary-batch,
.btn-analysis {
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    color: var(--text-primary);
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-summary-batch:hover,
.btn-analysis:hover {
    background: var(--card-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    transform: translateY(-1px);
}

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

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

/* ============================================
   VIDEO GRID - Modern Cards
   ============================================ */
.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.video-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    cursor: pointer;
    transition: var(--transition-base);
}

.video-card:hover {
    background: var(--card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.video-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.video-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.new-badge {
    flex-shrink: 0;
    padding: 0.25rem 0.5rem;
    background: var(--success-bg);
    color: var(--success);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.channel-badge {
    padding: 0.25rem 0.625rem;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 500;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ============================================
   MODAL - Unified Design
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: var(--z-modal);
}

.modal.active {
    display: flex;
    animation: fadeIn var(--transition-base);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s ease-out;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-header-text h2,
.modal-header-text h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.modal-meta,
.modal-subtitle {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.close-btn,
.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 1.25rem;
}

.close-btn:hover,
.close-modal:hover {
    background: var(--error-bg);
    color: var(--error);
    border-color: var(--error);
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

.transcript-container h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.transcript-text {
    padding: 2rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    line-height: 1.8;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-wrap: break-word;
}

.transcript-text p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.transcript-text p:last-child {
    margin-bottom: 0;
}

.transcript-text strong,
.transcript-text b {
    color: var(--text-primary);
    font-weight: 600;
}

.transcript-text em,
.transcript-text i {
    color: var(--text-primary);
    font-style: italic;
}

.transcript-text blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--primary);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-style: italic;
}

.transcript-text code {
    padding: 0.125rem 0.375rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.transcript-text h1,
.transcript-text h2,
.transcript-text h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.transcript-text h1 {
    font-size: 1.25rem;
}

.transcript-text h2 {
    font-size: 1.125rem;
}

.transcript-text h3 {
    font-size: 1rem;
}

.transcript-text ul,
.transcript-text ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.transcript-text li {
    margin-bottom: 0.5rem;
}

.transcript-text a {
    color: var(--primary);
    text-decoration: underline;
    transition: var(--transition-fast);
}

.transcript-text a:hover {
    color: var(--primary-hover);
}

.transcript-text hr {
    margin: 1.5rem 0;
    border: none;
    border-top: 1px solid var(--border-subtle);
}

.highlight {
    background: rgba(99, 102, 241, 0.3);
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-xs);
}

/* ============================================
   TRAY - Slide-in Panel
   ============================================ */
.tray {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    pointer-events: none;
}

.tray.active {
    pointer-events: all;
}

.tray-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.tray.active .tray-overlay {
    opacity: 1;
}

.tray-content {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    max-width: 600px;
    background: var(--card-bg);
    backdrop-filter: blur(24px);
    border-left: 1px solid var(--border-medium);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.tray.active .tray-content {
    transform: translateX(0);
}

.tray-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem;
    border-bottom: 1px solid var(--border-subtle);
}

.tray-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tray-title h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.tray-header-badge {
    padding: 0.25rem 0.75rem;
    background: var(--accent-gradient);
    color: white;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Bezáró gomb - teljesen újratervezett */
.tray-close-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.15) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    border-radius: 8px !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

.tray-close-btn:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    border-color: rgba(255, 255, 255, 0.4) !important;
    transform: scale(1.1);
}

.tray-close-btn svg {
    display: block;
    pointer-events: none;
}

.tray-body {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.tray-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-subtle);
    background: rgba(0, 0, 0, 0.2);
}

/* ============================================
   FORMS & INPUTS
   ============================================ */
.form-select,
.keyword-input,
input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: var(--transition-fast);
}

.form-select:focus,
.keyword-input:focus,
input[type="text"]:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.keyword-input-container {
    display: flex;
    gap: 0.75rem;
}

.analysis-section {
    margin-bottom: 2rem;
}

.section-label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.section-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.stock-controls {
    display: flex;
    gap: 0.75rem;
}

/* ============================================
   LOADING & EMPTY STATES
   ============================================ */
.loading,
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.spinner,
.spinner-small {
    border: 3px solid var(--border-subtle);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
}

.spinner-small {
    width: 24px;
    height: 24px;
    margin-right: 0.75rem;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state svg {
    margin-bottom: 1.5rem;
    color: var(--text-muted);
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-muted);
}

/* ============================================
   MARKDOWN CONTENT
   ============================================ */
.summary-markdown-content,
.translation-box {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    line-height: 1.8;
    color: var(--text-secondary);
}

#stockAnalysisResult.summary-markdown-content h1,
#stockAnalysisResult.summary-markdown-content h2,
#stockAnalysisResult.summary-markdown-content h3,
#stockAnalysisResult .streaming-text h1,
#stockAnalysisResult .streaming-text h2,
#stockAnalysisResult .streaming-text h3,
.summary-markdown-content h1,
.summary-markdown-content h2,
.summary-markdown-content h3,
.streaming-text h1,
.streaming-text h2,
.streaming-text h3,
#stockAnalysisResult h1,
#stockAnalysisResult h2,
#stockAnalysisResult h3 {
    color: #ffffff !important;
    margin-top: 1.5rem !important;
    margin-bottom: 0.75rem !important;
    font-weight: 700 !important;
}

#stockAnalysisResult p,
.summary-markdown-content p,
.streaming-text p {
    margin-bottom: 1rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
    line-height: 1.8 !important;
}

#stockAnalysisResult ul,
#stockAnalysisResult ol,
.summary-markdown-content ul,
.summary-markdown-content ol,
.streaming-text ul,
.streaming-text ol {
    margin-left: 0 !important;
    margin-bottom: 1rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

#stockAnalysisResult li,
.summary-markdown-content li,
.streaming-text li {
    margin-bottom: 0.5rem !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Streaming text base styles - explicit! */
.streaming-text {
    display: block !important;
    color: rgba(255, 255, 255, 0.7) !important;
    line-height: 1.8 !important;
    font-size: 1rem !important;
}

#stockAnalysisResult.summary-markdown-content strong,
#stockAnalysisResult .streaming-text strong,
.summary-markdown-content strong,
.streaming-text strong,
#stockAnalysisResult strong {
    color: #a78bfa !important;
    font-weight: 700 !important;
}

#stockAnalysisResult.summary-markdown-content em,
#stockAnalysisResult .streaming-text em,
.summary-markdown-content em,
.streaming-text em,
#stockAnalysisResult em {
    color: #818cf8 !important;
    font-style: italic !important;
}

#stockAnalysisResult.summary-markdown-content code,
#stockAnalysisResult .streaming-text code,
.summary-markdown-content code,
.streaming-text code,
#stockAnalysisResult code {
    background: rgba(139, 92, 246, 0.15) !important;
    color: #a78bfa !important;
    padding: 0.125rem 0.375rem !important;
    border-radius: 4px !important;
    font-size: 0.875em !important;
    font-family: 'Monaco', 'Courier New', monospace !important;
}

/* List styling with bullets */
.summary-markdown-content ul li,
.streaming-text ul li,
#stockAnalysisResult ul li {
    list-style-type: disc !important;
    list-style-position: outside !important;
}

.summary-markdown-content ol li,
.streaming-text ol li,
#stockAnalysisResult ol li {
    list-style-type: decimal !important;
    list-style-position: outside !important;
}

/* Elemzés eredmény speciális stílusok */
#stockAnalysisResult.summary-box {
    padding: 1.5rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.summary-meta-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Streaming Animation */
.streaming-container.streaming {
    position: relative;
}

.streaming-text.typing::after {
    content: '▊';
    animation: blink 1s step-end infinite;
    color: var(--accent-primary);
}

@keyframes blink {
    50% {
        opacity: 0;
    }
}

/* ============================================
   CHANNEL MANAGEMENT
   ============================================ */
.settings-modal-content {
    max-width: 700px;
}

.add-channel-section,
.channel-list-section {
    margin-bottom: 2rem;
}

.add-channel-section h4,
.channel-list-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.channel-input-group {
    display: flex;
    gap: 0.75rem;
}

.add-btn {
    padding: 0.75rem 1.5rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition-fast);
    white-space: nowrap;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.channel-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.channel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.channel-item:hover {
    background: var(--card-hover);
    border-color: var(--border-medium);
}

.channel-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.channel-name {
    font-weight: 600;
    color: var(--text-primary);
}

.channel-url {
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
}

.channel-url:hover {
    color: var(--accent-primary);
}

.status-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.5rem;
    display: inline-block;
    width: fit-content;
}

.status-badge.status-active {
    background: var(--success-bg);
    color: var(--success);
}

.status-badge.status-archived {
    background: var(--warning-bg);
    color: var(--warning);
}

.channel-actions {
    display: flex;
    gap: 0.5rem;
}

.toggle-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.toggle-btn.archive {
    border-color: var(--warning);
    color: var(--warning);
}

.toggle-btn.restore {
    border-color: var(--success);
    color: var(--success);
}

.toggle-btn:hover {
    transform: translateY(-1px);
}

.toggle-btn.archive:hover {
    background: var(--warning);
    color: white;
}

.toggle-btn.restore:hover {
    background: var(--success);
    color: white;
}

.delete-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.delete-btn:hover {
    background: var(--error);
    color: white;
    transform: translateY(-1px);
}

.delete-btn i {
    font-size: 16px;
}

.error-box {
    padding: 1rem;
    background: var(--error-bg);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    color: var(--error);
}

/* ============================================
   VIDEO DETAIL VIEW
   ============================================ */
.video-detail-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: var(--z-modal);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.video-detail-header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

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

.video-detail-header-info {
    flex: 1;
}

.video-detail-header-info h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.video-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.video-detail-meta i {
    font-size: 16px;
    color: var(--text-muted);
}

.video-detail-content {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2rem;
    padding: 2rem;
    overflow-y: auto;
}

.video-detail-left {
    padding-left: 4rem;
    padding-right: 4rem;
}

.transcript-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.summary-box {
    background: transparent;
    border: none;
    border-radius: 0;
    margin-bottom: 1.5rem;
}

.summary-box p {
    margin-bottom: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.summary-box p:last-child {
    margin-bottom: 0;
}

.summary-box strong,
.summary-box b {
    color: var(--accent-primary);
    font-weight: 600;
}

.summary-box em,
.summary-box i {
    color: var(--text-primary);
    font-style: italic;
}

.summary-box h1,
.summary-box h2,
.summary-box h3 {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

/* Első címsor ne kapjon felső margót */
.summary-box h1:first-child,
.summary-box h2:first-child,
.summary-box h3:first-child {
    margin-top: 0;
}

/* Video detail összefoglaló - nincs padding */
#detailSummaryResult.summary-box {
    padding: 0;
    margin: 0;
    margin-bottom: 1.5rem;
}

/* Streaming text a detail nézetben - nincs eltolás */
#detailSummaryResult .streaming-text {
    display: block;
    padding: 0;
    margin: 0;
}

/* Első elem a streaming textben - nincs eltolás */
#detailSummaryResult .streaming-text>*:first-child {
    margin-top: 0;
    padding-top: 0;
}

#detailSummaryResult .streaming-text>p:first-child,
#detailSummaryResult .streaming-text>h1:first-child,
#detailSummaryResult .streaming-text>h2:first-child,
#detailSummaryResult .streaming-text>h3:first-child {
    margin-top: 0;
    padding-top: 0;
}

/* Listák a detail nézetben - nincs margin-left */
#detailSummaryResult ul,
#detailSummaryResult ol,
#detailSummaryResult .streaming-text ul,
#detailSummaryResult .streaming-text ol {
    margin-left: 0 !important;
    list-style-position: outside !important;
}

.summary-box h1 {
    font-size: 1.25rem;
}

.summary-box h2 {
    font-size: 1.125rem;
}

.summary-box h3 {
    font-size: 1rem;
}

.summary-box ul,
.summary-box ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    color: var(--text-secondary);
    list-style-position: outside;
}

.summary-box li {
    margin-bottom: 0.5rem;
}

.summary-box code {
    padding: 0.125rem 0.375rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xs);
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.summary-box blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 3px solid var(--primary);
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-style: italic;
}

.summary-box .summary-header {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.video-detail-right {
    overflow-y: auto;
    padding-left: 1rem;
    border-left: 1px solid var(--border-subtle);
}

.action-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    position: sticky;
    top: 0;
}

/* Hide mobile navigation on desktop (shown only on mobile via media query and JS) */
.video-detail-mobile-nav {
    display: none;
}

/* Force hide mobile nav on larger screens */
@media (min-width: 769px) {
    .video-detail-mobile-nav {
        display: none !important;
    }
}

.action-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
}

.action-menu-item:hover {
    background: var(--card-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.action-menu-item.primary {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
}

.action-menu-item.primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.action-menu-item.warning {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border-color: var(--border-subtle);
}

.action-menu-item.warning:hover {
    background: var(--card-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.action-menu-item i {
    flex-shrink: 0;
    font-size: 20px;
}

.action-menu-item svg {
    flex-shrink: 0;
}

/* Info Box - Information/Disclaimer Box */
.info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
}

.info-box i {
    flex-shrink: 0;
    font-size: 20px;
    margin-top: 0.125rem;
}

.info-box-content {
    flex: 1;
}

.info-box-content p {
    font-size: 0.875rem;
    font-weight: 400;
    margin: 0;
    line-height: 1.5;
    color: var(--text-secondary);
}

.info-box-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.info-box-content ul {
    margin: 0.5rem 0 0 0;
    padding-left: 1.25rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.info-box-content ul li {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
}

.info-box-content ul li:last-child {
    margin-bottom: 0;
}

/* Info box types */
.info-box.type-info {
    background: rgba(59, 130, 246, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
}

.info-box.type-info i {
    color: #3b82f6;
}

.info-box.type-warning {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.3);
    gap: 0;
}

.info-box.type-warning i {
    display: none;
}

.info-box.type-error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
}

.info-box.type-error i {
    color: #ef4444;
}

.info-box.type-support {
    background: rgba(168, 85, 247, 0.08);
    border-color: rgba(168, 85, 247, 0.3);
}

.info-box.type-support i {
    color: #a855f7;
}

.token-estimate {
    padding: 0.875rem 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--accent-primary);
    font-weight: 600;
    text-align: center;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .video-detail-content {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .video-detail-left {
        padding-left: 0;
        padding-right: 0;
    }

    .video-detail-right {
        border-left: none;
        border-top: 1px solid var(--border-subtle);
        padding-left: 0;
        padding-top: 1.5rem;
        margin-top: 1.5rem;
    }
}

/* Mobile-specific video detail optimizations */
@media (max-width: 768px) {
    .video-detail-header {
        padding: 0.875rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .video-detail-header-info h1 {
        font-size: 1rem;
        line-height: 1.4;
        margin-bottom: 0.375rem;
        word-break: break-word;
    }

    .video-detail-meta {
        font-size: 0.8125rem;
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .video-detail-meta i {
        font-size: 14px;
    }

    .back-btn {
        font-size: 0.875rem;
        padding: 0.5rem 0.75rem;
        width: 100%;
        justify-content: center;
    }

    .video-detail-content {
        padding: 1rem;
        gap: 1rem;
    }

    .video-detail-left {
        padding: 0;
    }

    .transcript-section h3 {
        font-size: 1.125rem;
    }

    .transcript-box {
        padding: 1rem;
        font-size: 0.9375rem;
        line-height: 1.7;
    }

    /* Hide desktop action-menu on mobile */
    .action-menu {
        display: none;
    }

    /* Fixed bottom mobile navigation bar */
    .video-detail-mobile-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        display: flex;
        justify-content: space-around;
        align-items: stretch;
        background: var(--bg-elevated);
        border-top: 1px solid var(--border-subtle);
        padding: 0.5rem 0;
        z-index: 1000;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    }

    .mobile-nav-button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 0.25rem;
        padding: 0.5rem 0.25rem;
        flex: 1;
        background: none;
        border: none;
        color: var(--text-secondary);
        font-size: 0.6875rem;
        font-weight: 500;
        cursor: pointer;
        text-align: center;
        text-decoration: none;
        transition: all 0.2s ease;
        line-height: 1.2;
    }

    .mobile-nav-button:active {
        background: var(--card-hover);
    }

    .mobile-nav-button.primary {
        color: var(--accent-blue);
    }

    .mobile-nav-button i {
        font-size: 22px;
        flex-shrink: 0;
    }

    .mobile-nav-button.primary i {
        color: var(--accent-blue);
    }

    /* Add bottom padding to video-detail-content to prevent overlap */
    .video-detail-content {
        padding-bottom: 5rem;
    }
}

/* ============================================
   USER SIDEBAR
   ============================================ */
.user-sidebar .tray-content {
    width: 420px;
}

.user-info-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-lg);
}

.sidebar-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.sidebar-user-details {
    flex: 1;
    overflow: hidden;
}

.sidebar-user-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.125rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-email {
    font-size: 0.8125rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-section {
    margin-bottom: 1.25rem;
}

.section-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.api-status-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.625rem;
    margin-bottom: 0.75rem;
}

.api-status-card {
    padding: 0.75rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: var(--transition-fast);
}

.api-status-card:hover {
    background: var(--card-hover);
    border-color: var(--border-medium);
}

.status-indicator-large {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-light-large {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-light-large.ok {
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
}

.status-light-large.error {
    background: var(--error);
    box-shadow: 0 0 12px var(--error);
}

.status-light-large.checking {
    background: var(--warning);
    animation: pulse 2s ease-in-out infinite;
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.status-label-large {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.status-sublabel {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 0.875rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.sidebar-nav-item i {
    flex-shrink: 0;
    font-size: 18px;
}

.sidebar-nav-item:hover {
    background: var(--card-hover);
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.btn-full-width {
    width: 100%;
    justify-content: center;
}

.section-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 1.5rem 0;
}

/* Language Selector */
.language-section {
    margin-top: 1rem;
}

.language-selector-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.language-dropdown {
    flex: 1;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 2rem;
}

.language-dropdown:hover {
    border-color: var(--border-medium);
    background-color: var(--card-hover);
}

.language-dropdown:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.language-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 0.5rem;
}

/* Custom Language Dropdown with Flags */
.custom-language-dropdown {
    position: relative;
    flex: 1;
}

.language-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
}

.language-dropdown-btn:hover {
    border-color: var(--border-medium);
    background-color: var(--card-hover);
}

.language-dropdown-btn:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.language-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    flex-shrink: 0;
}

.dropdown-arrow {
    margin-left: auto;
    font-size: 18px;
    transition: transform 0.2s ease;
}

.custom-language-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.language-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.custom-language-dropdown.open .language-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.language-option {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 0.875rem;
    color: var(--text-primary);
}

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

.language-option.selected {
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
    font-weight: 600;
}

.language-option:first-child {
    border-top-left-radius: var(--radius-md);
    border-top-right-radius: var(--radius-md);
}

.language-option:last-child {
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
}

.btn-save-language {
    padding: 0.6rem 1rem;
    font-size: 0.875rem;
    white-space: nowrap;
}

.btn-save-language:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }

    .header-content {
        flex-wrap: wrap;
        gap: 1rem;
    }

    .header-left {
        flex-direction: column;
        align-items: stretch;
    }

    .date-switch {
        order: 3;
        width: 100%;
    }

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

    .tray-content {
        max-width: 100%;
    }

    .user-sidebar .tray-content {
        width: 90%;
        max-width: 400px;
    }

    .modal-content {
        max-height: 100vh;
        border-radius: 0;
    }

    /* Content Header - Mobile Optimization */
    .content-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .content-header h2 {
        font-size: 1.375rem;
        line-height: 1.3;
        word-break: break-word;
    }

    .content-header-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .content-header-actions .btn {
        flex: 1;
        min-width: 0;
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }

    .content-header-actions .btn i {
        font-size: 16px;
    }

    /* View Toggle Mobile */
    .view-toggle {
        width: 100%;
        justify-content: stretch;
    }

    .view-toggle-btn {
        flex: 1;
    }

    /* Main container mobile padding */
    .main-content {
        padding: 1rem;
        gap: 1rem;
    }

    /* Video cards mobile */
    .video-card {
        margin-bottom: 1rem;
    }

    /* Buttons mobile - ensure proper sizing */
    .btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }

    .btn i {
        font-size: 16px;
    }
}

/* ============================================
   VIEW TOGGLE & TABLE VIEW
   ============================================ */

/* View Toggle */
.view-toggle {
    display: flex;
    gap: 0.25rem;
    padding: 0.25rem;
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.view-toggle-btn {
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-toggle-btn i {
    font-size: 18px;
}

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

.view-toggle-btn.active {
    background: var(--accent-primary);
    color: white;
}

/* Advanced Filters Panel */
.advanced-filters {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.filters-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.filters-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.filter-select {
    padding: 0.625rem 0.875rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.filter-select:hover {
    border-color: var(--border-medium);
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Table Container */
.video-table-container {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.table-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.table-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.table-wrapper {
    overflow-x: auto;
}

.videos-table {
    width: 100%;
    border-collapse: collapse;
}

.videos-table thead {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-subtle);
}

.videos-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.videos-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: var(--transition-fast);
}

.videos-table th.sortable:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.videos-table th.sortable .sort-icon {
    margin-left: 0.25rem;
    font-size: 14px;
    opacity: 0.5;
}

.videos-table th.sortable.sorted-asc .sort-icon {
    opacity: 1;
    transform: rotate(180deg);
}

.videos-table th.sortable.sorted-desc .sort-icon {
    opacity: 1;
}

.videos-table tbody tr {
    border-bottom: 1px solid var(--border-subtle);
    transition: var(--transition-fast);
}

.videos-table tbody tr.table-row-clickable {
    cursor: pointer;
}

.videos-table tbody tr:hover {
    background: var(--card-hover);
}

.videos-table tbody tr.selected {
    background: rgba(99, 102, 241, 0.1);
}

.videos-table td {
    padding: 0.875rem 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
    vertical-align: middle;
}

/* Table Column Specific Styles */
.th-checkbox,
.td-checkbox {
    width: 40px;
    text-align: center;
}

.td-checkbox input[type="checkbox"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
}

.th-thumbnail,
.td-thumbnail {
    width: 120px;
}

.video-thumbnail {
    width: 100px;
    height: 56px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border-subtle);
}

.th-title {
    min-width: 300px;
}

.td-title {
    max-width: 400px;
}

.td-title .new-badge {
    margin-left: 0.5rem;
    vertical-align: middle;
    display: inline-block;
}

.video-title-link {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    max-width: calc(100% - 60px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
    transition: var(--transition-fast);
}

.video-title-link:hover {
    color: var(--accent-primary);
}

.th-channel {
    min-width: 150px;
}

.th-date {
    min-width: 100px;
}

.th-duration {
    min-width: 90px;
}

.th-views {
    min-width: 120px;
}

.th-transcript {
    width: 100px;
    text-align: center;
}

.td-transcript {
    text-align: center;
}

.transcript-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 14px;
}

.transcript-badge.available {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.transcript-badge.unavailable {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.th-actions {
    width: 120px;
    text-align: center;
}

.td-actions {
    text-align: center;
}

.table-actions {
    display: flex;
    gap: 0.375rem;
    justify-content: center;
}

.table-action-btn {
    padding: 0.375rem 0.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition-fast);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.table-action-btn i {
    font-size: 16px;
}

/* Batch Action Bar */
.batch-action-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border-medium);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    z-index: 900;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.batch-action-bar.show {
    transform: translateY(0);
}

.batch-action-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.batch-action-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.batch-action-left i {
    font-size: 20px;
    color: var(--accent-primary);
}

.batch-action-right {
    display: flex;
    gap: 0.75rem;
}

/* Responsive Table */
@media (max-width: 1200px) {
    .filters-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .th-title,
    .td-title {
        max-width: 250px;
    }
}

@media (max-width: 768px) {
    .view-toggle {
        order: -1;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .table-wrapper {
        overflow-x: scroll;
    }

    .videos-table {
        min-width: 900px;
    }

    .batch-action-content {
        padding: 0.875rem 1rem;
        flex-direction: column;
        gap: 0.75rem;
    }

    .batch-action-right {
        width: 100%;
        flex-direction: column;
    }

    .batch-action-right .btn {
        width: 100%;
    }
}

/* ============================================
   FILTER SIDEBAR (Table View)
   ============================================ */

/* Table Layout with Sidebar */
.table-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    transition: grid-template-columns 0.3s ease;
}

.table-layout.sidebar-active {
    grid-template-columns: 1fr 320px;
}

.table-layout.sidebar-collapsed {
    grid-template-columns: 1fr 0;
}

.table-main {
    min-width: 0;
}

/* Filter Sidebar */
.filter-sidebar {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: none;
}

.table-layout.sidebar-active .filter-sidebar {
    display: block;
}

.table-layout.sidebar-collapsed .filter-sidebar {
    opacity: 0;
    transform: translateX(20px);
    pointer-events: none;
}

.filter-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-subtle);
}

.filter-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.btn-icon-sm {
    padding: 0.375rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.btn-icon-sm i {
    font-size: 18px;
}

.filter-sidebar-body {
    padding: 1.25rem;
}

/* Filter Sections */
.filter-section {
    margin-bottom: 1.5rem;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.filter-section-header label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.btn-text-sm {
    padding: 0;
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-text-sm:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Channel Filter List */
.channel-filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Filter Checkbox */
.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    user-select: none;
}

.filter-checkbox:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
}

.filter-checkbox input[type="checkbox"],
.filter-checkbox input[type="radio"] {
    cursor: pointer;
    width: 16px;
    height: 16px;
    margin: 0;
}

.filter-checkbox span {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.filter-checkbox input:checked~span {
    color: var(--text-primary);
    font-weight: 500;
}

/* Filter Options (for radio buttons) */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .table-layout {
        grid-template-columns: 1fr 280px;
    }
}

@media (max-width: 968px) {
    .table-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        display: none;
    }
}

/* ========================================
   LANDING PAGE STYLES
   ======================================== */

.landing-page {
    height: 100vh;
    background-color: #0a0a0f;
    background-image: url('/static/cover.png');
    background-size: cover;
    background-position: top center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
}

.landing-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.85) 0%, rgba(10, 10, 15, 0.95) 100%);
    z-index: 0;
}

.landing-container {
    position: relative;
    z-index: 1;
}

.landing-container {
    max-width: 1200px;
    width: 100%;
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;
    gap: 3rem;
    align-items: center;
}

/* Left Column - Features */
.landing-left {
    color: #e0e0e0;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.logo-svg-large {
    width: 40px;
    height: 40px;
}

.landing-logo h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #e0e0e0;
    margin: 0;
}

.landing-title {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #e0e0e0;
}

.landing-subtitle {
    font-size: 1.1rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    color: rgba(224, 224, 224, 0.7);
    max-width: 600px;
}

.landing-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.35rem 0;
    color: rgba(224, 224, 224, 0.85);
    font-size: 0.95rem;
}

.feature-item i {
    color: #6366f1;
    font-size: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.feature-item span {
    line-height: 1.5;
    flex: 1;
}

/* Right Column - Pricing */
.landing-right {
    position: sticky;
    top: 2rem;
}

.landing-login-card {
    background-color: rgba(30, 30, 30, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(99, 102, 241, 0.2);
    padding: 2.5rem;
    border-radius: 12px;
    text-align: center;
}

.landing-login-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #e0e0e0;
    margin: 0 0 1rem 0;
}

.login-subtitle {
    color: rgba(224, 224, 224, 0.7);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 2rem;
}

.google-login-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: #ffffff;
    color: #1f1f1f;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.google-login-btn:hover {
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Landing Footer */
.landing-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 2rem;
    z-index: 2;
}

.landing-footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    color: rgba(224, 224, 224, 0.5);
    font-size: 0.875rem;
}

.landing-footer-content p {
    margin: 0;
}

.landing-footer-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.landing-footer-link {
    color: rgba(224, 224, 224, 0.7);
    text-decoration: none;
    transition: color 0.2s ease;
}

.landing-footer-link:hover {
    color: #6366f1;
}

.footer-separator {
    color: rgba(224, 224, 224, 0.3);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .landing-page {
        height: auto;
        min-height: 100vh;
    }

    .landing-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .landing-right {
        position: relative;
        top: 0;
    }

    .landing-title {
        font-size: 2rem;
    }

    .landing-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    .landing-page {
        padding: 1rem;
    }

    .landing-title {
        font-size: 2rem;
    }

    .landing-subtitle {
        font-size: 1rem;
    }

    .landing-login-card {
        padding: 2rem;
    }

    .google-login-btn {
        font-size: 0.95rem;
        padding: 0.875rem 1.5rem;
    }

    .landing-title {
        font-size: 1.75rem;
    }

    .landing-footer {
        padding: 1rem;
    }

    .landing-footer-content {
        flex-direction: column;
        text-align: center;
        font-size: 0.8rem;
    }

    .landing-subtitle {
        font-size: 1rem;
    }

    .feature-item {
        font-size: 0.9rem;
    }
}

/* ============================================================================
   Email Settings Sidebar (Wider Sidebar)
   ============================================================================ */

.email-settings-sidebar .tray-content {
    width: 550px;
    max-width: 90vw;
}

.email-setting-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.email-setting-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.email-setting-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
}

.email-setting-info {
    flex: 1;
}

.email-setting-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.email-setting-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.email-setting-toggle {
    flex-shrink: 0;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--border);
    transition: var(--transition-base);
    border-radius: 28px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: var(--transition-base);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.toggle-switch input:checked+.toggle-slider {
    background-color: var(--primary);
}

.toggle-switch input:checked+.toggle-slider:before {
    transform: translateX(22px);
}

.toggle-switch input:disabled+.toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Time Picker */
.setting-time {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-base);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.time-picker-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.time-picker-label i {
    color: var(--primary);
    font-size: 1rem;
}

.time-picker-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition-base);
}

.time-picker-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.time-picker-hint {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Modal Actions */
.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

.email-status-box {
    margin-top: 1rem;
    padding: 0.875rem 1rem;
    background-color: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #0369a1;
}

.email-status-box i {
    flex-shrink: 0;
    color: var(--primary);
    font-size: 1.125rem;
}

.email-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--bg-base);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.email-feature-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.email-feature-item i {
    flex-shrink: 0;
    color: var(--primary);
    font-size: 1rem;
}

/* Email Channels List */
.email-channels-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.email-channel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-base);
}

.email-channel-item:hover {
    background-color: var(--bg-elevated);
    border-color: var(--border);
}

.email-channel-info {
    flex: 1;
}

.email-channel-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.email-channel-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.email-channel-time i {
    color: var(--primary);
}

.email-channel-actions {
    display: flex;
    gap: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-muted);
}

/* Removed - replaced by more specific selectors */

.empty-state p {
    margin: 0.5rem 0;
}

.empty-state-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.loading-channels {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
}

.loading-channels i {
    font-size: 1.5rem;
    color: var(--primary);
}

.spinning {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.email-feature-item i {
    flex-shrink: 0;
    color: var(--primary);
    font-size: 1.125rem;
}

/* Email Preview Card */
.email-preview-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.email-preview-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.email-preview-header i {
    color: var(--primary);
    font-size: 1.25rem;
}

.email-preview-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.email-preview-content {
    background: #f8fafc;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.875rem;
}

.email-preview-subject {
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.email-preview-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.email-preview-section {
    padding: 0.75rem;
    background: white;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.email-preview-section strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.email-preview-section p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Info Notice */
.email-info-notice {
    background: #fef3c7;
    border: 1px solid #fde047;
    border-radius: var(--radius-md);
    padding: 1rem;
    display: flex;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #854d0e;
}

.email-info-notice i {
    flex-shrink: 0;
    color: #ca8a04;
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.email-info-notice strong {
    display: block;
    margin-bottom: 0.25rem;
}

.email-info-notice p {
    margin: 0;
    line-height: 1.6;
}

/* Email Channels List */
.email-channels-header {
    margin-bottom: 1rem;
}

.email-channels-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.email-channel-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: var(--transition-fast);
}

.email-channel-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border);
}

.email-channel-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.email-channel-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1rem;
}

.email-channel-details {
    flex: 1;
}

.email-channel-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
    margin-bottom: 0.125rem;
}

.email-channel-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.email-channel-toggle {
    flex-shrink: 0;
    margin-left: 1rem;
}

.loading-channels {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    color: var(--text-muted);
}

.loading-channels i {
    font-size: 1.5rem;
    color: var(--primary);
}

/* ============================================================================
   Email Subscriptions Modal
   ============================================================================ */

/* Info Banner */
.info-banner {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #93c5fd;
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-banner i {
    flex-shrink: 0;
    color: #3b82f6;
    font-size: 1.5rem;
    margin-top: 0.125rem;
}

.info-banner strong {
    display: block;
    color: #1e40af;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.info-banner p {
    margin: 0;
    color: #1e40af;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Subscriptions Section */
.subscriptions-section {
    margin-top: 1.5rem;
}

.subscriptions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.subscriptions-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.subscriptions-count {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Subscriptions List */
.subscriptions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subscription-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    transition: var(--transition-base);
}

.subscription-item:hover {
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.subscription-info {
    flex: 1;
}

.subscription-channel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.subscription-channel i {
    color: var(--primary);
    font-size: 1.125rem;
}

.subscription-channel strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.subscription-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
}

.subscription-time {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text-muted);
}

.subscription-time i {
    color: var(--primary);
    font-size: 0.875rem;
}

.subscription-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.subscription-status.active {
    background: #d1fae5;
    color: #065f46;
}

.subscription-status.inactive {
    background: var(--bg-base);
    color: var(--text-muted);
}

.subscription-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-danger {
    color: #dc2626 !important;
}

.btn-danger:hover {
    background-color: #fee2e2 !important;
}

/* Empty & Loading States */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

/* Removed - replaced by more specific selectors */

.empty-state strong {
    display: block;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin: 0.375rem 0;
    font-size: 0.875rem;
}

.loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.loading-state i {
    font-size: 1.5rem;
    color: var(--primary);
}

.error-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #dc2626;
}

.error-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

/* ============================================================================
   Settings Section (for Channel Email Modal)
   ============================================================================ */

.settings-section {
    padding: 0;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background-color: var(--bg-elevated);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
}

.setting-info {
    flex: 1;
}

.setting-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setting-title i {
    font-size: 1.25rem;
    color: var(--primary);
}

.setting-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.setting-control {
    flex-shrink: 0;
}

.setting-status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background-color: var(--bg-base);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.setting-status i {
    color: var(--primary);
    font-size: 1rem;
}

/* ============================================
   Empty State Styles
   ============================================ */

.empty-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.empty-state-content {
    text-align: center;
    max-width: 600px;
}

.empty-state-icon {
    font-size: 4rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

.empty-state-icon i {
    font-size: 4rem;
    color: var(--primary);
}

.empty-state .btn i {
    font-size: 1rem;
}

.empty-state-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.empty-state-description {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.empty-state-content .btn {
    margin-bottom: 3rem;
}

.empty-state-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.feature-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: all 0.2s ease;
}

.feature-item:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: var(--radius-md);
    color: white;
}

.feature-icon i {
    font-size: 1.5rem;
}

.feature-item span {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
}

/* ============================================
   ONBOARDING MODAL
   ============================================ */
.onboarding-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.onboarding-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.onboarding-container {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    animation: modalSlideUp 0.3s ease-out;
}

.onboarding-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem 2rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.onboarding-logo {
    width: 48px;
    height: 48px;
    margin: 0;
    flex-shrink: 0;
}

.onboarding-header h1 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.onboarding-content {
    padding: 2rem;
}

.onboarding-intro {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.onboarding-section {
    margin-bottom: 2rem;
}

.onboarding-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.onboarding-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.onboarding-section li {
    position: relative;
    padding-left: 1.75rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.onboarding-section li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

.onboarding-language-section {
    padding: 0.0rem 2rem 1.5rem 2rem;
    border-bottom: 1px solid var(--border-subtle);
    background: transparent;
}

.onboarding-language-section label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    text-align: center;
}

.onboarding-language-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-language-select:hover {
    border-color: var(--border-strong);
}

.onboarding-language-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Onboarding custom dropdown */
#onboardingLanguageDropdown {
    max-width: 300px;
    margin: 0 auto;
}

#onboardingLanguageDropdown .language-dropdown-btn {
    width: 100%;
    justify-content: space-between;
}

/* Disclaimer Status Button */
.disclaimer-status-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
}

.disclaimer-status-btn:hover {
    background: var(--card-hover);
    border-color: var(--border-medium);
}

.disclaimer-status-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.disclaimer-icon {
    font-size: 1.5rem;
    color: var(--success);
    flex-shrink: 0;
}

.disclaimer-status-text {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.disclaimer-status-title {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.disclaimer-status-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.disclaimer-arrow {
    font-size: 1.25rem;
    color: var(--text-muted);
    flex-shrink: 0;
    transition: var(--transition-fast);
}

.disclaimer-status-btn:hover .disclaimer-arrow {
    color: var(--text-primary);
    transform: translateX(2px);
}

.onboarding-accept-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--accent-gradient);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.0625rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.onboarding-accept-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.onboarding-accept-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .onboarding-container {
        max-height: 95vh;
    }

    .onboarding-header {
        padding: 1rem 1rem 0.75rem;
        gap: 0.75rem;
    }

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

    .onboarding-content {
        padding: 1.5rem;
    }

    .onboarding-logo {
        width: 40px;
        height: 40px;
    }
}

/* Survey Button */
.survey-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem;
    background: transparent;
    color: #667eea;
    border: 1.5px solid #667eea;
    border-radius: 1.5rem;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    transition: all 0.2s ease;
}

.survey-btn:hover {
    background: rgba(102, 126, 234, 0.05);
    border-color: #764ba2;
    color: #764ba2;
}

.survey-btn i {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .survey-btn span {
        display: none;
    }

    .survey-btn {
        padding: 0.5rem;
        width: 36px;
        height: 36px;
        justify-content: center;
    }
}
