/* ═══════════════════════════════════════════════════════════
   NEON MANDALA — Design System & Base Styles
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ─── CSS Variables (Design Tokens) ─── */
:root {
    /* Primary Palette */
    --primary-50:  #faf5ff;
    --primary-100: #f3e8ff;
    --primary-200: #e9d5ff;
    --primary-300: #d8b4fe;
    --primary-400: #c084fc;
    --primary-500: #a855f7;
    --primary-600: #9333ea;
    --primary-700: #7c3aed;
    --primary-800: #6b21a8;
    --primary-900: #581c87;

    /* Accent */
    --accent-pink: #ec4899;
    --accent-cyan: #06b6d4;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-rose: #f43f5e;

    /* Neutrals */
    --dark-950: #030305;
    --dark-900: #0a0a0f;
    --dark-800: #111118;
    --dark-700: #1a1a24;
    --dark-600: #252530;
    --dark-500: #333345;
    --dark-400: #52526b;
    --dark-300: #7c7c99;
    --dark-200: #a8a8c0;
    --dark-100: #d4d4e0;

    /* Surfaces */
    --surface-glass: rgba(10, 10, 20, 0.85);
    --surface-card: rgba(20, 20, 35, 0.9);
    --surface-elevated: rgba(30, 30, 50, 0.95);
    --border-subtle: rgba(168, 85, 247, 0.15);
    --border-medium: rgba(168, 85, 247, 0.3);
    --border-strong: rgba(168, 85, 247, 0.5);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #a855f7, #7c3aed);
    --gradient-glow: linear-gradient(135deg, #a855f7, #ec4899);
    --gradient-cosmic: linear-gradient(135deg, #7c3aed, #06b6d4);
    --gradient-fire: linear-gradient(135deg, #f43f5e, #f59e0b);
    --gradient-dark: linear-gradient(180deg, #0a0a0f 0%, #111118 100%);

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(168, 85, 247, 0.3);
    --shadow-glow-strong: 0 0 60px rgba(168, 85, 247, 0.5);

    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Space Grotesk', 'Inter', sans-serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    --space-4xl: 96px;

    /* Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* Transitions */
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;

    /* Z-index scale */
    --z-base: 1;
    --z-overlay: 10;
    --z-modal: 50;
    --z-toast: 100;
}

/* ─── Reset & Base ─── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    background-color: var(--dark-950);
    color: var(--dark-100);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--primary-400);
    text-decoration: none;
    transition: color var(--duration-fast) var(--ease-out);
}
a:hover { color: var(--primary-300); }

img { max-width: 100%; display: block; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--dark-900); }
::-webkit-scrollbar-thumb { 
    background: var(--dark-500); 
    border-radius: 3px; 
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-700); }

/* ─── Selection ─── */
::selection {
    background: rgba(168, 85, 247, 0.3);
    color: #fff;
}

/* ─── Utility Classes ─── */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
}

.text-gradient {
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.glass {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-subtle);
}

.glass-strong {
    background: var(--surface-elevated);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--border-medium);
}

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: 12px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--duration-normal) var(--ease-out);
    text-transform: none;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(168, 85, 247, 0.6);
}
.btn-primary:active { transform: translateY(0) scale(0.98); }

.btn-secondary {
    background: var(--dark-700);
    color: var(--dark-100);
    border: 1px solid var(--dark-500);
}
.btn-secondary:hover {
    background: var(--dark-600);
    border-color: var(--primary-600);
}

.btn-ghost {
    background: transparent;
    color: var(--primary-400);
    border: 1px solid var(--border-medium);
}
.btn-ghost:hover {
    background: rgba(168, 85, 247, 0.1);
    border-color: var(--primary-500);
}

.btn-large {
    padding: 16px 40px;
    font-size: 17px;
    border-radius: var(--radius-lg);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-full);
    font-size: 18px;
}

/* ─── Inputs ─── */
.input, .select {
    width: 100%;
    padding: 10px 14px;
    background: var(--dark-800);
    border: 1px solid var(--dark-500);
    border-radius: var(--radius-md);
    color: #fff;
    font-family: var(--font-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--duration-fast);
}
.input:focus, .select:focus {
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

/* ─── Range Slider ─── */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    background: var(--dark-600);
    border-radius: 3px;
    outline: none;
    transition: background var(--duration-fast);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary-500);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
    transition: transform var(--duration-fast);
}
input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--primary-500);
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

/* ─── Badge ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.badge-primary {
    background: rgba(168, 85, 247, 0.15);
    color: var(--primary-400);
    border: 1px solid rgba(168, 85, 247, 0.3);
}
.badge-new {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ─── Toast ─── */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--surface-elevated);
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    opacity: 0;
    transition: all var(--duration-slow) var(--ease-spring);
    z-index: var(--z-toast);
    border: 1px solid var(--border-medium);
    box-shadow: var(--shadow-lg);
}
.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Animations ─── */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

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

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px rgba(168, 85, 247, 0.3); }
    50% { box-shadow: 0 0 40px rgba(168, 85, 247, 0.6); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

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

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

.animate-fade-in { animation: fadeIn 0.6s var(--ease-out) forwards; }
.animate-fade-in-scale { animation: fadeInScale 0.5s var(--ease-spring) forwards; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-glow { animation: glow 3s ease-in-out infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Stagger children */
.stagger-children > * {
    opacity: 0;
    animation: fadeIn 0.5s var(--ease-out) forwards;
}
.stagger-children > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.6s; }

/* ─── Responsive ─── */
@media (max-width: 768px) {
    .container { padding: 0 var(--space-md); }
    .btn-large { padding: 14px 28px; font-size: 15px; }
}
