/* ============================================================
   AVTOMAKTAB PREMIUM - ANIMATIONS LIBRARY
   Professional Animation System | 800+ lines
   ============================================================ */

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

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.04;
    animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb-1 {
    width: 500px;
    height: 500px;
    background: var(--accent-orange);
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-blue);
    bottom: -80px;
    right: -80px;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 350px;
    height: 350px;
    background: var(--accent-purple);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

@keyframes orbFloat {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    25% {
        transform: translate(50px, -30px) scale(1.1);
    }
    50% {
        transform: translate(-20px, 40px) scale(0.9);
    }
    75% {
        transform: translate(-40px, -20px) scale(1.05);
    }
}

/* ===== BACKGROUND GRID ===== */
.bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridShift 30s linear infinite;
}

@keyframes gridShift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* ===== PAGE TRANSITIONS ===== */
@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pageOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-12px);
    }
}

.page-enter {
    animation: pageIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-exit {
    animation: pageOut 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== FADE ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* ===== SLIDE ANIMATIONS ===== */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-up { animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.slide-down { animation: slideDown 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.slide-left { animation: slideLeft 0.5s cubic-bezier(0.4, 0, 0.2, 1); }
.slide-right { animation: slideRight 0.5s cubic-bezier(0.4, 0, 0.2, 1); }

/* ===== SCALE ANIMATIONS ===== */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

.scale-in { animation: scaleIn 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.scale-out { animation: scaleOut 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* ===== BOUNCE ANIMATIONS ===== */
@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        transform: scale(1.08);
    }
    70% {
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.bounce-in {
    animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== SHAKE ANIMATION ===== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.6s ease;
}

/* ===== PULSE ANIMATION ===== */
@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* ===== SPIN ANIMATION ===== */
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.spin {
    animation: spin 1s linear infinite;
}

.spin-slow {
    animation: spin 4s linear infinite;
}

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

.float {
    animation: float 3s ease-in-out infinite;
}

.float-slow {
    animation: float 5s ease-in-out infinite;
}

/* ===== GLOW ANIMATION ===== */
@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(249, 115, 22, 0.3); }
    50% { box-shadow: 0 0 25px rgba(249, 115, 22, 0.6); }
}

.glow {
    animation: glow 2s ease-in-out infinite;
}

@keyframes glowGold {
    0%, 100% { box-shadow: 0 0 5px rgba(251, 191, 36, 0.3); }
    50% { box-shadow: 0 0 25px rgba(251, 191, 36, 0.6); }
}

.glow-gold {
    animation: glowGold 2s ease-in-out infinite;
}

/* ===== RIPPLE EFFECT ===== */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple-effect {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: ripple 0.6s linear;
    pointer-events: none;
}

/* ===== SHIMMER ===== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.shimmer {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 100%);
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

/* ===== TYPING INDICATOR ===== */
@keyframes typingDot {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-8px); }
}

.typing-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
    animation: typingDot 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ===== HEARTBEAT ===== */
@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

/* ===== FLIP ===== */
@keyframes flipIn {
    from {
        transform: perspective(400px) rotateY(90deg);
        opacity: 0;
    }
    to {
        transform: perspective(400px) rotateY(0);
        opacity: 1;
    }
}

.flip-in {
    animation: flipIn 0.6s ease;
    backface-visibility: hidden;
}

/* ===== SWING ===== */
@keyframes swing {
    20% { transform: rotate(15deg); }
    40% { transform: rotate(-10deg); }
    60% { transform: rotate(5deg); }
    80% { transform: rotate(-5deg); }
    100% { transform: rotate(0); }
}

.swing {
    animation: swing 0.8s ease;
    transform-origin: top center;
}

/* ===== WOBBLE ===== */
@keyframes wobble {
    0% { transform: translateX(0); }
    15% { transform: translateX(-25%) rotate(-5deg); }
    30% { transform: translateX(20%) rotate(3deg); }
    45% { transform: translateX(-15%) rotate(-3deg); }
    60% { transform: translateX(10%) rotate(2deg); }
    75% { transform: translateX(-5%) rotate(-1deg); }
    100% { transform: translateX(0); }
}

.wobble {
    animation: wobble 0.8s ease;
}

/* ===== JELLY ===== */
@keyframes jelly {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(0.9, 1.1); }
    50% { transform: scale(1.1, 0.9); }
    75% { transform: scale(0.95, 1.05); }
}

.jelly {
    animation: jelly 0.8s ease;
}

/* ===== POP ===== */
@keyframes pop {
    0% { transform: scale(0); }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.pop {
    animation: pop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== LEVEL UP ===== */
@keyframes levelUp {
    0% {
        transform: scale(1);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.2);
        filter: brightness(1.5);
    }
    100% {
        transform: scale(1);
        filter: brightness(1);
    }
}

.level-up {
    animation: levelUp 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== ACHIEVEMENT UNLOCK ===== */
@keyframes achievementUnlock {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }
    60% {
        transform: scale(1.2) rotate(10deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(0);
        opacity: 1;
    }
}

.achievement-unlock {
    animation: achievementUnlock 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== NOTIFICATION BELL ===== */
@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(-15deg); }
    20%, 40% { transform: rotate(15deg); }
    50% { transform: rotate(0); }
}

.bell-ring {
    animation: bellRing 1s ease-in-out;
    transform-origin: top center;
}

/* ===== COIN DROP ===== */
@keyframes coinDrop {
    0% {
        transform: translateY(-100px) rotate(0);
        opacity: 0;
    }
    60% {
        transform: translateY(10px) rotate(360deg);
        opacity: 1;
    }
    80% {
        transform: translateY(-5px) rotate(540deg);
    }
    100% {
        transform: translateY(0) rotate(720deg);
        opacity: 1;
    }
}

.coin-drop {
    animation: coinDrop 1s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ===== GOLDEN SHINE ===== */
@keyframes goldenShine {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.golden-shine {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(251, 191, 36, 0.3) 50%, 
        transparent 100%);
    background-size: 200% 100%;
    animation: goldenShine 3s ease-in-out infinite;
}

/* ===== NEON FLICKER ===== */
@keyframes neonFlicker {
    0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
        text-shadow: 0 0 7px #fff, 0 0 10px #fff, 0 0 21px #fff, 0 0 42px var(--accent-orange);
    }
    20%, 24%, 55% {
        text-shadow: none;
    }
}

.neon-flicker {
    animation: neonFlicker 2s infinite alternate;
}

/* ===== STAGGERED ENTRANCE ===== */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }
.stagger-6 { animation-delay: 0.3s; }
.stagger-7 { animation-delay: 0.35s; }
.stagger-8 { animation-delay: 0.4s; }
.stagger-9 { animation-delay: 0.45s; }
.stagger-10 { animation-delay: 0.5s; }

/* ===== ANIMATION DURATIONS ===== */
.duration-100 { animation-duration: 0.1s; }
.duration-200 { animation-duration: 0.2s; }
.duration-300 { animation-duration: 0.3s; }
.duration-500 { animation-duration: 0.5s; }
.duration-700 { animation-duration: 0.7s; }
.duration-1000 { animation-duration: 1s; }

/* ===== ANIMATION FILL MODE ===== */
.fill-forwards { animation-fill-mode: forwards; }
.fill-backwards { animation-fill-mode: backwards; }
.fill-both { animation-fill-mode: both; }

/* ===== ANIMATION ITERATION ===== */
.infinite { animation-iteration-count: infinite; }
.once { animation-iteration-count: 1; }
