/* CSS Variables */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --text-primary: #f0f6fc;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --accent-primary: #58a6ff;
    --accent-secondary: #1f6feb;
    --accent-success: #3fb950;
    --accent-warning: #d29922;
    --accent-danger: #f85149;
    --border-color: #30363d;
    --shadow: 0 8px 24px rgba(0,0,0,0.4);
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f6f8fa;
    --bg-tertiary: #eaeef2;
    --text-primary: #24292f;
    --text-secondary: #57606a;
    --text-muted: #8b949e;
    --border-color: #d0d7de;
    --shadow: 0 8px 24px rgba(0,0,0,0.1);
}

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

html {
    scroll-behavior: smooth;
}

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

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Navbar */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.nav-brand a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 1.2rem;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.2s;
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.date-select {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.theme-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

[data-theme="dark"] .sun-icon { display: block; }
[data-theme="dark"] .moon-icon { display: none; }
[data-theme="light"] .sun-icon { display: none; }
[data-theme="light"] .moon-icon { display: block; }

/* User Menu */
.user-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border-color);
}

.user-name {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all 0.2s;
}

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

.login-link {
    padding: 0.5rem 1rem;
    background: var(--accent-primary);
    color: white !important;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    transition: background 0.2s;
}

.login-link:hover {
    background: var(--accent-secondary);
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Page Header */
.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

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

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.stat-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.stat-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.stat-icon.video-icon { color: #f85149; }
.stat-icon.article-icon { color: #58a6ff; }
.stat-icon.github-icon { color: #8b949e; }
.stat-icon.reddit-icon { color: #ff4500; }

.stat-content {
    flex: 1;
}

.stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
}

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

.stat-link {
    font-size: 0.875rem;
    color: var(--accent-primary);
}

/* Sections */
.section {
    margin-bottom: 3rem;
}

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

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.view-all-link {
    font-size: 0.9rem;
    color: var(--accent-primary);
}

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

.video-grid.large {
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
}

.video-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s;
}

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

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-tertiary);
}

.video-thumbnail.large {
    padding-top: 56.25%;
}

.video-thumbnail.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: rgba(0,0,0,0.7);
    border-radius: 50%;
    transition: all 0.2s;
}

.play-button.large {
    width: 80px;
    height: 80px;
}

.play-button:hover {
    background: var(--accent-danger);
    transform: translate(-50%, -50%) scale(1.1);
}

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

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
}

.video-title a {
    color: var(--text-primary);
}

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

.video-channel {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Podcast Cards */
.podcast-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.podcast-card {
    position: relative;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    transition: all 0.2s;
}

.podcast-card:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow);
}

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

.podcast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 12px;
    color: white;
}

.podcast-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    align-items: center;
}

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

.podcast-duration {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.podcast-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.podcast-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.podcast-title a {
    color: var(--text-primary);
}

.podcast-title a:hover {
    color: var(--accent-primary);
}

.podcast-summary {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.podcast-key-points {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 1rem;
}

.podcast-key-points h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.podcast-key-points ul {
    margin: 0;
    padding-left: 1.25rem;
}

.podcast-key-points li {
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

.podcast-key-points li:last-child {
    margin-bottom: 0;
}

.podcast-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.topic-tag {
    padding: 0.25rem 0.75rem;
    background: rgba(79, 70, 229, 0.1);
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--accent-primary);
}

.podcast-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Podcast artwork and content wrapper */
.podcast-content-wrapper {
    display: flex;
    gap: 1.5rem;
}

.podcast-artwork {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-tertiary);
}

.podcast-artwork img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

@media (max-width: 600px) {
    .podcast-content-wrapper {
        flex-direction: column;
    }
    .podcast-artwork {
        width: 80px;
        height: 80px;
    }
}

/* Transcript Modal */
.transcript-modal-content {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.transcript-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.transcript-text {
    flex: 1;
    overflow-y: auto;
    line-height: 1.8;
    font-size: 1rem;
    color: var(--text-primary);
    padding-right: 0.5rem;
}

.transcript-text p {
    margin-bottom: 1rem;
    text-align: justify;
}

/* Modal close button */
.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--accent-danger);
}

