/* ============================================
   CSURFACE Threat Sensor Emerging Threats Platform - v2.3.1
   Modern Design with Gradient Titles & 3D Grid
   style.css
   ============================================ */

@import url('tokens.css');

:root {
    /* ── Light design system (csurface / ml-discovery) ──
       Legacy var names kept, remapped onto tokens.css light palette
       so the whole app flips dark→light without touching every rule. */

    /* Brand — cyan accent (bright for fills, deep for text) */
    --primary-cyan: var(--accent);          /* #36d0ea cyan-deep */
    --primary-blue: #0ea5e9;
    --cyan-bright: var(--brand-cyan);       /* #36d0ea */

    /* Backgrounds → light */
    --dark-navy: var(--bg-elev);            /* page bg #fafbfc */
    --darker-navy: var(--bg-elev);
    --card-bg: var(--bg-card);              /* #ffffff */
    --card-border: var(--border);

    /* Severity — vivid (csurface model: red/orange/amber) */
    --critical-red: #ef4444;
    --high-orange: #f97316;
    --medium-yellow: #f59e0b;

    /* Accents — cyan family + orange secondary + navy emphasis */
    --success-green: #22c55e;
    --purple-accent: #0ea5e9;
    --accent-orange: #fb923c;               /* gradient charts / grade accent */
    --navy: #0a1f44;                         /* emphasis panels */

    /* Text → dark on light, readable contrast */
    --text-primary: var(--text);            /* #0f172a */
    --text-secondary: #334155;              /* slate-700 — strong */
    --text-muted: #64748b;                  /* slate-500 — readable, not faint */

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
}

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

body {
    font-family: var(--font-body, 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
    background: var(--bg-elev);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ============================================
   ANIMATED GRID BACKGROUND
   ============================================ */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-elev);
    z-index: -1;
    overflow: hidden;
}

/* 3D animated grid removed for the light design system */
.grid-background::before,
.grid-background::after { content: none; display: none; }

@keyframes gridMove {
    0% {
        transform: perspective(500px) rotateX(60deg) translateY(0);
    }
    100% {
        transform: perspective(500px) rotateX(60deg) translateY(50px);
    }
}

/* Particles/Stars Effect */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: var(--primary-cyan);
    border-radius: 50%;
    opacity: 0.4;
    animation: float 9s infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0.4;
    }
    50% {
        transform: translateY(-20px) translateX(10px);
        opacity: 0.8;
    }
}

/* ============================================
   HEADER / NAVIGATION
   ============================================ */
.header {
    position: relative;
    /* High stacking context so the nav dropdowns, which hang below the header box,
       always paint above page chrome such as the breadcrumb bar. */
    z-index: 1000;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: var(--spacing-md) 0;
    position: sticky;
    top: 0;
}

.header-container,
.header .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header .nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.header .nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.header .nav-link:hover {
    color: var(--primary-cyan);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.logo-text {
    background: linear-gradient(90deg, #FFFFFF 0%, var(--primary-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: var(--spacing-lg);
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover {
    color: var(--primary-cyan);
}

/* ── Nav Dropdown ── */
.nav-dropdown {
    position: relative;
}
.nav-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    cursor: pointer;
}
.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 8px;
    padding: 0.4rem 0;
    min-width: 180px;
    list-style: none;
    z-index: 200;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    padding-top: 0.6rem;
}
/* Invisible bridge between toggle and menu to keep hover */
.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}
.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}
.nav-dropdown-menu li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: #94A3B8;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.15s;
    white-space: nowrap;
}
.nav-dropdown-menu li a:hover {
    color: #00d9ff;
    background: rgba(0, 217, 255, 0.08);
}
.nav-dropdown-menu li a i {
    width: 16px;
    text-align: center;
    font-size: 0.8rem;
}

