@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --primary: #ef4444;
    --accent: #3b82f6;
    --bg: #050507;
    --text: #f1f5f9;
    --text-dim: #94a3b8;
    --card-border: rgba(255, 255, 255, 0.08);
    --glass: rgba(13, 14, 18, 0.9);
    --modal-bg: #0a0a0c;
    --grid-color: rgba(255, 255, 255, 0.02);
}

body.light-theme {
    --bg: #ffffff;
    --text: #0f172a;
    --text-dim: #475569;
    --card-border: rgba(15, 23, 42, 0.15);
    --glass: rgba(255, 255, 255, 1);
    --modal-bg: #ffffff;
    --grid-color: rgba(15, 23, 42, 0.08);
}

body {
    background-color: var(--bg);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(239, 68, 68, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(59, 130, 246, 0.05) 0%, transparent 40%);
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.01em;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

.glass-panel {
    background: var(--glass);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 32px 0 rgba(0, 0, 0, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.card-critical { border-left: 3px solid #ef4444; }
.card-high { border-left: 3px solid #f97316; }
.card-intel { border-left: 3px solid #3b82f6; }
.card-mobile { border-left: 3px solid #a855f7; }
.card-local-id { border-left: 3px solid #ef4444; }

.ticker-wrap {
    overflow: hidden;
    white-space: nowrap;
}

.ticker-move {
    display: inline-block;
    animation: ticker var(--ticker-speed, 60s) linear infinite;
}

@keyframes ticker {
    0% { transform: translateX(10%); }
    100% { transform: translateX(-100%); }
}

/* Animated Background Grid */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
    mask-image: radial-gradient(circle at 50% 50%, black, transparent);
    animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
    0% { background-position: 0 0; }
    100% { background-position: 50px 50px; }
}

#loading-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease-out;
}

.loader-bar {
    width: 200px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}

.loader-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: var(--primary);
    animation: loading 1.5s infinite ease-in-out;
}

@keyframes loading {
    0% { left: -50%; }
    100% { left: 100%; }
}

.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.tag {
    font-size: 8px;
    padding: 1px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.05em;
    font-family: 'JetBrains Mono', monospace;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid transparent;
}

.tag-mitre {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.3), rgba(249, 115, 22, 0.1));
    color: #fdba74;
    border-color: rgba(249, 115, 22, 0.4);
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.15);
    cursor: help;
}

.tag-mitre:hover {
    box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
    background: rgba(249, 115, 22, 0.4);
}

.tag-apt {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.4);
    animation: threat-pulse 2s infinite ease-in-out;
}

.tag-malware {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.4);
}

.tag-country {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7; 
    border-color: rgba(16, 185, 129, 0.4);
}

.tag-platform {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
    border-color: rgba(255, 255, 255, 0.15);
    font-weight: 700;
}

body.light-theme .tag-platform {
    background: rgba(15, 23, 42, 0.05);
    color: #1e293b;
    border-color: rgba(15, 23, 42, 0.1);
}

@keyframes threat-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; box-shadow: 0 0 10px rgba(239, 68, 68, 0.3); }
    100% { transform: scale(1); opacity: 1; }
}

/* Intel Tooltip */
.intel-tooltip {
    position: absolute;
    z-index: 10000;
    width: 280px;
    background: rgba(15, 17, 21, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 14px;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 11px;
    line-height: 1.5;
    transform: translateY(10px);
}

.intel-tooltip.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.intel-tooltip h4 {
    font-weight: 800;
    color: #fdba74;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    display: block;
    border-bottom: 1px solid rgba(253, 186, 116, 0.2);
    padding-bottom: 4px;
}

.intel-tooltip .desc {
    color: #94a3b8;
}

.intel-tooltip .mitre-id {
    color: #f97316;
    font-family: 'JetBrains Mono', monospace;
    font-weight: bold;
    margin-top: 4px;
}

/* News Modal Activation */
#news-modal.modal-active {
    display: flex;
}

#news-modal.modal-active .modal-content-news {
    scale: 1;
    opacity: 1;
}

.modal-detail-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 12px;
}

.modal-detail-label {
    font-size: 9px;
    font-weight: 800;
    color: #f9731688;
    text-transform: uppercase;
    margin-bottom: 4px;
    display: block;
}

