:root {
    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 18px;
    --radius-xl: 28px;
    --transition: 0.25s cubic-bezier(.4, .0, .2, 1);
    --transition-slow: 0.4s cubic-bezier(.4, .0, .2, 1);

    --accent: #FF385C;
    --accent-soft: rgba(255, 56, 92, 0.15);
    --accent-glow: rgba(255, 56, 92, 0.4);
    --accent-gradient: linear-gradient(135deg, #FF385C, #FF6B8A);

    --blue: #5BA3F5;
    --blue-soft: rgba(91, 163, 245, 0.15);
    --blue-gradient: linear-gradient(135deg, #5BA3F5, #82C4FF);
    --green: #4ADE80;
    --green-soft: rgba(74, 222, 128, 0.15);
    --green-gradient: linear-gradient(135deg, #4ADE80, #86EFAC);
    --purple: #A78BFA;
    --purple-soft: rgba(167, 139, 250, 0.15);
    --purple-gradient: linear-gradient(135deg, #A78BFA, #C4B5FD);
    --orange: #FB923C;
    --orange-soft: rgba(251, 146, 60, 0.15);
    --orange-gradient: linear-gradient(135deg, #FB923C, #FDBA74);
}

/* Dark Theme (default) */
[data-theme="dark"] {
    --bg-primary: #141822;
    --bg-secondary: #1b2030;
    --bg-tertiary: #222840;
    --bg-card: rgba(35, 42, 65, 0.55);
    --bg-card-hover: rgba(50, 58, 85, 0.65);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --bg-glass-strong: rgba(255, 255, 255, 0.10);
    --border-color: rgba(255, 255, 255, 0.10);
    --border-glow: rgba(255, 56, 92, 0.35);
    --text-primary: #f0f0f5;
    --text-secondary: #b0b8d0;
    --text-muted: #6b7394;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 60px rgba(255, 56, 92, 0.1);
    color-scheme: dark;
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f3f4f8;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eaecf2;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    --bg-glass: rgba(0, 0, 0, 0.03);
    --bg-glass-strong: rgba(0, 0, 0, 0.06);
    --border-color: rgba(0, 0, 0, 0.10);
    --border-glow: rgba(255, 56, 92, 0.25);
    --text-primary: #1a1d2e;
    --text-secondary: #4a5072;
    --text-muted: #8891b0;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 60px rgba(255, 56, 92, 0.05);
    color-scheme: light;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* ── Scrollbar ─────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

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

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* ── Login Screen ──────────────────── */
.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(255, 56, 92, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 60%, rgba(91, 163, 245, 0.10) 0%, transparent 45%),
        radial-gradient(ellipse at 50% 90%, rgba(167, 139, 250, 0.08) 0%, transparent 40%),
        linear-gradient(160deg, #141822 0%, #1b2030 100%);
    padding: 24px;
}

.login-card {
    text-align: center;
    padding: 56px 44px;
    background: rgba(35, 42, 65, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-xl);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    backdrop-filter: blur(24px) saturate(1.4);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    max-width: 440px;
    width: 100%;
    animation: fadeInUp 0.6s ease;
}

.login-logo {
    margin-bottom: 36px;
}

.logo-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 24px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 3s ease-in-out infinite;
    box-shadow: 0 4px 24px var(--accent-glow);
}

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

.login-logo h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.login-logo h1 span {
    background: linear-gradient(135deg, var(--accent), var(--blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-logo p {
    color: var(--text-secondary);
    margin-top: 12px;
    font-size: 14px;
}

.btn-login {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 36px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    background: white;
}

/* ── Header ────────────────────────── */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 32px;
    background: rgba(20, 24, 34, 0.75);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    backdrop-filter: blur(16px) saturate(1.3);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-logo h2 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Guest Mode (Login Screen) ──── */
.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 12px;
}

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

.guest-mode-section {
    text-align: center;
}

.guest-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.guest-input-group {
    display: flex;
    gap: 8px;
}

.input-guest {
    flex: 1;
    padding: 10px 14px;
    background: rgba(20, 24, 34, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition);
}

.input-guest:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

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

.btn-guest {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-guest:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.guest-note {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.btn-theme-float {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--bg-glass-strong);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    z-index: 10;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.btn-theme-float:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    transform: scale(1.05);
}

/* ── Feature List (Login Screen) ──── */
.feature-list {
    list-style: none;
    text-align: left;
    margin-top: 14px;
    padding: 0;
    font-size: 12px;
    line-height: 1.9;
}

.feature-list li {
    padding-left: 22px;
    position: relative;
    color: var(--text-secondary);
}

.feature-list li::before {
    position: absolute;
    left: 0;
    font-weight: 700;
    font-size: 13px;
}

.feature-yes::before {
    content: '✓';
    color: var(--green);
}

.feature-no::before {
    content: '✗';
    color: var(--text-muted);
}

.feature-no {
    opacity: 0.55;
}

/* ── Light Mode Overrides ──────── */
[data-theme="light"] .login-screen {
    background: linear-gradient(135deg, #e8eaf0 0%, #f0f2f8 50%, #fce4ec 100%);
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.75);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .btn-login {
    background: #fff;
    border-color: rgba(0, 0, 0, 0.12);
    color: #333;
}

[data-theme="light"] .input-guest,
[data-theme="light"] .input-date,
[data-theme="light"] .input-select {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

[data-theme="light"] .btn-guest {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--text-primary);
}

[data-theme="light"] .filters-bar {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .header {
    background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .loading-overlay {
    background: rgba(255, 255, 255, 0.7);
}

[data-theme="light"] .btn-chip {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
}

[data-theme="light"] .content-type-tabs {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .report-page {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.08);
}

/* ── Guest Mode Banner ──────────── */
.guest-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 32px;
    background: rgba(255, 56, 92, 0.08);
    border-bottom: 1px solid rgba(255, 56, 92, 0.2);
    font-size: 13px;
    color: var(--text-secondary);
}

.guest-banner button {
    padding: 5px 14px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 100px;
    color: white;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.guest-banner button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 12px var(--accent-glow);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.channel-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 14px 5px 5px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.channel-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

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

.btn-icon:hover {
    background: var(--bg-glass-strong);
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.18);
}

/* ── Filters Bar ───────────────────── */
.filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    padding: 18px 32px;
    background: rgba(27, 32, 48, 0.6);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.filter-group label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-sep {
    color: var(--text-muted);
    font-size: 14px;
}

.input-date,
.input-select {
    padding: 8px 12px;
    background: rgba(20, 24, 34, 0.7);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    transition: var(--transition);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.input-date:focus,
.input-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 0 20px var(--accent-soft);
}

.input-select {
    min-width: 160px;
    cursor: pointer;
}

.quick-dates {
    display: flex;
    gap: 4px;
}

.btn-chip {
    padding: 5px 13px;
    background: rgba(20, 24, 34, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-chip:hover {
    border-color: var(--text-muted);
    color: var(--text-primary);
}

.btn-chip.active {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 12px var(--accent-soft);
}

.content-type-tabs {
    display: flex;
    gap: 2px;
    background: rgba(20, 24, 34, 0.7);
    border-radius: var(--radius-sm);
    padding: 3px;
    border: 1px solid var(--border-color);
}

.btn-tab {
    padding: 7px 18px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-tab.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px var(--accent-glow);
}

.filter-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.btn-primary,
.btn-secondary,
.btn-accent {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 2px 12px var(--accent-soft);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.2);
    background: var(--bg-glass-strong);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent), #E11D48);
    color: white;
    box-shadow: 0 2px 16px var(--accent-glow);
}

.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 28px var(--accent-glow);
}

/* ── Loading ───────────────────────── */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(14, 18, 30, 0.7);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 1000;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ── Summary Cards ─────────────────── */
.summary-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 24px 32px;
}

.summary-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    opacity: 0;
    transition: var(--transition);
}

#card-views::before {
    background: var(--blue-gradient);
}

#card-watchtime::before {
    background: var(--green-gradient);
}

#card-subs::before {
    background: var(--purple-gradient);
}

#card-engagement::before {
    background: var(--orange-gradient);
}

.summary-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.summary-card:hover::before {
    opacity: 1;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.views-icon {
    background: var(--blue-soft);
    color: var(--blue);
}

.watchtime-icon {
    background: var(--green-soft);
    color: var(--green);
}

.subs-icon {
    background: var(--purple-soft);
    color: var(--purple);
}

.engagement-icon {
    background: var(--orange-soft);
    color: var(--orange);
}

.card-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* ── Charts ────────────────────────── */
.charts-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 0 32px 24px;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px 28px 44px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    overflow: hidden;
    min-width: 0;
}

.chart-card canvas {
    width: 100% !important;
    max-width: 100%;
}

.chart-card:hover {
    border-color: rgba(255, 255, 255, 0.14);
}

.chart-card h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.chart-wide {
    grid-column: 1 / -1;
}

/* ── Top Videos ────────────────────── */
.top-videos-section {
    padding: 0 32px 24px;
}

.top-videos-section h3 {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 16px;
}

.video-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    transition: var(--transition);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.video-item:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.14);
    transform: translateX(4px);
}

.video-rank {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-muted);
    width: 30px;
    text-align: center;
    flex-shrink: 0;
}