.nav-login-btn {
    background: rgba(0, 217, 255, 0.12) !important;
    border: 1px solid rgba(0, 217, 255, 0.3);
    padding: 0.35rem 0.8rem !important;
    border-radius: 6px;
    color: #00d9ff !important;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}
.nav-login-btn:hover {
    background: rgba(0, 217, 255, 0.25) !important;
    border-color: rgba(0, 217, 255, 0.5);
}

.nav-badge {
    display: inline-block;
    background: #EF4444;
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 10px;
    margin-left: 4px;
    min-width: 16px;
    text-align: center;
}

/* ============================================
   GLOBAL SEARCH
   ============================================ */
.nav-search {
    position: relative;
}
.nav-search-input {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 8px;
    padding: 0.35rem 0.8rem 0.35rem 2rem;
    color: #E2E8F0;
    font-size: 0.82rem;
    width: 200px;
    outline: none;
    transition: all 0.2s;
}
.nav-search-input:focus {
    border-color: rgba(0, 217, 255, 0.5);
    width: 300px;
    background: rgba(15, 23, 42, 0.9);
}
.nav-search-input::placeholder {
    color: #64748B;
}
.nav-search-icon {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    color: #64748B;
    font-size: 0.75rem;
    pointer-events: none;
}
.search-results {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    min-width: 350px;
    background: rgba(15, 23, 42, 0.97);
    border: 1px solid rgba(71, 85, 105, 0.4);
    border-radius: 10px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 300;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(12px);
}
.search-results.visible { display: block; }
.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.8rem;
    text-decoration: none;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(71, 85, 105, 0.15);
}
.search-result-item:hover { background: rgba(0, 217, 255, 0.06); }
.search-result-type {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    white-space: nowrap;
    min-width: 40px;
    text-align: center;
}
.search-result-type.cve { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.search-result-type.cwe { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.search-result-type.capec { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.search-result-type.attack { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.search-result-text {
    flex: 1;
    min-width: 0;
}
.search-result-id {
    font-size: 0.8rem;
    font-weight: 600;
    color: #E2E8F0;
}
.search-result-title {
    font-size: 0.72rem;
    color: #94A3B8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-no-results {
    padding: 1.5rem;
    text-align: center;
    color: #64748B;
    font-size: 0.82rem;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    position: relative;
    z-index: 10;
    padding: var(--spacing-xl) 0;
    text-align: center;
    max-width: 1400px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    letter-spacing: -0.02em;
}

.gradient-text {
    background: linear-gradient(90deg, #FFFFFF 0%, var(--primary-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto var(--spacing-lg);
}

.hero-badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-md);
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--primary-cyan);
    border-radius: 2rem;
    color: var(--primary-cyan);
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ============================================
   STATS SECTION
   ============================================ */
.stats-section {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 217, 255, 0.1);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-blue));
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: rgba(0, 217, 255, 0.1);
    border: 2px solid var(--primary-cyan);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

.stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.stat-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ============================================
   FILTERS
   ============================================ */
.filters {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg) var(--spacing-lg);
}

.filters-container {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Search Bar */
.search-box {
    width: 100%;
    display: flex;
    align-items: center;
    background: var(--darker-navy);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 0 var(--spacing-sm);
    transition: all 0.3s;
}

.search-box:focus-within {
    border-color: var(--primary-cyan);
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.1);
}

.search-icon {
    color: var(--text-muted);
    margin-right: var(--spacing-xs);
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 0.625rem 0;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
}

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

.search-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.search-clear:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* Date Filters */
.date-filters {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid var(--card-border);
}

.date-quick-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.date-quick-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.date-quick-btn.active {
    background: var(--primary-cyan);
    border-color: var(--primary-cyan);
    color: var(--dark-navy);
}

.date-separator {
    color: var(--text-secondary);
    opacity: 0.4;
    font-size: 1rem;
    margin: 0 0.25rem;
    user-select: none;
}

.date-select {
    padding: 0.375rem 0.75rem;
    background: var(--darker-navy);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2394A3B8' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.75rem;
    min-width: 5rem;
}

