:root {
    --bg-dark: #0a0a0f;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent-blue: #3b82f6;
    --accent-purple: #8b5cf6;
    --severity-critical: #ef4444;
    --severity-high: #f97316;
    --severity-medium: #eab308;
    --severity-low: #3b82f6;
    --glass-bg: rgba(20, 20, 28, 0.6);
    --glass-border: rgba(255, 255, 255, 0.08);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, .stat-value {
    font-family: 'Outfit', sans-serif;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.glow {
    position: absolute;
    filter: blur(120px);
    opacity: 0.4;
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(59,130,246,0.3) 0%, rgba(10,10,15,0) 70%);
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, rgba(239,68,68,0.1) 70%);
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(5%, 5%) scale(1.1); }
}

/* Layout */
.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Header */
header {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1.5rem;
}

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

.app-logo {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 0 12px rgba(139, 92, 246, 0.4));
}

.pulse-icon {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(90deg, #fff, #e2e8f0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(139, 92, 246, 0.3));
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e;
}

.header-stats {
    display: flex;
    gap: 2rem;
}

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

.stat-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-box.critical .stat-value { color: var(--severity-critical); text-shadow: 0 0 20px rgba(239,68,68,0.4); }
.stat-box.high .stat-value { color: var(--severity-high); }

/* Controls */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.search-box input {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.8rem 1rem 0.8rem 2.8rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(59,130,246,0.2);
}

.filter-group {
    display: flex;
    gap: 0.5rem;
}

.filter-btn {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    transition: all 0.2s ease;
}

.filter-btn:hover {
    background: rgba(255,255,255,0.1);
}

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

.filter-btn.critical-btn.active { background: var(--severity-critical); border-color: var(--severity-critical); }
.filter-btn.high-btn.active { background: var(--severity-high); border-color: var(--severity-high); }

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

/* CVE Card */
.cve-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
    cursor: pointer;
}

.cve-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.15);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 0.8rem;
}

.cve-id {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
}

.severity-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cve-card.critical .severity-badge { background: rgba(239,68,68,0.2); color: #fca5a5; border: 1px solid rgba(239,68,68,0.4); }
.cve-card.high .severity-badge { background: rgba(249,115,22,0.2); color: #fdba74; border: 1px solid rgba(249,115,22,0.4); }
.cve-card.medium .severity-badge { background: rgba(234,179,8,0.2); color: #fde047; border: 1px solid rgba(234,179,8,0.4); }
.cve-card.low .severity-badge { background: rgba(59,130,246,0.2); color: #93c5fd; border: 1px solid rgba(59,130,246,0.4); }
.cve-card.unknown .severity-badge { background: rgba(148,163,184,0.2); color: #cbd5e1; border: 1px solid rgba(148,163,184,0.4); }

.card-body p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #64748b;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.score {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
}

/* Threat Badges */
.badges-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.threat-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
}

.threat-badge.flash {
    background: rgba(220, 38, 38, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(220, 38, 38, 0.6);
    box-shadow: 0 0 10px rgba(220, 38, 38, 0.4);
    animation: flash-red 2s infinite;
}

.threat-badge.exploit-db {
    background: rgba(139, 92, 246, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(139, 92, 246, 0.4);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.1);
}

.mitre-badge {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.trending-badge {
    background: rgba(249, 115, 22, 0.15);
    color: #fdba74;
    border: 1px solid rgba(249, 115, 22, 0.3);
    animation: pulse 2s infinite;
}

.nuclei-badge {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
    transition: all 0.2s ease;
}
.nuclei-badge:hover {
    background: rgba(16, 185, 129, 0.3);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.cve-card.actively-exploited {
    border-color: rgba(220, 38, 38, 0.5);
}

.cve-card.actively-exploited:hover {
    box-shadow: 0 15px 35px rgba(220, 38, 38, 0.3);
}

.source-tag {
    font-weight: 600;
    opacity: 0.8;
}

@keyframes flash-red {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; border-color: rgba(220, 38, 38, 0.9); }
}

/* Loading State */
.loading-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    gap: 1.5rem;
    color: var(--text-muted);
}
/* .spinner and @keyframes spin are defined once below */

@media (max-width: 768px) {
    .header-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.modal-content {
    width: 90%;
    max-width: 650px;
    background: var(--bg-dark);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 1rem;
}

.modal-header h2 {
    font-size: 1.4rem;
    color: var(--text-main);
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--severity-critical);
}

.remediation-step {
    background: rgba(255, 255, 255, 0.03);
    border-left: 4px solid var(--accent-blue);
    padding: 1.2rem;
    margin-bottom: 1rem;
    border-radius: 6px;
    font-size: 0.95rem;
    line-height: 1.6;
}

.remediation-step strong {
    color: var(--text-main);
    display: block;
    margin-bottom: 0.3rem;
    font-size: 1.05rem;
}

.remediation-critical {
    border-left-color: var(--severity-critical);
    background: rgba(239, 68, 68, 0.05);
}

.remediation-high {
    border-left-color: var(--severity-high);
}

.action-btn {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: #c4b5fd;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(139, 92, 246, 0.2);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* --- Stats Dashboard Overview --- */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.8s ease-out;
}

.stat-card {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.stat-card:hover {
    transform: translateY(-5px);
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: var(--accent-blue);
    text-shadow: 0 0 20px rgba(56, 189, 248, 0.3);
}

.stat-card.critical .stat-value { color: #f87171; text-shadow: 0 0 20px rgba(248, 113, 113, 0.3); }
.stat-card.trending .stat-value { color: #fb923c; text-shadow: 0 0 20px rgba(251, 146, 60, 0.3); }
.stat-card.exploited .stat-value { color: #f472b6; text-shadow: 0 0 20px rgba(244, 114, 182, 0.3); }

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.3rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.6rem 1.2rem;
    border-radius: 9px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    color: var(--text-main);
}

.nav-btn.active {
    background: var(--accent-blue);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .feed-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .status-bar {
        margin-top: 1rem;
        justify-content: center !important;
    }
    
    #about-section > div {
        grid-template-columns: 1fr !important;
    }
}

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

.source-card {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.source-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.15);
}

.source-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.source-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.source-type-tag {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid;
}

.source-name {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #e2e8f0;
    margin: 0;
}

.source-desc {
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.55;
    flex-grow: 1;
    margin: 0;
}

.source-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.source-tags span {
    font-size: 0.65rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.05);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.source-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-family: 'Courier New', monospace;
    text-decoration: none;
    border: 1px solid;
    border-radius: 6px;
    padding: 0.45rem 0.75rem;
    transition: opacity 0.2s;
    margin-top: 0.25rem;
}

.source-link:hover {
    opacity: 0.75;
}

@media (max-width: 768px) {
    .sources-grid {
        grid-template-columns: 1fr;
    }
}
