/* ============================================
   YouTube Video Summarizer — Dark Theme
   ============================================ */

:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0f1525;
    --bg-card: #131a2e;
    --bg-input: #111827;
    --border: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-glow: rgba(59, 130, 246, 0.15);
    --accent-line: rgba(59, 130, 246, 0.3);
    --green: #22c55e;
    --red: #ef4444;
    --yellow: #eab308;
}

* {
    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;
}

/* ============ LANDING VIEW ============ */

#landing-view {
    min-height: 100vh;
    background: var(--bg-primary);
    background-image:
        radial-gradient(ellipse at 50% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 50%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
}

.landing-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 48px;
    max-width: 1280px;
    margin: 0 auto;
}

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

.logo-img {
    width: 32px;
    height: 32px;
    filter: invert(1);
}

.logo-text {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Hero */
.hero {
    text-align: center;
    padding: 60px 24px 60px;
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

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

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 40px;
}

/* Search Bar */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 6px 6px 20px;
    max-width: 580px;
    margin: 0 auto 20px;
    transition: border-color 0.2s;
}

.search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-icon { display: flex; align-items: center; margin-right: 12px; }

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
}

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

.btn-summarize {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-summarize:hover { background: var(--accent-hover); }
.btn-summarize:disabled { opacity: 0.6; cursor: not-allowed; }

/* Badges */
.badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.badge {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
}

.badge-separator { color: var(--text-muted); font-size: 11px; }

/* Error */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 12px 20px;
    border-radius: 10px;
    max-width: 580px;
    margin: 0 auto 24px;
    font-size: 14px;
}

/* Loading */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 40px auto;
}

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

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

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

/* ============ DEMO CARD ============ */

.demo-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    max-width: 740px;
    margin: 40px auto 0;
    overflow: hidden;
}

.demo-label {
    color: var(--text-muted);
    font-size: 11px;
    text-align: right;
    padding: 12px 16px 0;
    font-family: monospace;
}

.demo-content {
    display: flex;
    padding: 16px;
    gap: 20px;
}

.demo-video { flex: 0 0 200px; }

.demo-thumbnail {
    width: 200px;
    height: 120px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f1525;
}

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

.play-button-demo {
    position: absolute;
    width: 44px;
    height: 44px;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-summary { flex: 1; text-align: left; }
.demo-summary h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }

/* Demo — notes summary block */
.demo-notes-summary {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}

.demo-notes-bar {
    width: 3px;
    background: var(--accent);
    border-radius: 3px;
    flex-shrink: 0;
}

.demo-notes-summary p {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Demo — timeline */
.demo-timeline {
    position: relative;
    padding-left: 16px;
    border-left: 2px solid var(--accent-line);
}

.demo-timeline-item {
    position: relative;
    padding-bottom: 14px;
}

.demo-timeline-item:last-child { padding-bottom: 0; }

.demo-dot {
    position: absolute;
    left: -21px;
    top: 4px;
    width: 10px;
    height: 10px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-card);
}

.demo-timeline-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.demo-timeline-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.demo-points {
    list-style: none;
    padding: 0;
}

.demo-points li {
    position: relative;
    padding-left: 14px;
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 4px;
}

.demo-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 5px;
    height: 5px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.6;
}

.timestamp-badge {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ============ RESULT VIEW ============ */

#result-view {
    min-height: 100vh;
    background: var(--bg-primary);
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 48px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}

.topbar-actions { display: flex; gap: 10px; flex-shrink: 0; }

.btn-action {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

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

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

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

/* Result Main */
.result-main { max-width: 900px; margin: 0 auto; }

.result-body { padding: 32px 40px 60px; }

/* Video Info Row */
.video-info-row {
    display: flex;
    gap: 28px;
    align-items: flex-start;
    margin-bottom: 36px;
}

.video-info-row .video-player {
    flex: 0 0 360px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
}

.video-thumb {
    width: 100%;
    display: block;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: var(--bg-card);
}

.play-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-overlay a { display: flex; transition: transform 0.2s; }
.play-overlay a:hover { transform: scale(1.1); }

.video-info-text { flex: 1; }

.result-video-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.video-meta {
    display: flex;
    gap: 28px;
    margin-bottom: 14px;
}

.meta-item { display: flex; flex-direction: column; gap: 4px; }

.meta-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.meta-value { font-size: 14px; font-weight: 600; }

.sentiment-badge { display: inline-flex; align-items: center; gap: 6px; }

.sentiment-badge::before {
    content: '';
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--green);
}

.sentiment-badge.negative::before { background: var(--red); }
.sentiment-badge.neutral::before { background: var(--yellow); }

.tags-container { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* ============ NOTES SECTIONS ============ */

.notes-summary,
.notes-chapters {
    margin-bottom: 32px;
}

.notes-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

/* Quick Summary — accent bar */
.notes-summary-body {
    display: flex;
    gap: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
}

.notes-accent-bar {
    width: 4px;
    background: linear-gradient(180deg, var(--accent), rgba(59, 130, 246, 0.3));
    border-radius: 4px;
    flex-shrink: 0;
}

.quick-summary-text {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.8;
}

/* ============ TIMELINE ============ */

.timeline {
    position: relative;
    padding-left: 28px;
}

/* Vertical line */
.timeline::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--accent), var(--accent-line) 80%, transparent);
    border-radius: 2px;
}

/* Each chapter */
.timeline-item {
    position: relative;
    padding-bottom: 32px;
}

.timeline-item:last-child { padding-bottom: 0; }

/* Dot on timeline */
.timeline-dot {
    position: absolute;
    left: -28px;
    top: 4px;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 0 0 2px var(--accent-line);
}

/* Chapter header */
.timeline-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.timeline-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Points list */
.timeline-points {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-points li {
    position: relative;
    padding-left: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.timeline-points li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 7px;
    height: 7px;
    background: var(--accent);
    border-radius: 50%;
    opacity: 0.5;
}

/* ============ PRINT STYLES ============ */
@media print {
    body { background: white; color: #1a1a1a; }

    #landing-view,
    .topbar-actions,
    .play-overlay,
    .video-info-row .video-player {
        display: none !important;
    }

    #result-view { display: block !important; }

    .result-header {
        background: white;
        border-bottom: 2px solid #e5e7eb;
        padding: 16px 0;
    }

    .result-video-title { color: #1a1a1a; }
    .result-body { padding: 20px 0; }

    .notes-summary-body {
        background: white;
        border: 1px solid #e5e7eb;
    }

    .quick-summary-text,
    .timeline-points li { color: #374151; }

    .tag {
        background: #f3f4f6;
        border-color: #e5e7eb;
        color: #374151;
    }

    .timeline::before { background: #d1d5db; }
    .timeline-dot {
        background: #6b7280;
        border-color: white;
        box-shadow: none;
    }
}

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

    .hero { padding: 40px 20px 40px; }
    .hero h1 { font-size: 28px; }
    .hero-subtitle { font-size: 14px; }
    .hero-subtitle br { display: none; }

    .demo-content { flex-direction: column; }
    .demo-video { flex: none; }
    .demo-thumbnail { width: 100%; height: auto; aspect-ratio: 16/9; }

    .result-header {
        padding: 16px 20px;
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .result-body { padding: 20px; }

    .video-info-row {
        flex-direction: column;
        gap: 16px;
    }

    .video-info-row .video-player { flex: none; }

    .result-video-title { font-size: 18px; }
    .video-meta { gap: 20px; }
    .badges { flex-wrap: wrap; }
}