.video-rank.top-3 {
    background: linear-gradient(135deg, var(--accent), var(--orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.video-thumbnail {
    width: 120px;
    height: 68px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

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

.video-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
}

.video-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.video-type-badge {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.badge-shorts {
    background: var(--accent-soft);
    color: var(--accent);
}

.badge-long {
    background: var(--blue-soft);
    color: var(--blue);
}

.badge-live {
    background: var(--green-soft);
    color: var(--green);
}

.video-stats {
    display: flex;
    gap: 20px;
    flex-shrink: 0;
}

.video-stat {
    text-align: right;
}

.video-stat-value {
    font-size: 15px;
    font-weight: 700;
    display: block;
}

.video-stat-label {
    font-size: 11px;
    color: var(--text-muted);
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 14px;
    text-align: center;
    padding: 40px;
}

/* ── AI Insights ───────────────────── */
.insights-section {
    padding: 0 32px 32px;
}

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

.insights-header h3 {
    font-size: 15px;
    font-weight: 600;
}

.insights-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 28px;
    line-height: 1.8;
    font-size: 14px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.insights-content h2 {
    font-size: 18px;
    margin: 24px 0 12px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.insights-content h2:first-child {
    margin-top: 0;
}

.insights-content ul {
    padding-left: 20px;
}

.insights-content li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* ── Report Modal ──────────────────── */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(10, 12, 20, 0.75);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 24px;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
    animation: fadeInUp 0.3s ease;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-glass);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

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

.report-preview {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* ── Report Print Styles ───────────── */
.report-page {
    background: white;
    color: #1a1a1a;
    padding: 48px;
    border-radius: var(--radius);
    font-size: 13px;
    line-height: 1.7;
}

.report-page h1 {
    font-size: 24px;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.report-page .report-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid #FF385C;
}

.report-page h2 {
    font-size: 16px;
    color: #FF385C;
    margin: 28px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.report-summary-item {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    text-align: center;
}

.report-summary-item .label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.report-summary-item .value {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    margin-top: 4px;
}

.report-table {
    width: 100%;
    border-collapse: collapse;
    margin: 12px 0;
    font-size: 12px;
}

.report-table th {
    text-align: left;
    padding: 10px 12px;
    background: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.report-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
}

.report-table tr:hover td {
    background: #f8f9fa;
}

.report-insights {
    background: #fff8f8;
    border-left: 4px solid #FF385C;
    padding: 20px;
    border-radius: 0 8px 8px 0;
    margin-top: 16px;
}

.report-insights h2 {
    border: none;
    padding: 0;
    margin-top: 0;
}

/* ── Animations ────────────────────── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

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

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 4px 24px var(--accent-soft);
    }

    50% {
        box-shadow: 0 4px 40px var(--accent-glow), 0 0 60px var(--accent-soft);
    }
}

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

    100% {
        background-position: 200% 0;
    }
}

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

    .charts-section {
        grid-template-columns: 1fr;
    }

    .filters-bar {
        gap: 14px;
    }
}

@media (max-width: 900px) {
    .header {
        padding: 12px 20px;
    }

    .filters-bar {
        padding: 16px 20px;
    }

    .summary-section {
        padding: 16px 20px;
    }

    .charts-section {
        padding: 0 20px 16px;
    }

    .top-videos-section {
        padding: 0 20px 16px;
    }

    .insights-section {
        padding: 0 20px 16px;
    }

    .video-item {
        flex-wrap: wrap;
        gap: 10px;
    }

    .video-info {
        flex-basis: calc(100% - 170px);
        min-width: 150px;
    }

    .video-stats {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 12px 16px;
    }

    .header-logo h2 {
        font-size: 14px;
    }

    .channel-info span {
        display: none;
    }

    .filters-bar {
        padding: 14px 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .date-inputs {
        width: 100%;
    }

    .input-date {
        flex: 1;
        min-width: 0;
    }

    .quick-dates {
        flex-wrap: wrap;
    }

    .content-type-tabs {
        width: 100%;
    }

    .btn-tab {
        flex: 1;
        text-align: center;
        padding: 8px 8px;
        font-size: 12px;
    }

    .input-select {
        width: 100%;
    }

    .filter-actions {
        margin-left: 0;
        width: 100%;
    }

    .filter-actions .btn-primary,
    .filter-actions .btn-accent {
        flex: 1;
        justify-content: center;
    }

    .summary-section {
        padding: 12px 16px;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .summary-card {
        padding: 16px;
        gap: 12px;
    }

    .card-value {
        font-size: 20px;
    }

    .card-icon {
        width: 40px;
        height: 40px;
    }

    .card-icon svg {
        width: 20px;
        height: 20px;
    }

    .charts-section {
        padding: 0 16px 12px;
    }

    .chart-card {
        padding: 16px;
    }

    .top-videos-section {
        padding: 0 16px 12px;
    }

    .insights-section {
        padding: 0 16px 16px;
    }

    .video-item {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 12px;
    }

    .video-thumbnail {
        width: 80px;
        height: 45px;
    }

    .video-info {
        flex-basis: calc(100% - 140px);
    }

    .video-stats {
        gap: 12px;
        width: 100%;
        justify-content: flex-end;
    }

    .video-stat-value {
        font-size: 13px;
    }

    .report-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal {
        padding: 12px;
    }

    .modal-content {
        border-radius: var(--radius);
    }

    .report-preview {
        padding: 16px;
    }

    .report-page {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .summary-section {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .summary-card {
        padding: 14px 16px;
    }

    .card-value {
        font-size: 22px;
    }

    .video-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .video-thumbnail {
        width: 100%;
        height: auto;
        aspect-ratio: 16/9;
    }

    .video-info {
        flex-basis: 100%;
        width: 100%;
    }

    .video-title {
        white-space: normal;
    }

    .video-stats {
        width: 100%;
        justify-content: space-around;
    }

    .report-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-page {
        padding: 16px;
    }
}