/* Premium Design System - Legion CTI */
:root {
    --glass-bg: rgba(12, 12, 12, 0.85);
    --glass-border: rgba(255, 255, 255, 0.07);
    --glass-highlight: rgba(255, 255, 255, 0.12);

    --brand-red: #ff0000;
    --brand-dark: #800000;
    --brand-black: #000000;
    --brand-surface: #0a0a0a;
    --brand-dim: #1a0000;

    --accent-gradient: linear-gradient(135deg, #ff2020 0%, #800000 100%);
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: rgba(255,255,255,0.3);

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===================== BASE ===================== */

html {
    scroll-behavior: smooth;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    background-color: var(--brand-black);
    background-image:
        radial-gradient(ellipse at 10% 20%, rgba(255, 0, 0, 0.06) 0%, transparent 40%),
        radial-gradient(ellipse at 90% 80%, rgba(100, 0, 0, 0.04) 0%, transparent 35%);
    color: var(--text-primary);
    font-family: 'Inter', system-ui, sans-serif;
    overflow-x: hidden;
    line-height: 1.5;
}

/* ===================== SCROLLBAR ===================== */

::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-red); }

.custom-scrollbar::-webkit-scrollbar { width: 3px; }
.custom-scrollbar::-webkit-scrollbar-track { background: transparent; }
.custom-scrollbar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 10px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(255,0,0,0.4); }

/* ===================== GLASS CARDS ===================== */

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    transition: all var(--transition-base);
}

.glass-panel:hover {
    border-color: var(--glass-highlight);
    transform: translateY(-1px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ===================== BUTTONS ===================== */

.btn-premium {
    background: var(--accent-gradient);
    border: none;
    color: white;
    font-weight: 700;
    padding: 0.75rem 1.5rem;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.25);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 11px;
}

.btn-premium::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.15), transparent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.btn-premium:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(255, 0, 0, 0.45);
}

.btn-premium:hover::after { opacity: 1; }
.btn-premium:active { transform: translateY(0); }

/* ===================== INPUTS ===================== */

.input-premium {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    transition: all var(--transition-base);
    border-radius: 2px;
}

.input-premium:focus {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 0, 0, 0.5);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 0, 0, 0.1);
}

.input-premium::placeholder { color: rgba(255,255,255,0.15); }

/* ===================== ANIMATIONS ===================== */

@keyframes fadeInSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 5px rgba(255,0,0,0.3); }
    50% { box-shadow: 0 0 20px rgba(255,0,0,0.6); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-entry {
    animation: fadeInSlideUp 0.4s ease-out forwards;
}

.animate-entry-delay-1 { animation: fadeInSlideUp 0.4s ease-out 0.05s forwards; opacity: 0; }
.animate-entry-delay-2 { animation: fadeInSlideUp 0.4s ease-out 0.10s forwards; opacity: 0; }
.animate-entry-delay-3 { animation: fadeInSlideUp 0.4s ease-out 0.15s forwards; opacity: 0; }
.animate-entry-delay-4 { animation: fadeInSlideUp 0.4s ease-out 0.20s forwards; opacity: 0; }

/* ===================== STAT CARDS ===================== */

.stat-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: border-color var(--transition-base);
}

.stat-card:hover { border-color: rgba(255,0,0,0.3); }

.stat-card .stat-value {
    animation: countUp 0.5s ease-out forwards;
}

/* ===================== SIDEBAR ===================== */

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 2px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    transition: all var(--transition-base);
    color: rgba(255,255,255,0.35);
    position: relative;
}

.sidebar-link:hover { color: white; background: rgba(255,255,255,0.04); }
.sidebar-link.active { color: var(--brand-red); }
.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 60%;
    background: var(--brand-red);
    box-shadow: 0 0 8px rgba(255,0,0,0.5);
}

/* ===================== NOTIFICATION BADGE ===================== */

.notif-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: var(--brand-red);
    color: white;
    font-size: 8px;
    font-weight: 900;
    border-radius: 99px;
    line-height: 1;
    box-shadow: 0 0 8px rgba(255,0,0,0.4);
}

/* ===================== SEVERITY COLORS ===================== */

.severity-critical { color: #ff0000; border-color: rgba(255,0,0,0.4); background: rgba(255,0,0,0.05); }
.severity-high { color: #ff6600; border-color: rgba(255,102,0,0.4); background: rgba(255,102,0,0.05); }
.severity-medium { color: #ffcc00; border-color: rgba(255,204,0,0.4); background: rgba(255,204,0,0.05); }
.severity-low { color: #00cc66; border-color: rgba(0,204,102,0.4); background: rgba(0,204,102,0.05); }
.severity-info { color: #3399ff; border-color: rgba(51,153,255,0.4); background: rgba(51,153,255,0.05); }

/* Category → Severity mapping */
.cat-RANSOMWARE, .cat-ransomware { color: #ff0000; }
.cat-MALWARE, .cat-malware { color: #ff4400; }
.cat-PHISHING, .cat-phishing { color: #ff8800; }
.cat-ZERO-DAY, .cat-zero-day { color: #ffcc00; }
.cat-DATA-BREACH, .cat-data-breach { color: #ff6600; }

/* ===================== SKELETON LOADERS ===================== */

.skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.03) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 2px;
}

/* ===================== FEED ===================== */

.feed-container {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

@media (max-width: 1280px) { .feed-container { grid-template-columns: 1fr 2fr; } }
@media (max-width: 1024px) { .feed-container { grid-template-columns: 100%; } }

/* ===================== POST CARDS ===================== */

.post-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 2px;
    transition: border-color var(--transition-base), transform var(--transition-base);
    overflow: hidden;
}

.post-card:hover {
    border-color: rgba(255,0,0,0.25);
}

/* ===================== AVATAR ===================== */

.avatar-ring {
    padding: 2px;
    background: var(--accent-gradient);
    border-radius: 50%;
}

/* ===================== GLOW BORDER ===================== */

.glow-border {
    border: 1px solid rgba(255, 0, 0, 0.08);
    transition: border var(--transition-base), box-shadow var(--transition-base);
}

.glow-border:hover {
    border-color: rgba(255, 0, 0, 0.25);
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.08);
}

/* ===================== STATUS INDICATORS ===================== */

.status-online { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.status-away { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,0.5); }
.status-offline { background: rgba(255,255,255,0.2); }

/* ===================== CHARTS ===================== */

.chart-container {
    position: relative;
    width: 100%;
}

/* ===================== TOOLTIP ===================== */

[data-tooltip] {
    position: relative;
    cursor: default;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: #111;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 8px;
    white-space: nowrap;
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: none;
    opacity: 0;
    transition: opacity var(--transition-fast);
    z-index: 50;
}

[data-tooltip]:hover::after { opacity: 1; }

/* ===================== BACK TO TOP ===================== */

#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 36px;
    height: 36px;
    background: var(--brand-red);
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base), transform var(--transition-base);
    z-index: 100;
    font-size: 11px;
}

#back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

#back-to-top:hover { transform: translateY(-2px); box-shadow: 0 4px 16px rgba(255,0,0,0.4); }

/* ===================== UTILITY ===================== */

[x-cloak] { display: none !important; }

.truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.aspect-square { aspect-ratio: 1 / 1; }
.object-cover { object-fit: cover; }

/* Grid fallbacks */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }

/* ===================== FOCUS VISIBLE ===================== */

*:focus-visible {
    outline: 2px solid rgba(255,0,0,0.5);
    outline-offset: 2px;
}
