@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

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

:root {
    /* Enterprise Blue-Orange Palette */
    --primary-blue: #0F4C81;
    --primary-dark: #0A2540;
    --accent-orange: #FF6B35;
    --accent-coral: #FF8C61;
    --sky-blue: #0EA5E9;
    --deep-blue: #1E40AF;

    /* Semantic Colors */
    --color-tip: #06B6D4;
    /* Cyan - Information */
    --color-check: #FF6B35;
    /* Orange - Warning */
    --color-pattern: #0EA5E9;
    /* Sky Blue - Best Practice */

    /* Severity Colors */
    --color-critical: #DC2626;
    --color-high: #FB923C;
    --color-medium: #FACC15;
    --color-low: #22C55E;

    /* Background */
    --bg-primary: #0A0E1A;
    --bg-secondary: #111827;
    --bg-card: rgba(15, 76, 129, 0.08);
    --bg-card-hover: rgba(15, 76, 129, 0.12);

    /* Glass Effect */
    --glass-bg: rgba(15, 76, 129, 0.1);
    --glass-border: rgba(15, 76, 129, 0.2);
    --glass-shadow: rgba(0, 0, 0, 0.3);

    /* Text */
    --text-primary: #F8FAFC;
    --text-secondary: #CBD5E1;
    --text-muted: #64748B;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-glow: 0 0 40px rgba(15, 76, 129, 0.3);
    --shadow-glow-orange: 0 0 30px rgba(255, 107, 53, 0.2);
}

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;
    overflow-x: hidden;
    position: relative;
}

/* Animated Background - Blue Theme */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(15, 76, 129, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(14, 165, 233, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 40% 20%, rgba(10, 37, 64, 0.2) 0%, transparent 50%);
    animation: gradientShift 20s ease infinite;
    z-index: -1;
}

@keyframes gradientShift {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(5%, -5%) rotate(120deg);
    }

    66% {
        transform: translate(-5%, 5%) rotate(240deg);
    }
}

/* Dot Pattern Overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(15, 76, 129, 0.08) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: -1;
    opacity: 0.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    position: relative;
    z-index: 1;
}

/* Header with Navigation */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(15, 76, 129, 0.2);
}

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

.logo-icon {
    width: 40px;
    height: 40px;
    color: var(--sky-blue);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-blue), var(--sky-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-blue), var(--sky-blue));
    transition: width 0.3s ease;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-header h2 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--sky-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

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

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

.stat-card.critical .stat-value {
    color: var(--color-critical);
}

.stat-card.high .stat-value {
    color: var(--color-high);
}

.stat-card.medium .stat-value {
    color: var(--color-medium);
}

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

.chart-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.chart-card h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.chart-card canvas {
    max-height: 300px;
}

/* Filter Section */
.filter-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    border: 1px solid rgba(15, 76, 129, 0.3);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    background: var(--bg-card-hover);
    border-color: rgba(15, 76, 129, 0.5);
    color: var(--text-primary);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-blue), var(--sky-blue));
    border-color: var(--primary-blue);
    color: white;
}

.filter-btn.critical {
    border-color: rgba(220, 38, 38, 0.3);
}

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

.filter-btn.high {
    border-color: rgba(251, 146, 60, 0.3);
}

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

.filter-btn.medium {
    border-color: rgba(250, 204, 21, 0.3);
}

.filter-btn.medium.active {
    background: var(--color-medium);
    color: #000;
}

.filter-btn.low {
    border-color: rgba(34, 197, 94, 0.3);
}

.filter-btn.low.active {
    background: var(--color-low);
}

/* Threat Feed Table */
.threat-feed-container {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    overflow-x: auto;
    margin-bottom: 3rem;
}

.threat-table {
    width: 100%;
    border-collapse: collapse;
}

