/* Dmitri's Daily Digest - Global Styles */

:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --accent: #f6ad55;
    --success: #48bb78;
    --warning: #ecc94b;
    --danger: #fc8181;

    --text: #1a202c;
    --text-light: #718096;
    --bg: #ffffff;
    --bg-secondary: #f7fafc;
    --border: #e2e8f0;

    --shadow: rgba(0,0,0,0.1);
}

/* Theme override via JS: html[data-theme="dark"] (or auto resolved) */
html[data-theme-resolved="dark"] {
    --text: #e5e7eb;
    --text-light: #9ca3af;
    --bg: #0b0f19;
    --bg-secondary: #111827;
    --border: #1f2937;
    --shadow: rgba(0,0,0,0.35);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
}

/* Small UI bits */
.theme-toggle {
    position: absolute;
    top: 14px;
    right: 14px;
    border: 1px solid rgba(255,255,255,0.35);
    background: rgba(0,0,0,0.15);
    color: white;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    backdrop-filter: blur(8px);
}

html[data-theme-resolved="dark"] .theme-toggle {
    border-color: rgba(255,255,255,0.25);
}

.collapsible-header {
    cursor: pointer;
}

.collapsible-toggle {
    margin-left: auto;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-light);
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
}

html[data-theme-resolved="dark"] .collapsible-toggle {
    background: #0f172a;
}

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

/* Header */
.header {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    color: white;
    margin-bottom: 30px;
}

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.header .date {
    font-size: 1.1rem;
    opacity: 0.9;
}

.header .subtitle {
    font-size: 0.95rem;
    opacity: 0.8;
    margin-top: 10px;
}

/* Navigation */
.nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s;
}

.nav a:hover, .nav a.active {
    background: var(--primary);
    color: white;
}

/* Sections */
.section {
    background: var(--bg);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 1px 3px var(--shadow);
    border: 1px solid var(--border);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--bg-secondary);
}

.section-icon {
    font-size: 1.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.section-badge {
    margin-left: auto;
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-light);
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
}

.card:last-child {
    margin-bottom: 0;
}

.card-title {
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.card-content {
    color: var(--text);
}

.card-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
}

.card-link:hover {
    text-decoration: underline;
}

/* Tags */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 5px;
    margin-bottom: 5px;
}

.tag-trend { background: #fed7e2; color: #c53030; }
.tag-reddit { background: #feebc8; color: #c05621; }
.tag-twitter { background: #bee3f8; color: #2b6cb0; }
.tag-youtube { background: #fecaca; color: #c53030; }
.tag-business { background: #c6f6d5; color: #276749; }
.tag-ai { background: #e9d8fd; color: #6b46c1; }

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, var(--primary) 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-card.green { background: linear-gradient(135deg, #48bb78 0%, #38a169 100%); }
.stat-card.orange { background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%); }
.stat-card.red { background: linear-gradient(135deg, #fc8181 0%, #e53e3e 100%); }

.stat-number {
    font-size: 2rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* Trend bars */
.trend-bar {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.trend-label {
    width: 140px;
    font-size: 0.9rem;
    font-weight: 500;
}

.trend-track {
    flex: 1;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    margin: 0 10px;
}

.trend-fill {
    height: 100%;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 10px;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

.trend-fill.high { background: linear-gradient(90deg, #48bb78, #38a169); }
.trend-fill.medium { background: linear-gradient(90deg, #ecc94b, #d69e2e); }
.trend-fill.low { background: linear-gradient(90deg, #a0aec0, #718096); }

/* Quote */
.quote-box {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-left: 4px solid var(--primary);
    padding: 20px 25px;
    margin: 20px 0;
    border-radius: 0 10px 10px 0;
}

.quote-text {
    font-style: italic;
    font-size: 1.05rem;
    margin-bottom: 10px;
}

.quote-author {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Lists */
.digest-list {
    list-style: none;
}

.digest-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.digest-list li:last-child {
    border-bottom: none;
}

.digest-list .icon {
    font-size: 1.2rem;
    flex-shrink: 0;
}

.digest-list .content {
    flex: 1;
}

.digest-list .title {
    font-weight: 600;
    margin-bottom: 4px;
}

.digest-list .desc {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Archive list (index page) */
.archive-list {
    list-style: none;
}

.archive-item {
    display: flex;
    align-items: center;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 10px;
    margin-bottom: 10px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.archive-item:hover {
    background: var(--primary);
    color: white;
    transform: translateX(5px);
}

.archive-date {
    font-size: 1.1rem;
    font-weight: 700;
    width: 120px;
}

.archive-summary {
    flex: 1;
    font-size: 0.95rem;
}

.archive-arrow {
    font-size: 1.2rem;
    opacity: 0.5;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px;
    color: var(--text-light);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
    margin-top: 30px;
}

/* Responsive */
@media (max-width: 600px) {
    .container { padding: 15px; }
    .header h1 { font-size: 1.5rem; }
    .section { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .nav { flex-wrap: wrap; gap: 10px; }
}
