/* Base Variables & Theme */
:root {
    --bg-background: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;
    --text-primary: #0f172a;
    /* Slate 900 */
    --text-secondary: #64748b;
    /* Slate 500 */
    --border-color: #cbd5e1;
    /* Slate 300 */
    --primary: #6366f1;
    /* Indigo 500 */
    --primary-foreground: #ffffff;
    --secondary: #e2e8f0;
    --secondary-foreground: #1e293b;
    --accent: #f1f5f9;
    --accent-foreground: #0f172a;
    --destructive: #ef4444;
    --radius: 0.5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

[data-theme='dark'] {
    --bg-background: #111827;
    /* Gray 900 (Lighter than black) */
    --bg-card: #1f2937;
    /* Gray 800 */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --border-color: #374151;
    --primary: #818cf8;
    /* Indigo 400 */
    --primary-foreground: #111827;
    --secondary: #374151;
    --secondary-foreground: #f3f4f6;
    --accent: #1f2937;
    --accent-foreground: #f3f4f6;

    --shadow-sm: 0 0 10px rgba(129, 140, 248, 0.1);
    --shadow-md: 0 0 20px rgba(129, 140, 248, 0.2);
}

/* Global Transition */
*,
*::before,
*::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

body {
    background-color: var(--bg-background);
    color: var(--text-primary);
}

/* Common Classes overrides needing CSS vars */
.bg-background {
    background-color: var(--bg-background) !important;
}

.bg-card {
    background-color: var(--bg-card) !important;
}

.text-foreground {
    color: var(--text-primary) !important;
}

.text-muted-foreground {
    color: var(--text-secondary) !important;
}

.border-input,
.border-border,
.border {
    border-color: var(--border-color) !important;
}

.shadow-sm {
    box-shadow: var(--shadow-sm) !important;
}

.shadow,
.shadow-md {
    box-shadow: var(--shadow-md) !important;
}

/* Custom Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translate3d(0, 20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate3d(0, -20px, 0);
    }

    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes gradientBg {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.animate-fade-up {
    animation: fadeInUp 0.6s ease-out forwards;
}

.animate-pop-in {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Stagger delays */
.delay-100 {
    animation-delay: 100ms;
}

.delay-200 {
    animation-delay: 200ms;
}

.delay-300 {
    animation-delay: 300ms;
}

/* Scroll Observer Class */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease-out;
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

[data-theme='dark'] .glass {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Card Hover Effects */
.card-hover-effect {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-effect:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

/* Button Pulse */
@keyframes pulse-soft {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

.btn-pulse:hover {
    animation: pulse-soft 1.5s infinite;
}

/* --- Neon & Visual Overhaul --- */

/* Neon Borders */
@keyframes neonBorderPulse {

    0%,
    100% {
        box-shadow: 0 0 5px var(--neon-color), 0 0 10px var(--neon-color), inset 0 0 2px var(--neon-color);
        border-color: var(--neon-color);
    }

    50% {
        box-shadow: 0 0 10px var(--neon-color), 0 0 20px var(--neon-color), inset 0 0 5px var(--neon-color);
        border-color: var(--neon-color-bright);
    }
}

.neon-border {
    --neon-color: rgba(59, 130, 246, 0.5);
    /* Blueish default */
    --neon-color-bright: rgba(96, 165, 250, 0.8);
    border: 1px solid transparent;
    animation: neonBorderPulse 3s infinite alternate;
}

[data-theme='dark'] .neon-border {
    --neon-color: rgba(139, 92, 246, 0.6);
    /* Purple/Violet in dark mode */
    --neon-color-bright: rgba(167, 139, 250, 1);
}

/* Radar Footer */
.radar-footer {
    position: relative;
    overflow: hidden;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.1), transparent);
}

.radar-scan-line {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary));
    transform-origin: left;
    animation: radarScan 4s linear infinite;
    opacity: 0.1;
    pointer-events: none;
    z-index: 0;
}

@keyframes radarScan {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.radar-grid {
    background-image: radial-gradient(circle, var(--border-color) 1px, transparent 1px);
    background-size: 30px 30px;
    mask-image: radial-gradient(circle at center, black 40%, transparent 80%);
    opacity: 0.3;
}

/* Vibrant Dark Mode Override */
/* Dark Mode Visual Tweaks */
[data-theme='dark'] {
    /* Ensure consistency if mistakenly overridden */
    --bg-background: #111827;
    --bg-card: #1f2937;
    --primary: #818cf8;
}

/* Make headers pop in dark mode */
[data-theme='dark'] h1,
[data-theme='dark'] h2,
[data-theme='dark'] h3 {
    text-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

/* Hover effects for neon */
.hover-neon:hover {
    box-shadow: 0 0 15px var(--primary);
    border-color: var(--primary);
    transform: translateY(-2px);
}