.threat-table thead th {
    text-align: left;
    padding: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid rgba(15, 76, 129, 0.3);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.threat-table tbody tr {
    border-bottom: 1px solid rgba(15, 76, 129, 0.1);
    transition: all 0.3s ease;
}

.threat-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.threat-table tbody td {
    padding: 1.25rem 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.threat-table tbody td.description {
    max-width: 400px;
    line-height: 1.6;
}

.threat-table tbody td.date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.cve-link {
    color: var(--sky-blue);
    text-decoration: none;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.cve-link:hover {
    color: var(--accent-orange);
    text-decoration: underline;
}

.cvss-score {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    background: rgba(15, 76, 129, 0.2);
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.severity-badge {
    display: inline-block;
    padding: 0.4rem 0.9rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.severity-badge.critical {
    background: var(--color-critical);
    color: white;
}

.severity-badge.high {
    background: var(--color-high);
    color: white;
}

.severity-badge.medium {
    background: var(--color-medium);
    color: #000;
}

.severity-badge.low {
    background: var(--color-low);
    color: white;
}

.severity-badge.unknown {
    background: var(--text-muted);
    color: white;
}

/* Existing styles continue below... */
/* (All the previous styles from the original file) */

/* Footer */
.footer {
    text-align: center;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
    border-top: 1px solid rgba(15, 76, 129, 0.2);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 2rem 1rem;
    }

    .header {
        flex-direction: column;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .nav-links {
        gap: 1rem;
        flex-wrap: wrap;
    }

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

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

    .charts-grid {
        grid-template-columns: 1fr;
    }

    .threat-feed-container {
        padding: 1rem;
    }

    .threat-table {
        font-size: 0.85rem;
    }

    .threat-table tbody td {
        padding: 1rem 0.5rem;
    }

    .threat-table tbody td.description {
        max-width: 250px;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-blue), var(--sky-blue));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--sky-blue), var(--accent-orange));
}

/* Selection Styling */
::selection {
    background: rgba(15, 76, 129, 0.3);
    color: var(--text-primary);
}

/* Digest Section Styles */
.latest-digest {
    margin-bottom: 3rem;
    animation: fadeIn 0.5s ease-out;
}

.digest-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
}

.digest-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(15, 76, 129, 0.2);
}

.digest-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.digest-date {
    font-size: 0.9rem;
    color: var(--sky-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.digest-badge {
    background: rgba(15, 76, 129, 0.3);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    border: 1px solid rgba(15, 76, 129, 0.3);
}

.digest-header h3 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.3;
    background: linear-gradient(135deg, white, var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.digest-items {
    display: grid;
    gap: 1.5rem;
}

.digest-item {
    background: rgba(10, 14, 26, 0.4);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.digest-item:hover {
    transform: translateX(4px);
    background: rgba(15, 76, 129, 0.15);
}

.digest-item.tip {
    border-left-color: var(--color-tip);
}

.digest-item.check {
    border-left-color: var(--color-check);
}

.digest-item.pattern {
    border-left-color: var(--color-pattern);
}

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

.item-type {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    letter-spacing: 0.5px;
    min-width: fit-content;
}

.digest-item.tip .item-type {
    background: rgba(6, 182, 212, 0.15);
    color: var(--color-tip);
}

.digest-item.check .item-type {
    background: rgba(255, 107, 53, 0.15);
    color: var(--color-check);
}

.digest-item.pattern .item-type {
    background: rgba(14, 165, 233, 0.15);
    color: var(--color-pattern);
}

.item-header h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.4;
    margin-top: -2px;
}

.item-content {
    padding-left: calc(0.7rem + 1rem + 0.6rem);
    /* Align with title */
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

.item-why,
.item-fix {
    margin-bottom: 0.75rem;
}

.item-why strong,
.item-fix strong {
    color: var(--sky-blue);
    font-weight: 600;
    margin-right: 0.3rem;
}

.item-fix {
    margin-bottom: 0;
}

/* Archive / Past Digests */
.past-digests {
    margin-bottom: 4rem;
}

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

.digest-link {
    text-decoration: none;
    display: block;
}

.digest-list-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 2rem;
    transition: all 0.2s ease;
}

.digest-list-item:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    border-color: rgba(15, 76, 129, 0.4);
}

.list-date {
    color: var(--sky-blue);
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    min-width: 100px;
}

.list-headline {
    color: var(--text-primary);
    font-weight: 500;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    background: var(--glass-bg);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    margin: 3rem 0;
}

.empty-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 2rem;
}

.empty-state h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 0.5rem;
}

.empty-hint {
    color: var(--text-muted) !important;
    font-size: 0.9rem;
    margin-top: 1rem !important;
}

@media (max-width: 768px) {
    .digest-card {
        padding: 1.5rem;
    }

    .digest-header h3 {
        font-size: 1.5rem;
    }

    .item-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .item-content {
        padding-left: 0;
        margin-top: 0.75rem;
    }

    .digest-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}