@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --color-primary: #00f0ff;
    --color-secondary: #00ff9d;
    --bg-dark: #0a0a12;
    --bg-panel: #13131f;
}

body {
    background-color: var(--bg-dark);
    color: #e5e7eb;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #1f2937;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Hide Scrollbar for sleek look but keep functionality */
.scrollbar-hide::-webkit-scrollbar {
    display: none;
}
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Cyber Grid Background Effect */
.cyber-grid {
    background-size: 40px 40px;
    background-image: linear-gradient(to right, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
}

/* Glitch Animation for Headers (Optional) */
@keyframes glitch {
    0% { text-shadow: 2px 2px 0px #ff00c1, -2px -2px 0px #00fff9; }
    2% { text-shadow: -2px -2px 0px #ff00c1, 2px 2px 0px #00fff9; }
    4% { text-shadow: 0px 0px 0px #ff00c1, 0px 0px 0px #00fff9; }
    100% { text-shadow: 0px 0px 0px #ff00c1, 0px 0px 0px #00fff9; }
}

.glitch-hover:hover {
    animation: glitch 0.3s cubic-bezier(.25, .46, .45, .94) both infinite;
}

/* Pulse Animation for Critical Alerts */
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.pulse-alert {
    animation: pulse-red 2s infinite;
}

/* Bar Chart Animation */
.bar-grow {
    animation: grow 1s ease-out forwards;
    transform-origin: bottom;
}

@keyframes grow {
    from { transform: scaleY(0); }
    to { transform: scaleY(1); }
}

/* Log Fade In */
.log-entry {
    animation: fadeIn 0.3s ease-in;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Navigation Active State */
.nav-link.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: #00f0ff;
    color: #00f0ff;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

/* Threat Map Nodes */
.geo-node {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #00f0ff;
    box-shadow: 0 0 10px #00f0ff;
    z-index: 10;
}

.geo-node::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 1px solid #00f0ff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: ripple 2s infinite;
}

@keyframes ripple {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 60px; height: 60px; opacity: 0; }
}

.server-card {
    background: linear-gradient(145deg, #13131f, #0a0a12);
    border: 1px solid #374151;
    position: relative;
    overflow: hidden;
}

.server-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, #00ff9d, transparent);
}

/* Dark Web Specific Styles */
.darkweb-alert {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
    border: 1px solid rgba(239, 68, 68, 0.3);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0% { border-color: rgba(239, 68, 68, 0.3); }
    50% { border-color: rgba(239, 68, 68, 0.8); }
    100% { border-color: rgba(239, 68, 68, 0.3); }
}

/* Kill Switch Button Animation */
.kill-switch {
    animation: emergency-pulse 1.5s infinite;
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.6);
}

@keyframes emergency-pulse {
    0% { box-shadow: 0 0 20px rgba(220, 38, 38, 0.6); transform: scale(1); }
    50% { box-shadow: 0 0 40px rgba(220, 38, 38, 0.9); transform: scale(1.02); }
    100% { box-shadow: 0 0 20px rgba(220, 38, 38, 0.6); transform: scale(1); }
}

/* Forensics Timeline */
.timeline-node {
    position: relative;
    padding-left: 2rem;
}

.timeline-node::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.5rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--color-primary);
    box-shadow: 0 0 10px var(--color-primary);
}

/* Packet Animation */
.packet {
    animation: packet-flow 1s linear forwards;
}

@keyframes packet-flow {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Login Modal Animations */
@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

#login-modal > div {
    animation: slideDown 0.5s ease-out;
}

/* Access Control Specific Styles */
.access-granted {
    border-left: 3px solid #00f0ff;
    animation: pulse-cyber 2s infinite;
}

@keyframes pulse-cyber {
    0% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(0, 240, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 240, 255, 0); }
}

.egress-alert {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* USB Device Status Indicators */
.usb-authorized { border-left-color: #00ff9d; }
.usb-blocked { border-left-color: #ef4444; animation: shake 0.5s; }
.usb-pending { border-left-color: #eab308; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Session Bar Glass Effect */
#session-bar {
    background: rgba(19, 19, 31, 0.95);
    backdrop-filter: blur(10px);
}

/* Ingress/Egress Log Colors */
.ingress-allowed { color: #00ff9d; }
.ingress-blocked { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.ingress-warning { color: #eab308; }

.egress-normal { color: #00f0ff; }
.egress-suspicious { color: #f97316; background: rgba(249, 115, 22, 0.1); }
.egress-critical { color: #ef4444; background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.5); }

/* Blur effect for locked system */
.blur-sm {
    filter: blur(4px);
    pointer-events: none;
}
