/* ========================================
   ONIRICA — Animations
   ======================================== */

/* ===== KEYFRAMES ===== */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-12px); }
}

@keyframes float-slow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(5deg); }
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px var(--primary-glow); }
    50% { box-shadow: 0 0 40px var(--primary-glow), 0 0 80px rgba(108, 99, 255, 0.15); }
}

@keyframes glow-text {
    0%, 100% { text-shadow: 0 0 20px rgba(108, 99, 255, 0.5); }
    50% { text-shadow: 0 0 40px rgba(108, 99, 255, 0.8), 0 0 80px rgba(108, 99, 255, 0.3); }
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes loading-bar {
    0% { width: 0%; }
    30% { width: 40%; }
    70% { width: 75%; }
    100% { width: 100%; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-up {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-down {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fade-left {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fade-right {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scale-in {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes slide-in-right {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slide-out-right {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

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

@keyframes star-twinkle {
    0%, 100% { opacity: 0.2; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes aurora {
    0%, 100% { transform: translateX(-20%) skewX(-5deg); opacity: 0.3; }
    33% { transform: translateX(5%) skewX(5deg); opacity: 0.5; }
    66% { transform: translateX(-10%) skewX(0deg); opacity: 0.4; }
}

@keyframes aurora-2 {
    0%, 100% { transform: translateX(10%) skewX(5deg); opacity: 0.2; }
    50% { transform: translateX(-15%) skewX(-5deg); opacity: 0.4; }
}

@keyframes pulse-recording {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 0 15px rgba(239, 68, 68, 0); }
}

@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(1.4); opacity: 0; }
}

@keyframes waveform {
    0% { height: 4px; }
    100% { height: 32px; }
}

@keyframes orbit {
    from { transform: rotate(0deg) translateX(80px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

@keyframes gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes number-count {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes page-enter {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== ANIMATION UTILITY CLASSES ===== */
.animate-fade-in { animation: fade-in 0.5s ease-out forwards; }
.animate-fade-up { animation: fade-up 0.6s ease-out forwards; }
.animate-fade-down { animation: fade-down 0.6s ease-out forwards; }
.animate-fade-left { animation: fade-left 0.6s ease-out forwards; }
.animate-fade-right { animation: fade-right 0.6s ease-out forwards; }
.animate-scale-in { animation: scale-in 0.4s var(--transition-spring) forwards; }
.animate-float { animation: float 4s ease-in-out infinite; }
.animate-glow { animation: glow-pulse 3s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; }
.animate-page-enter { animation: page-enter 0.5s ease-out forwards; }

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }

/* ===== STAR FIELD ===== */
.star-field {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.star {
    position: absolute;
    border-radius: 50%;
    background: white;
    animation: star-twinkle var(--duration, 3s) ease-in-out var(--delay, 0s) infinite;
}

/* ===== AURORA BACKGROUND ===== */
.aurora-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.aurora-layer {
    position: absolute;
    width: 150%;
    height: 60%;
    top: -10%;
    left: -25%;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
}

.aurora-1 {
    background: radial-gradient(ellipse, #6c63ff 0%, transparent 70%);
    animation: aurora 15s ease-in-out infinite;
}

.aurora-2 {
    background: radial-gradient(ellipse, #22d3ee 0%, transparent 70%);
    animation: aurora-2 18s ease-in-out infinite;
    top: 30%;
}

.aurora-3 {
    background: radial-gradient(ellipse, #a78bfa 0%, transparent 70%);
    animation: aurora 22s ease-in-out infinite reverse;
    top: 50%;
}

/* ===== SHIMMER EFFECT ===== */
.shimmer {
    background: linear-gradient(
        90deg,
        var(--bg-surface) 0%,
        var(--bg-surface-hover) 50%,
        var(--bg-surface) 100%
    );
    background-size: 2000px 100%;
    animation: shimmer 2s infinite linear;
}

/* ===== HOVER EFFECTS ===== */
.hover-lift {
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}
.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.hover-glow {
    transition: box-shadow var(--transition-base);
}
.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

.hover-scale {
    transition: transform var(--transition-fast);
}
.hover-scale:hover {
    transform: scale(1.05);
}

/* ===== SPINNING LOADER ===== */
.spinner {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-default);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
.spinner-sm { width: 16px; height: 16px; }
.spinner-lg { width: 40px; height: 40px; border-width: 3px; }

/* ===== PARTICLE DOTS ===== */
.dots-loader {
    display: flex;
    gap: 6px;
    align-items: center;
}
.dots-loader span {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    animation: float 0.8s ease-in-out infinite;
}
.dots-loader span:nth-child(2) { animation-delay: 0.15s; }
.dots-loader span:nth-child(3) { animation-delay: 0.3s; }

/* ===== GRADIENT ANIMATION ===== */
.gradient-animated {
    background-size: 200% 200%;
    animation: gradient-shift 4s ease infinite;
}

/* ===== TRANSITIONS ===== */
.transition-all { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
