/* ============================================================
   WYBG – Premium Animation & Design System
   Inspired by Satr/Tuwaiq design language
   Deep purples, smooth animations, clean glassmorphism
   ============================================================ */

/* ── Design Tokens ──────────────────────────────────────── */
:root {
    /* Primary palette - deep purple/navy like Satr */
    --wybg-deep: #061637;
    --wybg-deep-soft: #0A1E4A;
    --wybg-purple: #046b5e;
    --wybg-purple-soft: #0a9988;
    --wybg-violet: #84d5c5;
    --wybg-indigo: #4F46E5;

    /* Accent palette */
    --wybg-emerald: #10B981;
    --wybg-emerald-soft: #34D399;
    --wybg-teal: #2DD4BF;
    --wybg-cyan: #22D3EE;

    /* Surface palette */
    --wybg-surface: #F8FAFC;
    --wybg-surface-dim: #F1F5F9;
    --wybg-surface-card: #FFFFFF;
    --wybg-border: rgba(148, 163, 184, 0.2);
    --wybg-border-light: rgba(148, 163, 184, 0.1);

    /* Text palette */
    --wybg-text: #0F172A;
    --wybg-text-muted: #64748B;
    --wybg-text-light: rgba(255, 255, 255, 0.9);
    --wybg-text-dim: rgba(255, 255, 255, 0.6);

    /* Gradient presets */
    --gradient-hero: linear-gradient(135deg, #061637 0%, #0A1E4A 40%, #122B5E 100%);
    --gradient-purple: linear-gradient(135deg, #046b5e, #0a9988);
    --gradient-card: linear-gradient(135deg, rgba(108, 58, 237, 0.05), rgba(45, 212, 191, 0.05));
    --gradient-emerald: linear-gradient(135deg, #10B981, #2DD4BF);
    --gradient-glow: radial-gradient(ellipse at 50% 0%, rgba(108, 58, 237, 0.15) 0%, transparent 60%);

    /* Animation easings */
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);

    /* Durations */
    --duration-fast: 0.3s;
    --duration-normal: 0.5s;
    --duration-slow: 0.8s;
    --duration-slower: 1.2s;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.1);
    --shadow-xl: 0 24px 48px rgba(15, 23, 42, 0.12);
    --shadow-glow-purple: 0 8px 32px rgba(108, 58, 237, 0.25);
    --shadow-glow-emerald: 0 8px 32px rgba(16, 185, 129, 0.2);
}

/* ── Global Smooth Scroll & Interactive Elements ────────── */
html {
    scroll-behavior: smooth;
}

a, button, input, select, textarea {
    transition: all var(--duration-fast) var(--ease-smooth);
}

/* ── Page Load Animation ────────────────────────────────── */
body {
    animation: pageLoad 0.8s var(--ease-smooth) both;
}

@keyframes pageLoad {
    from { opacity: 0; transform: translateY(12px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ── Scroll-Reveal System ───────────────────────────────── */
[data-reveal] {
    opacity: 0;
    transform: translateY(40px);
    filter: blur(6px);
    transition: opacity var(--duration-slow) var(--ease-smooth),
                transform var(--duration-slow) var(--ease-expo),
                filter var(--duration-slow) var(--ease-smooth);
}
[data-reveal].is-visible {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
}

[data-reveal="left"]          { transform: translateX(-50px) translateY(0); }
[data-reveal="left"].is-visible { transform: none; }

[data-reveal="right"]         { transform: translateX(50px) translateY(0); }
[data-reveal="right"].is-visible { transform: none; }

[data-reveal="scale"]         { transform: scale(0.9); }
[data-reveal="scale"].is-visible { transform: scale(1); }

/* Stagger children */
[data-reveal-stagger] > * {
    opacity: 0;
    transform: translateY(24px);
    filter: blur(4px);
    transition: opacity var(--duration-slow) var(--ease-smooth),
                transform var(--duration-slow) var(--ease-expo),
                filter var(--duration-slow) var(--ease-smooth);
}
[data-reveal-stagger].is-visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: none; filter: blur(0); }
[data-reveal-stagger].is-visible > *:nth-child(2) { transition-delay: 0.1s;  opacity: 1; transform: none; filter: blur(0); }
[data-reveal-stagger].is-visible > *:nth-child(3) { transition-delay: 0.15s; opacity: 1; transform: none; filter: blur(0); }
[data-reveal-stagger].is-visible > *:nth-child(4) { transition-delay: 0.2s;  opacity: 1; transform: none; filter: blur(0); }
[data-reveal-stagger].is-visible > *:nth-child(5) { transition-delay: 0.25s; opacity: 1; transform: none; filter: blur(0); }
[data-reveal-stagger].is-visible > *:nth-child(6) { transition-delay: 0.3s;  opacity: 1; transform: none; filter: blur(0); }
[data-reveal-stagger].is-visible > *:nth-child(7) { transition-delay: 0.35s; opacity: 1; transform: none; filter: blur(0); }
[data-reveal-stagger].is-visible > *:nth-child(8) { transition-delay: 0.4s;  opacity: 1; transform: none; filter: blur(0); }
[data-reveal-stagger].is-visible > *:nth-child(9) { transition-delay: 0.45s; opacity: 1; transform: none; filter: blur(0); }

/* ── Card Hover Effects ─────────────────────────────────── */
.hover-lift {
    transition: transform var(--duration-normal) var(--ease-bounce),
                box-shadow var(--duration-normal) var(--ease-smooth);
}
.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.hover-glow-purple {
    transition: transform var(--duration-normal) var(--ease-bounce),
                box-shadow var(--duration-normal) ease;
}
.hover-glow-purple:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-purple);
}

.hover-glow-emerald {
    transition: transform var(--duration-normal) var(--ease-bounce),
                box-shadow var(--duration-normal) ease;
}
.hover-glow-emerald:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow-emerald);
}

