/* =====================================================
   ClassReward - Premium Landing Page
   Animations & Transitions
   ===================================================== */

/* =====================================================
   FLOATING DASHBOARD ANIMATION
   ===================================================== */
@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotateX(0deg);
    }
    50% {
        transform: translateY(-20px) rotateX(2deg);
    }
}

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

/* Parallax effect on scroll */
.parallax-float {
    transition: transform 0.3s ease-out;
}

/* =====================================================
   FADE IN ANIMATIONS
   ===================================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

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

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

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

/* Applied animation classes */
.fade-in-up {
    opacity: 0;
    animation: fadeInUp 0.8s ease forwards;
}

.fade-in-down {
    opacity: 0;
    animation: fadeInDown 0.8s ease forwards;
}

.fade-in-left {
    opacity: 0;
    animation: fadeInLeft 0.8s ease forwards;
}

.fade-in-right {
    opacity: 0;
    animation: fadeInRight 0.8s ease forwards;
}

.fade-in {
    opacity: 0;
    animation: fadeIn 0.6s ease forwards;
}

.scale-in {
    opacity: 0;
    animation: scaleIn 0.6s ease forwards;
}

/* Staggered animations for lists */
.fade-in-up:nth-child(1) { animation-delay: 0s; }
.fade-in-up:nth-child(2) { animation-delay: 0.1s; }
.fade-in-up:nth-child(3) { animation-delay: 0.2s; }
.fade-in-up:nth-child(4) { animation-delay: 0.3s; }
.fade-in-up:nth-child(5) { animation-delay: 0.4s; }
.fade-in-up:nth-child(6) { animation-delay: 0.5s; }

/* =====================================================
   SCROLL ANIMATIONS
   ===================================================== */
.scroll-reveal {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.scroll-reveal-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* =====================================================
   HOVER EFFECTS
   ===================================================== */
.hover-lift {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(69, 227, 198, 0.3);
}

.hover-scale {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* =====================================================
   BUTTON RIPPLE EFFECT
   ===================================================== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    pointer-events: none;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    opacity: 0;
    transition: transform 0.6s, opacity 0.6s;
}

.ripple:active::after {
    transform: translate(-50%, -50%) scale(2);
    opacity: 1;
    transition: 0s;
}

/* Alternative ripple with JavaScript */
.ripple-effect {
    position: relative;
    overflow: hidden;
}

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

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* =====================================================
   GRADIENT ANIMATION
   ===================================================== */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.animated-gradient {
    background: linear-gradient(135deg, #45E3C6, #3BC4A8, #667eea, #45E3C6);
    background-size: 300% 300%;
    animation: gradientShift 8s ease infinite;
}

/* =====================================================
   LOADING ANIMATIONS
   ===================================================== */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.05);
    }
}

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

/* =====================================================
   STAGGER ANIMATION DELAYS
   ===================================================== */
.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }
.stagger-5 { animation-delay: 0.5s; }
.stagger-6 { animation-delay: 0.6s; }

/* =====================================================
   INTERACTIVE CARD EFFECTS
   ===================================================== */
.card-3d {
    perspective: 1000px;
}

.card-3d-inner {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform-style: preserve-3d;
}

.card-3d:hover .card-3d-inner {
    transform: rotateY(10deg) rotateX(5deg);
}

/* =====================================================
   CHART ANIMATIONS
   ===================================================== */
@keyframes growUp {
    from {
        transform: scaleY(0);
        transform-origin: bottom;
    }
    to {
        transform: scaleY(1);
        transform-origin: bottom;
    }
}

.chart-bar {
    animation: growUp 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    transform-origin: bottom;
}

.chart-bar:nth-child(1) { animation-delay: 0.1s; }
.chart-bar:nth-child(2) { animation-delay: 0.2s; }
.chart-bar:nth-child(3) { animation-delay: 0.3s; }
.chart-bar:nth-child(4) { animation-delay: 0.4s; }
.chart-bar:nth-child(5) { animation-delay: 0.5s; }
.chart-bar:nth-child(6) { animation-delay: 0.6s; }
.chart-bar:nth-child(7) { animation-delay: 0.7s; }

/* Pie chart animation */
@keyframes fillPie {
    from {
        stroke-dashoffset: 251.33;
    }
    to {
        stroke-dashoffset: 0;
    }
}