.date-select:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.date-select.active {
    background: rgba(0, 217, 255, 0.1);
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.date-select:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.date-select option {
    background: var(--dark-navy);
    color: var(--text-primary);
}

.date-filter-custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.date-input {
    padding: 0.375rem 0.75rem;
    background: var(--darker-navy);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.8125rem;
    outline: none;
    transition: all 0.2s;
}

.date-input:focus {
    border-color: var(--primary-cyan);
}

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

.date-apply-btn {
    padding: 0.375rem 1rem;
    background: var(--primary-cyan);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--dark-navy);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.date-apply-btn:hover {
    background: var(--primary-cyan);
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Filter Groups */
.filter-groups {
    width: 100%;
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

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

.filter-btn {
    padding: 0.375rem 0.75rem;
    background: transparent;
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.filter-btn:hover {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
}

.filter-count {
    opacity: 0.7;
    font-weight: 400;
    font-size: 0.75rem;
}

.filter-btn.active {
    background: var(--primary-cyan);
    border-color: var(--primary-cyan);
    color: var(--dark-navy);
}

.filter-btn.critical {
    border-color: var(--critical-red);
    color: var(--critical-red);
}

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

.filter-btn.high {
    border-color: var(--high-orange);
    color: var(--high-orange);
}

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

.filter-btn.medium {
    border-color: var(--medium-yellow);
    color: var(--medium-yellow);
}

.filter-btn.medium.active {
    background: var(--medium-yellow);
    color: var(--dark-navy);
}

.filter-btn.smart {
    border-color: var(--purple-accent);
    color: var(--purple-accent);
}

.filter-btn.smart.active {
    background: var(--purple-accent);
    color: white;
}

.filter-btn.ransomware {
    border-color: #DC2626;
    color: #DC2626;
}

.filter-btn.ransomware.active {
    background: #DC2626;
    color: white;
}

/* Sort Filters */
.sort-filters {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.sort-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sort-btn {
    padding: 0.375rem 0.75rem;
    background: var(--darker-navy);
    border: 1px solid var(--card-border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
}

.sort-btn:hover {
    background: var(--card-bg);
    border-color: var(--primary-cyan);
    transform: translateY(-1px);
}

.sort-btn.active {
    background: var(--primary-cyan);
    color: var(--dark-navy);
    border-color: var(--primary-cyan);
    font-weight: 600;
}

/* ============================================
   CVE CARDS
   ============================================ */
.cves-section {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-lg);
}

.section-header {
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.cve-grid {
    display: grid;
    gap: var(--spacing-lg);
}

/* Timeline removed */

.cve-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-left: 4px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.cve-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.cve-card.critical {
    border-left-color: var(--critical-red);
}

.cve-card.high {
    border-left-color: var(--high-orange);
}

.cve-card.medium {
    border-left-color: var(--medium-yellow);
}

.cve-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.lang-toggle {
    display: flex;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.lang-btn {
    padding: 0.25rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-btn:hover {
    background: rgba(0, 217, 255, 0.2);
    color: var(--primary-cyan);
}

.lang-btn.active {
    background: var(--primary-cyan);
    color: var(--dark-navy);
}

.cve-id {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-cyan);
    text-decoration: none;
    transition: color 0.3s;
}

.cve-id:hover {
    color: var(--primary-blue);
}

.severity-badge {
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: transparent;
    transition: all 0.2s ease;
}

/* Severity standard: low=blue · medium=orange · high=red (KEV) · critical=purple */
.severity-badge.critical {
    background: rgba(147, 51, 234, 0.1);
    border: 1px solid #9333ea;
    color: #7c3aed;
}

.severity-badge.critical:hover {
    background: rgba(147, 51, 234, 0.18);
}

.severity-badge.high {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #b91c1c;
}

.severity-badge.high:hover {
    background: rgba(239, 68, 68, 0.18);
}

.severity-badge.medium {
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid #f97316;
    color: #c2410c;
}

.severity-badge.medium:hover {
    background: rgba(249, 115, 22, 0.2);
}

.severity-badge.low {
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid #3b82f6;
    color: #2563eb;
}

.severity-badge.low:hover {
    background: rgba(37, 99, 235, 0.18);
}

.cve-description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.cve-metrics {
    display: flex;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.metric {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value.high {
    color: var(--critical-red);
}

.metric-value.medium {
    color: var(--high-orange);
}

.metric-value.low {
    color: var(--success-green);
}

/* Product metric with vendor icon */
.metric-product {
    flex: 1;
    min-width: 0;
}

.product-with-icon {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem !important;
}

.product-name-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.card-vendor-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-vendor-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.cve-card:hover .card-vendor-img {
    opacity: 1;
}

.card-vendor-letter {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 217, 255, 0.15);
    border: 1px solid rgba(0, 217, 255, 0.3);
    color: var(--primary-cyan);
    font-size: 0.75rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
}

.cve-tags {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.tag {
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.tag.kev, .tag-kev,
.tag.cwe, .tag-cwe,
.tag.exploit, .tag-exploit,
.tag.poc, .tag-poc {
    background: transparent;
    border-color: #00d9ff;
    color: #00d9ff;
}

.tag.kev:hover, .tag-kev:hover,
.tag.cwe:hover, .tag-cwe:hover,
.tag.exploit:hover, .tag-exploit:hover,
.tag.poc:hover, .tag-poc:hover {
    background: rgba(0, 217, 255, 0.1);
    border-color: #00ffcc;
    color: #00ffcc;
}

.tag.ransomware, .tag-ransomware {
    background: rgba(220, 38, 38, 0.15);
    border-color: #DC2626;
    color: #EF4444;
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 0 6px rgba(220, 38, 38, 0.25);
}

.tag.ransomware:hover, .tag-ransomware:hover {
    background: rgba(220, 38, 38, 0.25);
    border-color: #EF4444;
    color: #F87171;
    box-shadow: 0 2px 10px rgba(220, 38, 38, 0.4);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    position: relative;
    z-index: 10;
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
    border-top: 1px solid var(--card-border);
    margin-top: var(--spacing-xl);
}

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

.footer-text a {
    color: var(--primary-cyan);
    text-decoration: none;
}

.footer-text a:hover {
    text-decoration: underline;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

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

    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        flex-wrap: wrap;
    }

    .cve-metrics {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .search-results {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
    }

    .header-container {
        padding: 0 1rem;
    }

    .cve-card {
        padding: 1rem;
    }

    .content-section {
        padding: 1rem;
    }

    /* Horizontal scroll for wide tables */
    .table-responsive,
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ============================================
   LOADING ANIMATION
   ============================================ */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: var(--spacing-xl);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--card-border);
    border-top-color: var(--primary-cyan);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-gradient {
    background: linear-gradient(90deg, #FFFFFF 0%, var(--primary-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glow {
    box-shadow: 0 0 20px rgba(0, 217, 255, 0.3);
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* =====================================================================
   LIGHT DESIGN SYSTEM OVERRIDES (csurface / ml-discovery)
   Appended last so it wins the cascade over legacy dark rules.
   ===================================================================== */

/* Headings & display type → Como */
h1, h2, h3, h4, h5, h6,
.hero-title, .section-title, .card-title, .chart-title {
    font-family: var(--font-display);
    color: var(--text-strong);
    letter-spacing: -0.01em;
}

/* Gradient titles (were white→cyan, invisible on light) → solid dark */
.logo-text, .gradient-text, .text-gradient {
    background: none !important;
    -webkit-text-fill-color: currentColor !important;
    color: var(--text-strong) !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
}
.logo-text { color: var(--accent) !important; font-weight: 800; }

/* Glow utility → subtle */
.glow { box-shadow: var(--shadow-sm); }

/* Nav links */
.nav-links a { color: var(--text-muted); }
.nav-links a:hover { color: var(--accent); }

/* Nav dropdown menu → white surface */
.nav-dropdown-menu {
    background: #ffffff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    backdrop-filter: none;
}
/* Items live inside the navy .header, whose `.header a {color:#fff !important}`
   would otherwise make them white-on-white. Force dark + navy hover. */
.nav-dropdown-menu li a,
.nav-dropdown-menu li a i { color: #334155 !important; }
.nav-dropdown-menu li a:hover,
.nav-dropdown-menu li a:hover i { color: #1e40af !important; background: rgba(30,64,175,0.08); }
.nav-dropdown-menu li a:hover { background: rgba(30,64,175,0.08); }

/* Nav login button → accent */
.nav-login-btn {
    background: var(--accent-soft) !important;
    border: 1px solid var(--accent) !important;
    color: var(--accent) !important;
}
.nav-login-btn:hover {
    background: var(--accent) !important;
    color: #fff !important;
    border-color: var(--accent) !important;
}

/* Global search input/results → light */
.nav-search-input {
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: var(--text);
}
.nav-search-input:focus { border-color: var(--accent); background: var(--bg-input); }
.nav-search-input::placeholder { color: var(--text-faint); }
.nav-search-icon { color: var(--text-faint); }
.search-results {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    backdrop-filter: none;
}
.search-result-item { border-bottom: 1px solid var(--border); }
.search-result-item:hover { background: var(--accent-soft); }
/* Search result type chips → monochrome */
.search-result-type.cve   { background: var(--danger-soft); color: var(--danger); }
.search-result-type.cwe   { background: var(--slate-100); color: var(--slate-700); }
.search-result-type.capec { background: var(--slate-100); color: var(--slate-700); }
.search-result-type.attack{ background: var(--accent-soft); color: var(--accent); }

/* Generic cards/panels that used dark glass → light surface */
.card, .panel, .stat-card, .glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    backdrop-filter: none;
}

/* Buttons (generic) → light */
.btn, button.btn {
    font-family: var(--font-body);
    border-radius: var(--r-md);
}
.btn-primary, .btn-accent {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #fff;
}
.btn-primary:hover, .btn-accent:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

/* Inputs/selects (generic) → light */
input[type="text"], input[type="search"], input[type="email"],
input[type="password"], input[type="number"], select, textarea {
    background: var(--bg-input);
    border: 1px solid var(--border-strong);
    color: var(--text);
    border-radius: var(--r-md);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--shadow-glow); }

/* ── Remove colored side-stripe on vulnerability cards (user request) ── */
.cve-card { border-left: 1px solid var(--border) !important; }
.cve-card.critical, .cve-card.high, .cve-card.medium, .cve-card.low,
.cve-card:hover { border-left-color: var(--border) !important; }

/* Card titles/labels readable (Como display, dark) */
.card-title, .chart-title, .section-title, .kpi-title { color: var(--text-strong); }

/* ── Mini-card / badge on navy emphasis (csurface grade pattern) ── */
.mini-card-navy {
    background: var(--navy);
    border: 1px solid rgba(54,208,234,0.25);
    border-radius: var(--r-md);
    color: #e2e8f0;
}

/* ── Top navigation bar → navy (csurface brand) ── */
.header {
    background: var(--navy) !important;
    border-bottom: 1px solid rgba(54, 208, 234, 0.22) !important;
}
.header a, .nav-links a, .header .nav-link,
.nav-dropdown-toggle, .nav-search-icon { color: #ffffff !important; }
.nav-links a:hover, .header a:hover, .header .nav-link:hover,
.nav-dropdown-toggle:hover { color: var(--cyan-bright) !important; }
.logo-text { color: #ffffff !important; }
.nav-search-input {
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
    color: #e2e8f0 !important;
}
.nav-search-input::placeholder { color: #94a3b8 !important; }
.nav-badge { background: var(--accent-orange); color: #0a1f44; }

/* ── CVE card metrics: white outlined chips, equal-size, severity on outline+number ── */
.cve-metrics {
    gap: 0.55rem !important;
    flex-wrap: wrap;
    align-items: stretch;
    margin-top: 0.5rem;
}
.cve-metrics .metric {
    background: #ffffff;
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 0.5rem 0.6rem;
    text-align: center;
    align-items: center;
    flex: 0 0 auto;
    width: 88px;
    gap: 0.15rem;
}
.cve-metrics .metric-label { font-size: 0.62rem; }
/* CVSS / EPSS / KEV PRED uniform; PRODUCT wider + left aligned, neutral outline */
.cve-metrics .metric.metric-product {
    flex: 1 1 auto;
    text-align: left;
    align-items: stretch;
    justify-content: center;
}
.cve-metrics .metric.metric-product .metric-value.product-with-icon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.6rem;
}
/* Severity color on the outline (matches the value's color) */
.cve-metrics .metric:has(.metric-value.high)   { border-color: var(--critical-red); }
.cve-metrics .metric:has(.metric-value.medium) { border-color: var(--high-orange); }
.cve-metrics .metric:has(.metric-value.low)    { border-color: var(--success-green); }

/* Blue/cyan-filled buttons & badges → white text */
.filter-btn.active { color: #ffffff !important; }
.filter-btn.medium.active { color: #060818 !important; } /* amber keeps dark */

/* ============================================================
   TYPOGRAPHY STANDARD
   Titles (cards/menus) → Como display, UPPERCASE.
   Body text → Manrope (via --font-body).
   ============================================================ */
h1, h2, h3, h4, h5, h6,
.card-title, .chart-title, .section-title, .kpi-title, .stat-title,
.content-section h2, .sidebar-card h3, .cve-title, .analytics-title {
    font-family: var(--font-display) !important;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
/* Menus / nav / tabs / filters → uppercase */
.nav-links a, .header .nav-link, .tab-btn, .filter-btn,
.nav-dropdown-toggle, .breadcrumb-item {
    text-transform: uppercase;
    letter-spacing: 0.02em;
}
/* Keep the hero copy natural (not shouty) */
.hero-title, .hero-subtitle { text-transform: none !important; }

/* ── Top bar brand: icon + CSURFACE (Como) | THREAT SENSOR ── */
.logo { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; }
.logo-icon-img { height: 30px; width: auto; display: block; }
.logo-csurface {
    font-family: var(--font-display);   /* Como */
    font-weight: 800;
    font-size: 1.4rem;
    color: #ffffff;
    letter-spacing: 0.02em;
    line-height: 1;
}
.logo-divider {
    display: inline-block;
    width: 1px;
    height: 22px;
    background: rgba(255, 255, 255, 0.6);
    margin: 0 0.2rem;
}
.logo-ts {
    font-family: var(--font-display);   /* Como, smaller */
    font-weight: 600;
    font-size: 0.78rem;
    color: #ffffff;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1;
}

/* ===================================================================
   LIBRARY PAGES — light cards (overrides per-template dark inline <style>)
   Shared by cwe/capec/attack/d3fend/ransomware library landing pages.
   !important beats the templates' non-important inline rules.
   Rule: white bg → navy (#1e40af) accents, not cyan.
   =================================================================== */
.library-card {
    background: #ffffff !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    box-shadow: 0 1px 2px rgba(15,23,42,0.04) !important;
}
.library-card:hover {
    border-color: rgba(30,64,175,0.4) !important;
    box-shadow: 0 4px 12px rgba(15,23,42,0.08) !important;
    transform: translateY(-2px);
}
.library-card-id { color: #1e40af !important; }
.library-card-name { color: #334155 !important; }

.filter-tab {
    background: #ffffff !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    color: #475569 !important;
}
.filter-tab:hover { border-color: rgba(30,64,175,0.4) !important; color: #1e40af !important; }
.filter-tab.active { background: rgba(30,64,175,0.1) !important; border-color: rgba(30,64,175,0.45) !important; color: #1e40af !important; }
.filter-desc { color: #64748b !important; }
.filter-tab.active .filter-desc { color: #1e40af !important; }

.library-search input,
.library-search select {
    background: #ffffff !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    color: #0f172a !important;
}
.library-search input::placeholder { color: #94a3b8 !important; }
.library-search button {
    background: rgba(30,64,175,0.1) !important;
    border: 1px solid rgba(30,64,175,0.4) !important;
    color: #1e40af !important;
}
.library-search button:hover { background: rgba(30,64,175,0.18) !important; }

.library-pagination a {
    background: #ffffff !important;
    border: 1px solid var(--border, #e2e8f0) !important;
    color: #475569 !important;
}
.library-pagination a:hover { background: rgba(30,64,175,0.08) !important; color: #1e40af !important; }
.library-pagination .current { background: rgba(30,64,175,0.1) !important; color: #1e40af !important; }

/* ===================================================================
   BREADCRUMB — unify all pages to the cve_detail navy (#0a1f44).
   !important overrides the per-page inline <style> gray breadcrumb.
   =================================================================== */
.breadcrumb-nav {
    background: #0a1f44 !important;
    border: 1px solid rgba(54, 208, 234, 0.2) !important;
    backdrop-filter: none !important;
}
.breadcrumb-item,
.breadcrumb-item a { color: #ffffff !important; }
.breadcrumb-item { text-transform: uppercase; font-weight: 700; letter-spacing: 0.03em; }
.breadcrumb-item a:hover { color: #36d0ea !important; }
.breadcrumb-item.active { color: #ffffff !important; }
.breadcrumb-item + .breadcrumb-item::before { color: rgba(255, 255, 255, 0.35) !important; }