/* Daily Snippet */
.daily-snippet {
    position: relative;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.snippet-favorite-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.snippet-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.snippet-header svg {
    color: var(--accent-primary);
    flex-shrink: 0;
}

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

.snippet-source {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-left: auto;
}

.snippet-quote {
    font-size: 1.05rem;
    font-style: italic;
    color: var(--text-primary);
    line-height: 1.7;
    margin: 0 0 1rem 0;
    padding-left: 1rem;
    border-left: 3px solid var(--accent-primary);
}

.snippet-relevance {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    background: var(--bg-tertiary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
}

.snippet-relevance strong {
    color: var(--accent-primary);
}

.snippet-footer {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.snippet-resource-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.snippet-resource-link:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.snippet-resource-link svg {
    flex-shrink: 0;
}

.snippet-link {
    font-size: 0.9rem;
    color: var(--accent-primary);
    font-weight: 500;
    transition: color 0.2s;
}

.snippet-link:hover {
    color: var(--accent-secondary);
}

/* Curated Books */
.books-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.book-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.book-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.book-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.book-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.book-author {
    font-size: 1rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin: 0;
}

.book-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0.5rem 0 0 0;
}

/* Extra Resources / Quick Links */
.extra-resources {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.extra-resources h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.resource-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.resource-chip:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.resource-chip svg {
    flex-shrink: 0;
}

.resource-chip.resource-video { border-color: rgba(239, 68, 68, 0.3); color: #f87171; }
.resource-chip.resource-video:hover { border-color: #f87171; background: rgba(239, 68, 68, 0.1); }
.resource-chip.resource-slides { border-color: rgba(59, 130, 246, 0.3); color: #60a5fa; }
.resource-chip.resource-slides:hover { border-color: #60a5fa; background: rgba(59, 130, 246, 0.1); }
.resource-chip.resource-notes { border-color: rgba(16, 185, 129, 0.3); color: #34d399; }
.resource-chip.resource-notes:hover { border-color: #34d399; background: rgba(16, 185, 129, 0.1); }
.resource-chip.resource-github { border-color: rgba(139, 148, 158, 0.3); color: #8b949e; }
.resource-chip.resource-github:hover { border-color: #8b949e; background: rgba(139, 148, 158, 0.1); }
.resource-chip.resource-blog { border-color: rgba(245, 158, 11, 0.3); color: #fbbf24; }
.resource-chip.resource-blog:hover { border-color: #fbbf24; background: rgba(245, 158, 11, 0.1); }

/* Chapters List */
.chapters-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}

.chapter-card {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    transition: all 0.2s;
}

.chapter-favorite-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

.chapter-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.chapter-header {
    margin-bottom: 0.75rem;
}

.chapter-number {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.chapter-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin: 0;
}

.chapter-summary {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0.5rem 0 0.75rem 0;
}

.chapter-topics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
}

.chapter-topics .topic-tag {
    font-size: 0.7rem;
    padding: 0.15rem 0.5rem;
}

.chapter-resources {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
}

.resource-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    color: var(--text-secondary);
    transition: all 0.2s;
}

.resource-link:hover {
    color: var(--accent-primary);
    background: var(--bg-primary);
}

.resource-link svg {
    flex-shrink: 0;
}

.resource-link.resource-video svg { color: #f87171; }
.resource-link.resource-notes svg { color: #34d399; }

.resource-link span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Image Modal */
.image-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
}

.image-modal-body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    overflow: auto;
}

.image-modal-body img {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}

/* Legacy transcript inline (kept for backwards compatibility) */
.podcast-transcript {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    max-height: 300px;
    overflow-y: auto;
}

.podcast-transcript h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.podcast-transcript p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

/* Report Content / Markdown */
.report-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 2rem;
}

.markdown-body {
    font-size: 1rem;
    line-height: 1.7;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.markdown-body h1 { font-size: 1.75rem; }
.markdown-body h2 { font-size: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.5rem; }
.markdown-body h3 { font-size: 1.25rem; }

.markdown-body p {
    margin-bottom: 1rem;
}

.markdown-body ul, .markdown-body ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.markdown-body li {
    margin-bottom: 0.5rem;
}

.markdown-body code {
    background: var(--bg-tertiary);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
}

.markdown-body pre {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin-bottom: 1rem;
}

.markdown-body pre code {
    background: none;
    padding: 0;
}

.markdown-body blockquote {
    border-left: 4px solid var(--accent-primary);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-secondary);
}

.markdown-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.markdown-body th, .markdown-body td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.markdown-body th {
    background: var(--bg-tertiary);
    font-weight: 600;
}

.markdown-body hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

.markdown-body a {
    color: var(--accent-primary);
}

.markdown-body strong {
    font-weight: 600;
}

/* Source Sections */
.source-section {
    margin-bottom: 2rem;
}

.source-type-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.source-icon {
    font-size: 1rem;
}

.source-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.source-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: all 0.2s;
}

.source-item:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.source-thumbnail {
    width: 80px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
}

.source-title {
    flex: 1;
    font-weight: 500;
}

.source-domain {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Articles Page */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.article-section {
    margin-bottom: 3rem;
}

.source-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    background: var(--bg-tertiary);
}

.source-badge.hn { background: #ff6600; color: white; }
.source-badge.reddit { background: #ff4500; color: white; }
.source-badge.devto { background: #0a0a0a; color: white; }
.source-badge.blog { background: var(--accent-primary); color: white; }
.source-badge.medium { background: #000; color: white; }
.source-badge.youtube { background: #ff0000; color: white; }
.source-badge.search { background: var(--accent-secondary); color: white; }
.source-badge.github { background: #238636; color: white; }

.article-list {
    display: grid;
    gap: 1rem;
}

.article-card {
    position: relative;
    padding: 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.article-card:hover {
    border-color: var(--accent-primary);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.meta-badge {
    padding: 0.2rem 0.5rem;
    background: var(--bg-tertiary);
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.meta-badge.date { color: var(--text-muted); font-weight: 500; }
.meta-badge.points { color: var(--accent-warning); }
.meta-badge.subreddit { color: #ff4500; }
.meta-badge.reactions { color: var(--accent-danger); }
.meta-badge.tag { color: var(--accent-primary); }
.meta-badge.channel { color: #ff0000; }

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.article-title a {
    color: var(--text-primary);
}

.article-title a:hover {
    color: var(--accent-primary);
}

.article-summary {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.article-footer {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.read-more {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--accent-primary);
}

.embed-btn {
    padding: 0.3rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.embed-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.article-thumbnail {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 120px;
    height: 68px;
    background-size: cover;
    background-position: center;
    border-radius: var(--radius-sm);
}

.video-embed {
    margin-top: 1rem;
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.video-embed iframe {
    display: block;
}

/* Browse Page */
.reports-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.report-card {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: all 0.2s;
}

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

.report-date {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.date-day {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
}

.date-month {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.date-year {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.report-stats {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.report-stat {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: 600;
}

.stat-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.report-actions {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.action-link {
    color: var(--accent-primary);
    font-weight: 500;
}

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

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

.video-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    aspect-ratio: 16/9;
}

.close-modal {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
}

#video-player-container {
    width: 100%;
    height: 100%;
}

#video-player-container iframe {
    width: 100%;
    height: 100%;
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state svg {
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

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

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
    border-top: 1px solid var(--border-color);
}

/* Favorites */
.favorite-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

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

.favorite-btn.favorited {
    background: var(--accent-warning);
    border-color: var(--accent-warning);
    color: var(--bg-primary);
}

.favorite-btn.favorited svg {
    fill: currentColor;
}

.favorite-actions {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

.remove-favorite-btn,
.edit-notes-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

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

.remove-favorite-btn svg {
    fill: var(--accent-warning);
}

.edit-notes-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.favorite-notes {
    margin: 0.75rem 0;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(245, 158, 11, 0.03));
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-warning);
    position: relative;
}

.favorite-notes::before {
    content: '"';
    position: absolute;
    top: 0.25rem;
    left: 0.5rem;
    font-size: 2rem;
    color: var(--accent-warning);
    opacity: 0.3;
    font-family: Georgia, serif;
    line-height: 1;
}

.favorite-notes strong {
    color: var(--text-primary);
}

.favorite-meta {
    margin-top: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.favorites-section {
    margin-bottom: 3rem;
}

.favorite-card {
    position: relative;
}

/* Modal - Professional Overlay */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: background 0.3s ease, backdrop-filter 0.3s ease, opacity 0.2s ease;
}

.modal.active {
    display: flex;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 1;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 16px 16px 0 0;
}

.modal-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-header h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: var(--accent-warning);
    border-radius: 2px;
}

.modal-header .close-modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    font-size: 1.25rem;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-header .close-modal:hover {
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    color: white;
}

.modal-body {
    padding: 1.5rem;
}

.modal-item-title {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.95rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--accent-primary);
}

.modal-body label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-body textarea {
    width: 100%;
    padding: 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.modal-body textarea::placeholder {
    color: var(--text-muted);
}

.modal-body textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: 0 0 16px 16px;
}

.btn {
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

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

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

.btn-secondary:hover {
    background: var(--bg-tertiary);
    border-color: var(--text-secondary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--accent-success);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Fade out animation */
@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* Favorites Toolbar */
.favorites-toolbar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent-primary);
}

.search-box svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
}

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

.clear-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-tertiary);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

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

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

.sort-select {
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
}

.sort-select:focus {
    border-color: var(--accent-primary);
}

/* Category Select */
.category-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-primary);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    margin-bottom: 1rem;
    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='%238b949e' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.category-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

/* Category Badge */
.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.category-badge .category-icon {
    font-size: 0.8rem;
}

.category-badge.category-general { background: rgba(107, 114, 128, 0.2); color: #9ca3af; }
.category-badge.category-market-insights { background: rgba(139, 92, 246, 0.2); color: #a78bfa; }
.category-badge.category-data-engineering { background: rgba(59, 130, 246, 0.2); color: #60a5fa; }
.category-badge.category-machine-learning { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.category-badge.category-software-engineering { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.category-badge.category-scalability { background: rgba(239, 68, 68, 0.2); color: #f87171; }
.category-badge.category-reliability { background: rgba(6, 182, 212, 0.2); color: #22d3ee; }
.category-badge.category-startups { background: rgba(236, 72, 153, 0.2); color: #f472b6; }
.category-badge.category-retail-media { background: rgba(249, 115, 22, 0.2); color: #fb923c; }
.category-badge.category-competitors { background: rgba(132, 204, 22, 0.2); color: #a3e635; }

/* Category Filter Buttons */
.category-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.category-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.category-filter-btn:hover {
    border-color: var(--text-secondary);
    color: var(--text-primary);
}

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

.category-filter-btn .category-icon {
    font-size: 0.9rem;
}

.category-filter-btn .count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.search-results-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.clear-filter-link {
    background: none;
    border: none;
    color: var(--accent-primary);
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: underline;
}

.clear-filter-link:hover {
    color: var(--accent-secondary);
}

/* Danger button */
.btn-danger {
    background: var(--accent-danger);
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Modal small */
.modal-small {
    max-width: 400px;
}

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

.view-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
}

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

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

.view-btn svg {
    width: 18px;
    height: 18px;
}

.view-btn .view-count {
    font-size: 0.75rem;
    padding: 0.15rem 0.4rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
}

/* Brief Sections */
.brief-sections {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.brief-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.brief-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.2s;
}

.brief-section-header:hover {
    background: var(--bg-secondary);
}

.brief-section-header svg {
    width: 20px;
    height: 20px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

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

.brief-section-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    background: var(--bg-primary);
    border-radius: 10px;
}

.brief-section-toggle {
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.brief-section.collapsed .brief-section-toggle {
    transform: rotate(-90deg);
}

.brief-section.collapsed .brief-items-grid {
    display: none;
}

/* Brief Items Grid */
.brief-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
}

/* Brief Item Card */
.brief-item {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.brief-item:hover {
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.brief-item .favorite-btn {
    position: relative;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

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

.brief-item-source {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

.brief-item-source.source-hackernews { color: #ff6600; }
.brief-item-source.source-reddit { color: #ff4500; }
.brief-item-source.source-devto { color: #3b49df; }
.brief-item-source.source-youtube { color: #ff0000; }
.brief-item-source.source-medium { color: #00ab6c; }
.brief-item-source.source-github { color: #238636; }
.brief-item-source.source-tech_blog { color: var(--accent-primary); }
.brief-item-source.source-distrifood { color: #e67e22; }
.brief-item-source.source-searxng { color: #9b59b6; }

.brief-item-title {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.4;
    margin: 0;
}

.brief-item-title a {
    color: var(--text-primary);
    text-decoration: none;
}

.brief-item-title a:hover {
    color: var(--accent-primary);
}

.brief-item-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-top: 0.4rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brief-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

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

/* Empty state for categories */
.brief-empty {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* View header with toggle */
.view-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.view-header-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.view-header-info h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.view-header-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ============================================================================
   MOBILE HEADER & BOTTOM NAVIGATION
   ============================================================================ */

/* Mobile header - hidden on desktop */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1rem;
}

.mobile-brand-text {
    font-size: 1rem;
    font-weight: 600;
}

.mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-date-select {
    padding: 0.4rem 0.6rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8rem;
    max-width: 110px;
}

.mobile-theme-toggle,
.mobile-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-theme-toggle:hover,
.mobile-logout-btn:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

/* Mobile bottom navigation - hidden on desktop */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 0.5rem 0.25rem;
    padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    flex: 1;
    padding: 0.5rem 0.25rem;
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item svg {
    width: 22px;
    height: 22px;
}

.mobile-nav-item.active {
    color: var(--accent-primary);
}

.mobile-nav-item.active svg {
    stroke-width: 2.5;
}

/* ============================================================================
   RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* Large desktop (1400px+) */
@media (min-width: 1400px) {
    .main-content {
        max-width: 1600px;
    }

    .brief-items-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .video-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Desktop (1024px - 1399px) */
@media (min-width: 1024px) and (max-width: 1399px) {
    .brief-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .video-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
    .main-content {
        padding: 1.5rem;
    }

    .page-header h1 {
        font-size: 2rem;
    }

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

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

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

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

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

    .nav-links {
        gap: 0.25rem;
    }

    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.85rem;
    }
}

/* Mobile Large (481px - 767px) */
@media (max-width: 767px) {
    /* Hide desktop navbar, show mobile elements */
    .navbar {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

    .mobile-nav {
        display: flex;
    }

    /* Adjust main content for bottom nav */
    .main-content {
        padding: 1rem;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }

    .footer {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }

    /* Page header */
    .page-header h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    /* Stats grid - 2 columns */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1rem;
    }

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

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    /* View toggle - full width */
    .view-header {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        width: 100%;
    }

    .view-btn {
        flex: 1;
        justify-content: center;
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    /* Brief sections */
    .brief-items-grid {
        grid-template-columns: 1fr;
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .brief-section-header {
        padding: 0.875rem 1rem;
    }

    .brief-section-header h3 {
        font-size: 0.9rem;
    }

    .brief-item {
        padding: 0.75rem;
    }

    .brief-item .favorite-btn {
        width: 32px;
        height: 32px;
    }

    .brief-item-title {
        font-size: 0.875rem;
    }

    .brief-item-summary {
        font-size: 0.75rem;
        -webkit-line-clamp: 2;
    }

    /* Daily snippet */
    .daily-snippet {
        padding: 1.25rem;
        margin-bottom: 1.5rem;
    }

    .snippet-header {
        flex-wrap: wrap;
    }

    .snippet-source {
        width: 100%;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    .snippet-quote {
        font-size: 0.95rem;
    }

    .snippet-relevance {
        font-size: 0.85rem;
    }

    /* Videos */
    .video-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .video-info {
        padding: 0.875rem;
    }

    .video-title {
        font-size: 0.9rem;
    }

    /* Podcasts */
    .podcast-card {
        padding: 1rem;
    }

    .podcast-title {
        font-size: 1.1rem;
    }

    .podcast-summary {
        font-size: 0.85rem;
    }

    /* Books */
    .book-section {
        padding: 1.25rem;
    }

    .book-title {
        font-size: 1.4rem;
    }

    .chapters-list {
        grid-template-columns: 1fr;
    }

    .chapter-card {
        padding: 1rem;
    }

    /* Articles */
    .article-card {
        padding: 1rem;
    }

    .article-title {
        font-size: 1rem;
    }

    .article-thumbnail {
        display: none;
    }

    /* Browse */
    .reports-grid {
        grid-template-columns: 1fr;
    }

    /* Modal */
    .modal-content {
        max-width: 95%;
        margin: 1rem;
        border-radius: var(--radius-md);
    }

    .modal-header {
        padding: 1rem;
        border-radius: var(--radius-md) var(--radius-md) 0 0;
    }

    .modal-body {
        padding: 1rem;
    }

    .modal-footer {
        padding: 1rem;
        border-radius: 0 0 var(--radius-md) var(--radius-md);
    }

    /* Favorites toolbar */
    .favorites-toolbar {
        flex-direction: column;
    }

    .search-box {
        width: 100%;
    }

    .toolbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .sort-select {
        flex: 1;
    }

    /* Filter bar */
    .filter-bar {
        padding: 0.75rem;
        gap: 0.35rem;
    }

    .filter-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    /* Toast positioning */
    .toast {
        bottom: calc(5rem + env(safe-area-inset-bottom));
        left: 1rem;
        right: 1rem;
        transform: translateY(100px);
        max-width: none;
    }

    .toast.show {
        transform: translateY(0);
    }

    /* Section headers */
    .section-header h2 {
        font-size: 1.2rem;
    }
}

/* Mobile Small (up to 480px) */
@media (max-width: 480px) {
    .main-content {
        padding: 0.75rem;
        padding-bottom: calc(5rem + env(safe-area-inset-bottom));
    }

    .page-header h1 {
        font-size: 1.3rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    /* Smaller stats grid */
    .stats-grid {
        gap: 0.5rem;
    }

    .stat-card {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .stat-icon {
        width: 32px;
        height: 32px;
    }

    .stat-icon svg {
        width: 18px;
        height: 18px;
    }

    .stat-value {
        font-size: 1.2rem;
    }

    .stat-link {
        display: none;
    }

    /* View toggle compact */
    .view-btn {
        padding: 0.6rem 0.5rem;
        font-size: 0.8rem;
        gap: 0.35rem;
    }

    .view-btn svg {
        width: 16px;
        height: 16px;
    }

    .view-count {
        font-size: 0.7rem;
        padding: 0.1rem 0.3rem;
    }

    /* Brief items more compact */
    .brief-items-grid {
        padding: 0.5rem;
        gap: 0.4rem;
    }

    .brief-item {
        padding: 0.625rem;
        gap: 0.5rem;
    }

    .brief-item .favorite-btn {
        width: 28px;
        height: 28px;
    }

    .brief-item-source {
        font-size: 0.65rem;
    }

    .brief-item-title {
        font-size: 0.825rem;
    }

    .brief-item-summary {
        -webkit-line-clamp: 2;
        font-size: 0.7rem;
    }

    .brief-item-meta {
        font-size: 0.65rem;
    }

    /* Section headers compact */
    .brief-section-header {
        padding: 0.75rem;
    }

    .brief-section-header svg {
        width: 18px;
        height: 18px;
    }

    .brief-section-header h3 {
        font-size: 0.85rem;
    }

    .brief-section-count {
        font-size: 0.7rem;
        padding: 0.15rem 0.5rem;
    }

    /* Daily snippet compact */
    .daily-snippet {
        padding: 1rem;
    }

    .snippet-header h3 {
        font-size: 1rem;
    }

    .snippet-quote {
        font-size: 0.9rem;
        padding-left: 0.75rem;
    }

    .snippet-relevance {
        font-size: 0.8rem;
        padding: 0.625rem 0.75rem;
    }

    .snippet-footer {
        gap: 0.75rem;
    }

    .snippet-resource-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.625rem;
    }

    /* Podcast adjustments */
    .podcast-content-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .podcast-artwork {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        max-width: 120px;
    }

    .podcast-key-points ul {
        padding-left: 1rem;
    }

    /* Book section compact */
    .book-section {
        padding: 1rem;
    }

    .book-title {
        font-size: 1.2rem;
    }

    .book-author {
        font-size: 0.9rem;
    }

    .book-description {
        font-size: 0.85rem;
    }

    .extra-resources {
        padding: 0.75rem;
    }

    .resource-chip {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    /* Chapter cards compact */
    .chapter-card {
        padding: 0.875rem;
    }

    .chapter-title {
        font-size: 0.9rem;
    }

    .chapter-summary {
        font-size: 0.8rem;
    }

    /* Report cards */
    .report-card {
        padding: 1rem;
    }

    .date-day {
        font-size: 2rem;
    }

    .date-month {
        font-size: 1rem;
    }

    /* Category filter */
    .category-filter-bar {
        padding: 0.75rem;
        gap: 0.35rem;
    }

    .category-filter-btn {
        font-size: 0.75rem;
        padding: 0.3rem 0.5rem;
    }

    /* Modal */
    .modal {
        padding: 0.5rem;
    }

    .modal-content {
        max-width: 100%;
        margin: 0;
        max-height: 95vh;
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }

    /* Mobile nav adjustments */
    .mobile-nav-item {
        font-size: 0.6rem;
    }

    .mobile-nav-item svg {
        width: 20px;
        height: 20px;
    }
}

/* Landscape phone adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-nav {
        padding: 0.35rem 0.5rem;
    }

    .mobile-nav-item {
        padding: 0.35rem 0.5rem;
    }

    .mobile-nav-item svg {
        width: 18px;
        height: 18px;
    }

    .mobile-nav-item span {
        display: none;
    }

    .main-content {
        padding-bottom: 3.5rem;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .favorite-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .nav-link,
    .filter-btn,
    .view-btn {
        min-height: 44px;
    }

    .brief-item {
        min-height: 60px;
    }

    /* Remove hover transforms on touch devices */
    .video-card:hover,
    .article-card:hover,
    .chapter-card:hover,
    .report-card:hover,
    .brief-item:hover {
        transform: none;
    }

    /* Active state instead */
    .video-card:active,
    .article-card:active,
    .chapter-card:active,
    .report-card:active,
    .brief-item:active {
        opacity: 0.8;
    }
}

/* High DPI / Retina display optimizations */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo {
        font-weight: 700;
    }
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Print styles */
@media print {
    .navbar,
    .mobile-header,
    .mobile-nav,
    .footer,
    .favorite-btn,
    .view-toggle,
    .theme-toggle {
        display: none !important;
    }

    .main-content {
        padding: 0;
        max-width: none;
    }

    body {
        background: white;
        color: black;
    }

    a {
        color: black;
        text-decoration: underline;
    }
}