.pie-svg circle {
    animation: fillPie 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* =====================================================
   HERO ANIMATIONS
   ===================================================== */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.hero-content > * {
    animation: slideInLeft 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
}

.hero-content > *:nth-child(1) { animation-delay: 0.2s; }
.hero-content > *:nth-child(2) { animation-delay: 0.4s; }
.hero-content > *:nth-child(3) { animation-delay: 0.6s; }

.hero-visual > * {
    animation: slideInRight 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    animation-delay: 0.3s;
}

/* =====================================================
   MOCKUP ELEMENT ANIMATIONS
   ===================================================== */
@keyframes floatElement {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.mockup-stats .stat-card:nth-child(1) {
    animation: floatElement 4s ease-in-out infinite;
    animation-delay: 0s;
}

.mockup-stats .stat-card:nth-child(2) {
    animation: floatElement 4s ease-in-out infinite;
    animation-delay: 0.5s;
}

.mockup-stats .stat-card:nth-child(3) {
    animation: floatElement 4s ease-in-out infinite;
    animation-delay: 1s;
}

/* =====================================================
   NUMERAL COUNT UP ANIMATION
   ===================================================== */
.count-up {
    display: inline-block;
}

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

/* =====================================================
   PROGRESS BAR ANIMATION
   ===================================================== */
@keyframes fillProgress {
    from {
        width: 0;
    }
    to {
        width: var(--progress-width);
    }
}

.progress-bar {
    animation: fillProgress 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* =====================================================
   TEXT HIGHLIGHT ANIMATION
   ===================================================== */
@keyframes highlight {
    0% {
        background-size: 0 100%;
    }
    100% {
        background-size: 100% 100%;
    }
}

.text-highlight {
    background: linear-gradient(135deg, rgba(69, 227, 198, 0.2), rgba(69, 227, 198, 0.2));
    background-size: 0 100%;
    background-repeat: no-repeat;
    animation: highlight 1s ease forwards;
    animation-delay: 1s;
}

/* =====================================================
   SOCIAL PROOF ANIMATION
   ===================================================== */
@keyframes floatIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notification-bubble {
    animation: floatIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* =====================================================
   REDUCED MOTION SUPPORT
   ===================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .floating {
        animation: none;
    }

    .fade-in-up,
    .fade-in-down,
    .fade-in-left,
    .fade-in-right,
    .fade-in,
    .scale-in {
        opacity: 1;
        transform: none;
        animation: none;
    }

    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* =====================================================
   CUSTOM CURSOR (Optional - can be enabled)
   ===================================================== */
.custom-cursor {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.15s ease, opacity 0.15s ease;
    mix-blend-mode: difference;
}

.custom-cursor.active {
    transform: scale(1.5);
    background: rgba(69, 227, 198, 0.3);
}

.cursor-dot {
    width: 6px;
    height: 6px;
    background: var(--color-accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
}

/* =====================================================
   SMOOTH SCROLL INDICATOR
   ===================================================== */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

.scroll-indicator {
    animation: bounce 2s infinite;
}

/* =====================================================
   GLASSMORPHISM ENTRANCE
   ===================================================== */
@keyframes glassEntrance {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(20px);
    }
}

.glass-card {
    animation: glassEntrance 0.8s ease forwards;
}

/* =====================================================
   TESTIMONIAL CARD HOVER
   ===================================================== */
.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.testimonial-card:hover::before {
    opacity: 1;
}

/* =====================================================
   PRICING CARD SPECIAL EFFECT
   ===================================================== */
.pricing-popular::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark), var(--color-accent));
    background-size: 200% 200%;
    animation: gradientShift 4s ease infinite;
    z-index: -1;
    opacity: 0.3;
}

/* =====================================================
   MOBILE MENU ANIMATION
   ===================================================== */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.navbar-collapse.show .navbar-nav {
    animation: slideDown 0.3s ease forwards;
}

.navbar-collapse.show .navbar-nav .nav-item {
    opacity: 0;
    animation: fadeInUp 0.3s ease forwards;
}

.navbar-collapse.show .navbar-nav .nav-item:nth-child(1) { animation-delay: 0.1s; }
.navbar-collapse.show .navbar-nav .nav-item:nth-child(2) { animation-delay: 0.2s; }
.navbar-collapse.show .navbar-nav .nav-item:nth-child(3) { animation-delay: 0.3s; }
.navbar-collapse.show .navbar-nav .nav-item:nth-child(4) { animation-delay: 0.4s; }
.navbar-collapse.show .navbar-nav .nav-item:nth-child(5) { animation-delay: 0.5s; }

/* =====================================================
   UTILITY ANIMATION CLASSES
   ===================================================== */
.animate-on-scroll {
    opacity: 0;
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.is-visible {
    opacity: 1;
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }
.delay-500 { transition-delay: 500ms; }

/* Duration utilities */
.duration-300 { transition-duration: 300ms; }
.duration-500 { transition-duration: 500ms; }
.duration-700 { transition-duration: 700ms; }
.duration-1000 { transition-duration: 1000ms; }
