/* ========================================
   PowerPRF - Premium Animations
   ======================================== */

/* Opening Animation - Spectacular Entry */
.opening-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeOutOpening 0.8s ease 2.5s forwards;
}

.opening-logo {
    font-size: 4rem;
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: scale(0.5);
    animation: logoReveal 1s ease 0.3s forwards;
}

.opening-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: particleFloat 3s ease-in-out infinite;
}

@keyframes logoReveal {
    0% {
        opacity: 0;
        transform: scale(0.5);
        filter: blur(20px);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0);
    }
}

@keyframes fadeOutOpening {
    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    50% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0.5;
    }
}

/* Hero Animations */
.hero-title {
    overflow: hidden;
}

.hero-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(100%);
    animation: slideUp 0.8s ease forwards;
}

.hero-title span:nth-child(1) { animation-delay: 2.8s; }
.hero-title span:nth-child(2) { animation-delay: 2.9s; }
.hero-title span:nth-child(3) { animation-delay: 3.0s; }
.hero-title span:nth-child(4) { animation-delay: 3.1s; }
.hero-title span:nth-child(5) { animation-delay: 3.2s; }

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    opacity: 0;
    animation: fadeInUp 0.8s ease 3.3s forwards;
}

.hero-cta {
    opacity: 0;
    animation: fadeInUp 0.8s ease 3.5s forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Floating Animation */
.float {
    animation: floating 3s ease-in-out infinite;
}

@keyframes floating {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

/* Pulse Glow */
.pulse-glow {
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(124, 58, 237, 0.3);
    }
    50% {
        box-shadow: 0 0 50px rgba(124, 58, 237, 0.6);
    }
}

/* Gradient Animation */
.animated-gradient {
    background-size: 200% 200%;
    animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Stagger Fade In */
.stagger-item {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }

/* Success Animation - Order Sent */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.success-overlay.active {
    opacity: 1;
    visibility: visible;
}

.success-checkmark {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transform: scale(0);
    animation: bounceIn 0.6s ease forwards;
}

.success-checkmark svg {
    width: 60px;
    height: 60px;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.success-checkmark svg path {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: drawCheck 0.5s ease 0.3s forwards;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-text {
    margin-top: 30px;
    font-size: 1.5rem;
    font-weight: 600;
    opacity: 0;
    animation: fadeInUp 0.5s ease 0.6s forwards;
}

.success-subtext {
    color: var(--text-muted);
    opacity: 0;
    animation: fadeInUp 0.5s ease 0.8s forwards;
}

/* Confetti Animation */
.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Ripple Effect */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--bg-glass);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Loading Dots */
.loading-dots {
    display: flex;
    gap: 8px;
}

.loading-dots span {
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(1) { animation-delay: 0s; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-glass) 25%,
        rgba(255, 255, 255, 0.1) 50%,
        var(--bg-glass) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Slide In Animations */
.slide-in-left {
    animation: slideInLeft 0.5s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.5s ease forwards;
}

.slide-in-bottom {
    animation: slideInBottom 0.5s ease forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInBottom {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Scale Animation */
.scale-in {
    animation: scaleIn 0.3s ease forwards;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Shake Animation */
.shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Glow Text Effect */
.glow-text {
    animation: glowText 2s ease-in-out infinite;
}

@keyframes glowText {
    0%, 100% {
        text-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
    }
    50% {
        text-shadow: 0 0 30px rgba(124, 58, 237, 0.8), 0 0 60px rgba(124, 58, 237, 0.4);
    }
}

/* Border Glow */
.border-glow {
    position: relative;
}

.border-glow::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-primary);
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    animation: borderGlow 3s ease infinite;
}

@keyframes borderGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

/* Orbit Animation */
.orbit {
    position: relative;
}

.orbit-item {
    position: absolute;
    animation: orbit 10s linear infinite;
}

@keyframes orbit {
    from { transform: rotate(0deg) translateX(100px) rotate(0deg); }
    to { transform: rotate(360deg) translateX(100px) rotate(-360deg); }
}

/* Typing Animation */
.typing {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid var(--primary);
    animation: 
        typing 3s steps(30) forwards,
        blink 0.5s step-end infinite;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* Background Particles */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.bg-particle {
    position: absolute;
    width: 5px;
    height: 5px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.3;
    animation: floatParticle 15s linear infinite;
}

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 0.3;
    }
    90% {
        opacity: 0.3;
    }
    100% {
        transform: translateY(-100vh) translateX(100px);
        opacity: 0;
    }
}

/* Counter Animation */
.counter {
    font-variant-numeric: tabular-nums;
}

/* Progress Bar Animation */
.progress-bar {
    height: 4px;
    background: var(--bg-glass);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 2px;
    animation: progressFill 2s ease forwards;
}

@keyframes progressFill {
    from { width: 0; }
}

/* Notification Badge Pop */
.badge-pop {
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% { transform: scale(0); }
    70% { transform: scale(1.2); }
    100% { transform: scale(1); }
}
