:root {
    --bg-base: #09090f;
    --bg-surface: #12131e;
    --bg-surface-hover: #1a1c2e;
    --text-primary: #f0f2f5;
    --text-secondary: #9ba1ad;
    --accent-brand: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.2);
    --border-color: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

.dashboard-container { display: flex; height: 100vh; }

/* SIDEBAR */
.sidebar {
    width: 280px;
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    overflow-y: auto;
}

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

.logo {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    border-radius: 8px;
    box-shadow: 0 0 15px var(--accent-glow);
    flex-shrink: 0;
}

.brand h1 { font-size: 1.1rem; font-weight: 700; }

.filter-section h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.filter-option {
    display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 0.75rem; cursor: pointer;
    font-size: 0.9rem; transition: color 0.2s;
}
.filter-option:hover { color: white; }
.filter-option input { display: none; }

.custom-checkbox {
    width: 16px; height: 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px; display: inline-block;
    position: relative; transition: all 0.2s; flex-shrink: 0;
}
.filter-option input:checked + .custom-checkbox {
    background-color: var(--accent-brand);
    border-color: var(--accent-brand);
}
.filter-option input:checked + .custom-checkbox::after {
    content: '';
    position: absolute; left: 4px; top: 1px;
    width: 4px; height: 8px;
    border: solid white; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.primary-toggle { color: var(--accent-brand); font-weight: 600; }
.primary-toggle .custom-checkbox { border-color: var(--accent-brand); }

.mention-badge {
    margin-left: auto;
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-brand);
    padding: 2px 8px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 700;
}

.stat-badge {
    margin-left: auto;
    background: rgba(255,255,255,0.05);
    color: var(--text-secondary);
    padding: 2px 8px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 600;
}

/* MAIN CONTENT */
.main-content { flex: 1; overflow-y: auto; padding: 2rem 4rem; }

.top-nav {
    margin-bottom: 2rem; display: flex;
    justify-content: space-between; align-items: flex-end;
}

.header-info h2 { font-size: 2rem; font-weight: 700; }
.stats { font-size: 0.9rem; color: var(--text-secondary); }

.search-input:focus { border-color: var(--accent-brand) !important; }

.feed-container { display: flex; flex-direction: column; gap: 1.5rem; }

/* ARTICLE CARD */
.article-card {
    background: rgba(18, 19, 30, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 12px; padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s;
    cursor: default; display: flex; flex-direction: row;
    gap: 1.5rem; position: relative;
}
.article-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
    border-color: rgba(59, 130, 246, 0.2);
}
.article-card.wwf-mention {
    border-left: 4px solid var(--accent-brand);
    background: linear-gradient(to right, rgba(59,130,246,0.05), transparent 30%);
}
.article-card.fading-out {
    opacity: 0; transform: scale(0.95);
    margin-bottom: -100px; pointer-events: none;
    transition: all 0.2s;
}

.article-image {
    width: 120px; height: 120px;
    object-fit: cover; border-radius: 8px; flex-shrink: 0;
}

.card-content-wrapper { display: flex; flex-direction: column; width: 100%; }

.card-meta {
    font-size: 0.8rem; color: var(--text-secondary);
    display: flex; justify-content: space-between;
    margin-bottom: 0.5rem;
}

.publisher {
    font-weight: 600; color: #fff;
    background: rgba(255,255,255,0.08);
    padding: 2px 8px; border-radius: 12px;
}

.card-title {
    font-size: 1.2rem; font-weight: 600;
    line-height: 1.4; color: #fff;
    text-decoration: none; display: block;
    margin-bottom: 0.5rem;
}
.card-title:hover { text-decoration: underline; }

.card-preamble { color: var(--text-secondary); font-size: 0.9rem; }

.tags { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; align-items: center; }

.tag {
    font-size: 0.75rem; font-weight: 600;
    padding: 4px 10px; border-radius: 20px;
    display: inline-flex; align-items: center; gap: 4px;
}

.tag.wwf-mention-tag {
    background: var(--accent-brand); color: #fff;
    animation: pulse 2s infinite;
}

.remove-tag-btn {
    display: none; background: none; border: none;
    color: inherit; font-size: 10px; cursor: pointer;
    padding: 0 2px; line-height: 1;
}
.tag:hover .remove-tag-btn { display: inline-block; }

.add-wwf-btn {
    background: rgba(59,130,246,0.08);
    border: 1px dashed rgba(59,130,246,0.3);
    color: var(--text-secondary); font-size: 12px;
    padding: 3px 10px; border-radius: 20px;
    cursor: pointer; transition: all 0.2s;
}
.add-wwf-btn:hover {
    background: rgba(59,130,246,0.2);
    border-color: var(--accent-brand);
    color: white;
}

.remove-btn {
    position: absolute; top: 1rem; right: 1rem;
    background: rgba(255,255,255,0.08); border: none;
    color: var(--text-secondary); width: 28px; height: 28px;
    border-radius: 50%; display: flex; align-items: center;
    justify-content: center; cursor: pointer;
    opacity: 0; transition: all 0.2s; font-size: 13px; z-index: 10;
}
.article-card:hover .remove-btn { opacity: 1; }
.remove-btn:hover { background: rgba(239,68,68,0.2); color: #ef4444; }

.article-card.active-picker { z-index: 999; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(59,130,246,0.4); }
    70% { box-shadow: 0 0 0 6px rgba(59,130,246,0); }
    100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}

.spinner {
    width: 40px; height: 40px;
    border: 4px solid rgba(255,255,255,0.1);
    border-left-color: var(--accent-brand);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { 100% { transform: rotate(360deg); } }

/* MOBILE */
.mobile-header {
    display: none;
    background-color: var(--bg-surface);
    padding: 1rem 1.5rem;
    align-items: center; justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    position: sticky; top: 0; z-index: 2000;
}
.mobile-menu-btn {
    background: none; border: none; cursor: pointer;
    display: flex; flex-direction: column; gap: 5px;
}
.mobile-menu-btn .bar { width: 25px; height: 2px; background: white; border-radius: 2px; }

@media (max-width: 1024px) {
    .dashboard-container { flex-direction: column; height: auto; }
    .mobile-header { display: flex; }
    .sidebar {
        position: fixed; left: -280px; top: 0; bottom: 0;
        z-index: 3000; transition: left 0.3s ease;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    .sidebar.open { left: 0; }
    .sidebar .brand { display: none; }
    .main-content { padding: 1.5rem 1rem; }
    .top-nav { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .header-info h2 { font-size: 1.5rem; }
}
@media (max-width: 768px) {
    .article-card { flex-direction: column; padding: 1rem; }
    .article-image { width: 100%; height: 180px; }
    .card-title { font-size: 1.05rem; }
}