.modal-detail-text {
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.4;
}

/* Modal Overlay */
#intel-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: #0d0e12;
    border: 1px solid var(--card-border);
    max-width: 500px;
    width: 100%;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 0 50px rgba(239, 68, 68, 0.1);
}

.tag-local { background: rgba(34, 211, 238, 0.2); color: #22d3ee; border: 1px solid rgba(34, 211, 238, 0.3); }
.tag-indicator { background: rgba(168, 85, 247, 0.2); color: #a855f7; border: 1px solid rgba(168, 85, 247, 0.3); }


/* Theme Overrides for News Modal */
body.light-theme .modal-content-news {
    background-color: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

body.light-theme .modal-content-news .bg-white\/5,
body.light-theme .modal-content-news .bg-white\/2 {
    background-color: rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .modal-content-news .text-white {
    color: #0f172a !important;
}

body.light-theme .modal-content-news .text-gray-400 {
    color: #475569 !important;
}

body.light-theme .modal-content-news .md\:bg-\[\#0d0e12\],
body.light-theme .modal-content-news .bg-\[\#0d0e12\],
body.light-theme .w-full.md\:w-80.bg-\[\#0d0e12\] {
    background-color: #f8fafc !important;
    border-left-color: rgba(15, 23, 42, 0.1) !important;
}

body.light-theme #modal-json {
    background-color: #f1f5f9 !important;
    color: #475569 !important;
    border-color: rgba(15, 23, 42, 0.1);
}

body.light-theme .modal-detail-card {
    background-color: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.1);
}

body.light-theme .modal-detail-text {
    color: #475569 !important;
}

body.light-theme #news-modal {
    background-color: rgba(255, 255, 255, 0.8) !important;
}

/* Ransom Alert Toast Animation */
.ransom-toast {
    background: rgba(20, 10, 10, 0.9);
    backdrop-filter: blur(15px);
    border-left: 4px solid #ef4444;
    border-right: 1px solid rgba(239, 68, 68, 0.3);
    border-top: 1px solid rgba(239, 68, 68, 0.3);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    padding: 16px 20px;
    border-radius: 4px 12px 12px 4px;
    width: 320px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 20px rgba(239, 68, 68, 0.1);
    animation: toast-slide-in 0.5s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    pointer-events: auto;
    margin-bottom: 10px;
}

@keyframes toast-slide-in {
    from { transform: translateX(120%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.ransom-toast-pulse {
    animation: ransom-text-pulse 1.5s infinite;
}

@keyframes ransom-text-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; text-shadow: 0 0 10px #ef4444; }
    100% { opacity: 1; }
}

.animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Advanced Forensic Glassmorphism & UI */
.modal-content-news {
    background: linear-gradient(135deg, #0a0a0c 0%, #0d0e12 100%) !important;
    position: relative;
    overflow: hidden;
}

.modal-content-news::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(45deg, transparent, rgba(239, 68, 68, 0.3), transparent);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    animation: border-pulse 4s linear infinite;
}

@keyframes border-pulse {
    0% { opacity: 0.3; }
    50% { opacity: 0.8; }
    100% { opacity: 0.3; }
}

.modal-detail-card {
    background: rgba(255, 255, 255, 0.02) !important;
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05) !important;
}

.modal-detail-card:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(239, 68, 68, 0.2) !important;
    transform: translateY(-2px);
}

.neon-glow-red {
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}

/* Recency Badges */
.recency-badge {
    font-size: 8px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
}

.recency-active {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.recency-today {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.recency-historic {
    background: rgba(156, 163, 175, 0.1);
    color: #9ca3af;
    border: 1px solid rgba(156, 163, 175, 0.2);
}

.pulse-subtle {
    animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
    70% { box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.sync-active-pulse {
    animation: sync-border-pulse 1s infinite alternate;
    border-color: rgba(239, 68, 68, 0.6) !important;
    background: rgba(239, 68, 68, 0.1) !important;
}

@keyframes sync-border-pulse {
    from { box-shadow: 0 0 5px rgba(239, 68, 68, 0.2); }
    to { box-shadow: 0 0 15px rgba(239, 68, 68, 0.5); }
}

.text-sync-red {
    color: #ef4444 !important;
    text-shadow: 0 0 8px rgba(239, 68, 68, 0.6);
}