/* ── Button Styles ──────────────────────────────────────── */
.btn-animate {
    position: relative;
    overflow: hidden;
    transition: transform var(--duration-fast) var(--ease-bounce),
                box-shadow var(--duration-fast) ease;
}
.btn-animate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(108, 58, 237, 0.2);
}
.btn-animate:active {
    transform: translateY(0) scale(0.97);
}

/* Shimmer sweep */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}
.btn-shimmer::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}
.btn-shimmer:hover::after { left: 100%; }

/* ── Glassmorphism ──────────────────────────────────────── */
.glass {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.glass-dark {
    background: rgba(19, 8, 47, 0.75);
    backdrop-filter: blur(24px) saturate(1.5);
    -webkit-backdrop-filter: blur(24px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ── Gradient Text ──────────────────────────────────────── */
.text-gradient-purple {
    background: var(--gradient-purple);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient-emerald {
    background: var(--gradient-emerald);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Floating Particles ─────────────────────────────────── */
.particles-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: particleDrift linear infinite;
}

@keyframes particleDrift {
    0%   { opacity: 0; transform: translateY(100%) scale(0); }
    10%  { opacity: 0.5; }
    90%  { opacity: 0.15; }
    100% { opacity: 0; transform: translateY(-100vh) scale(1); }
}

/* ── Orbit Rings (Hero visual) ──────────────────────────── */
.orbit-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(108, 58, 237, 0.12);
    animation: orbitSpin linear infinite;
}
.orbit-ring:nth-child(1) { animation-duration: 25s; }
.orbit-ring:nth-child(2) { animation-duration: 35s; animation-direction: reverse; }
.orbit-ring:nth-child(3) { animation-duration: 20s; }

.orbit-dot {
    position: absolute;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--wybg-purple-soft);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
    top: -3px; left: 50%; margin-left: -3px;
}

@keyframes orbitSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ── Progress Bars ──────────────────────────────────────── */
.progress-animated {
    position: relative;
    overflow: hidden;
}
.progress-animated::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: progressShimmer 2s ease-in-out infinite;
}

@keyframes progressShimmer {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

/* ── Animated Counter ───────────────────────────────────── */
.counter-value.counting {
    animation: counterPop 0.3s var(--ease-bounce);
}

@keyframes counterPop {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.12); }
    100% { transform: scale(1); }
}

/* ── Badge Pulse ────────────────────────────────────────── */
.badge-pulse {
    position: relative;
}
.badge-pulse::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: inherit;
    opacity: 0;
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 0; transform: scale(1); }
    50%      { opacity: 0.35; transform: scale(1.5); }
}

/* ── Animated Underline ─────────────────────────────────── */
.animated-underline {
    position: relative;
    display: inline-block;
}
.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0;
    width: 100%; height: 2px;
    background: var(--gradient-purple);
    border-radius: 2px;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform var(--duration-normal) var(--ease-smooth);
}
.animated-underline:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ── Ripple Effect ──────────────────────────────────────── */
.ripple-effect {
    position: relative;
    overflow: hidden;
}
.ripple-effect .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(108, 58, 237, 0.15);
    transform: scale(0);
    animation: rippleExpand 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleExpand {
    to { transform: scale(4); opacity: 0; }
}

/* ── Sidebar Enhancements ───────────────────────────────── */
.sidebar-enhanced {
    background: linear-gradient(180deg, #ffffff 0%, #faf8ff 100%) !important;
    border-left-color: rgba(108, 58, 237, 0.08) !important;
}

.sidebar-enhanced a {
    position: relative;
    transition: all var(--duration-normal) var(--ease-smooth);
}
.sidebar-enhanced a::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%; transform: translateY(-50%) scaleY(0);
    width: 3px; height: 60%;
    border-radius: 0 4px 4px 0;
    background: var(--gradient-purple);
    transition: transform var(--duration-normal) var(--ease-spring);
}
.sidebar-enhanced a:hover::before {
    transform: translateY(-50%) scaleY(1);
}
.sidebar-enhanced a:hover {
    background: rgba(108, 58, 237, 0.04) !important;
}
.sidebar-enhanced a:hover .material-symbols-outlined {
    transform: scale(1.1);
    color: var(--wybg-purple) !important;
}
.sidebar-enhanced a .material-symbols-outlined {
    transition: transform var(--duration-normal) var(--ease-bounce),
                color var(--duration-fast) ease;
}

/* ── Premium Footer ─────────────────────────────────────── */
.premium-footer {
    background: var(--gradient-hero);
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}
.premium-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--wybg-purple), var(--wybg-violet), var(--wybg-purple), transparent);
}
.premium-footer::after {
    content: '';
    position: absolute;
    bottom: -50%; left: -20%;
    width: 140%; height: 100%;
    background: radial-gradient(ellipse at center, rgba(108, 58, 237, 0.06) 0%, transparent 70%);
    pointer-events: none;
}
.footer-link {
    transition: color var(--duration-fast) ease;
}
.footer-link:hover {
    color: var(--wybg-violet);
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--wybg-purple), var(--wybg-deep));
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--wybg-violet), var(--wybg-purple));
}

/* ── Selection ──────────────────────────────────────────── */
::selection {
    background: rgba(108, 58, 237, 0.2);
    color: var(--wybg-deep);
}

/* ── Reduced Motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    [data-reveal], [data-reveal-stagger] > * {
        opacity: 1 !important;
        transform: none !important;
    }
    html { scroll-behavior: auto; }
}
