/**
 * Rise Studio - Animation Stylesheet
 * GSAP, AOS, and Custom Animations
 */

/* ============================================
   PAGE LOAD ANIMATIONS
   ============================================ */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--dark-navy);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-content {
    text-align: center;
}

.loader-logo {
    font-family: var(--font-primary);
    font-size: 3rem;
    font-weight: 800;
    color: var(--white);
    animation: fadeInUp 0.8s ease forwards;
}

.loader-logo span {
    color: var(--primary-teal);
}

.loader-bar {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 2rem;
    overflow: hidden;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-teal), var(--coral-orange));
    animation: loadProgress 1.5s ease forwards;
}

@keyframes loadProgress {
    0% { width: 0%; }
    100% { width: 100%; }
}

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

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-scale.active {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delays */
.stagger-1 { transition-delay: 0.1s; }
.stagger-2 { transition-delay: 0.2s; }
.stagger-3 { transition-delay: 0.3s; }
.stagger-4 { transition-delay: 0.4s; }
.stagger-5 { transition-delay: 0.5s; }
.stagger-6 { transition-delay: 0.6s; }

/* ============================================
   HOVER ANIMATIONS
   ============================================ */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.hover-scale {
    transition: transform 0.3s ease;
}

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

.hover-rotate {
    transition: transform 0.5s ease;
}

.hover-rotate:hover {
    transform: rotate(360deg);
}

.hover-shine {
    position: relative;
    overflow: hidden;
}

.hover-shine::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.hover-shine:hover::before {
    left: 100%;
}

/* ============================================
   TEXT ANIMATIONS
   ============================================ */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    animation: textReveal 0.8s ease forwards;
}

@keyframes textReveal {
    to {
        transform: translateY(0);
    }
}

.typing-effect {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-teal);
    animation: typing 3s steps(40) forwards, blink 0.75s step-end infinite;
    width: 0;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    50% { border-color: transparent; }
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */
.counter {
    font-variant-numeric: tabular-nums;
}

/* ============================================
   PARALLAX EFFECTS
   ============================================ */
.parallax-container {
    overflow: hidden;
    position: relative;
}

.parallax-bg {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 140%;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

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

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

@keyframes floatHorizontal {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(20px);
    }
}

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

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

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

/* ============================================
   ROTATING ANIMATIONS
   ============================================ */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

.rotating {
    animation: rotate 10s linear infinite;
}

.rotating-slow {
    animation: rotate 20s linear infinite;
}

.rotating-fast {
    animation: rotate 5s linear infinite;
}

/* ============================================
   PULSE ANIMATIONS
   ============================================ */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.1);
        opacity: 0.8;
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

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

.pulse-ring {
    position: relative;
}

.pulse-ring::before,
.pulse-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--primary-teal);
    transform: translate(-50%, -50%);
    animation: pulseRing 2s ease-out infinite;
}

.pulse-ring::after {
    animation-delay: 1s;
}

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

.shake {
    animation: shake 0.5s ease-in-out;
}

/* ============================================
   BOUNCE ANIMATIONS
   ============================================ */
@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

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

.bounce-in {
    animation: bounceIn 0.8s ease forwards;
}

/* ============================================
   FLIP ANIMATIONS
   ============================================ */
@keyframes flip {
    0% {
        transform: perspective(400px) rotateY(0);
    }
    100% {
        transform: perspective(400px) rotateY(360deg);
    }
}

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

/* ============================================
   SLIDE 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);
    }
}

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

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

.slide-in-left {
    animation: slideInLeft 0.6s ease forwards;
}

.slide-in-right {
    animation: slideInRight 0.6s ease forwards;
}

.slide-in-up {
    animation: slideInUp 0.6s ease forwards;
}

.slide-in-down {
    animation: slideInDown 0.6s ease forwards;
}

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

.animated-gradient {
    background: linear-gradient(-45deg, var(--primary-teal), var(--secondary-blue), var(--coral-orange), var(--cream-gold));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* ============================================
   WAVE ANIMATIONS
   ============================================ */
@keyframes wave {
    0%, 100% {
        d: path("M0,50 Q250,0 500,50 T1000,50 L1000,100 L0,100 Z");
    }
    50% {
        d: path("M0,50 Q250,100 500,50 T1000,50 L1000,100 L0,100 Z");
    }
}

.wave-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave-container svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 150px;
}

/* ============================================
   PARTICLE ANIMATIONS
   ============================================ */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    animation: particleFloat 15s infinite;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   MORPHING ANIMATIONS
   ============================================ */
@keyframes morph {
    0%, 100% {
        border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
    }
    50% {
        border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%;
    }
}

.morphing {
    animation: morph 8s ease-in-out infinite;
}

/* ============================================
   GLITCH EFFECT
   ============================================ */
@keyframes glitch {
    0% {
        clip-path: inset(40% 0 61% 0);
        transform: translate(-2px, 2px);
    }
    20% {
        clip-path: inset(92% 0 1% 0);
        transform: translate(2px, -2px);
    }
    40% {
        clip-path: inset(43% 0 1% 0);
        transform: translate(-2px, 2px);
    }
    60% {
        clip-path: inset(25% 0 58% 0);
        transform: translate(2px, -2px);
    }
    80% {
        clip-path: inset(54% 0 7% 0);
        transform: translate(-2px, 2px);
    }
    100% {
        clip-path: inset(58% 0 43% 0);
        transform: translate(2px, -2px);
    }
}

.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch 2s infinite linear alternate-reverse;
    color: #ff00ff;
    z-index: -1;
}

.glitch::after {
    animation: glitch 3s infinite linear alternate-reverse;
    color: #00ffff;
    z-index: -2;
}

/* ============================================
   NEON GLOW EFFECT
   ============================================ */
.neon-glow {
    text-shadow: 
        0 0 5px var(--primary-teal),
        0 0 10px var(--primary-teal),
        0 0 20px var(--primary-teal),
        0 0 40px var(--primary-teal);
}

/* ============================================
   UNDERLINE ANIMATIONS
   ============================================ */
.animated-underline {
    position: relative;
    display: inline-block;
}

.animated-underline::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-teal), var(--coral-orange));
    transition: width 0.3s ease;
}

.animated-underline:hover::after {
    width: 100%;
}

/* ============================================
   CARD FLIP ANIMATION
   ============================================ */
.flip-card {
    perspective: 1000px;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
}

.flip-card-back {
    transform: rotateY(180deg);
}

/* ============================================
   MAGNETIC BUTTON EFFECT
   ============================================ */
.magnetic-btn {
    transition: transform 0.2s ease;
}

/* ============================================
   SCROLL INDICATOR
   ============================================ */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    animation: bounce 2s infinite;
}

.scroll-indicator span {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.scroll-indicator i {
    font-size: 1.5rem;
}

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

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(15, 163, 177, 0.3);
    border-top-color: var(--primary-teal);
    border-radius: 50%;
    animation: spinner 1s linear infinite;
}

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

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius);
}

/* ============================================
   AOS CUSTOM ANIMATIONS
   ============================================ */
[data-aos="fade-up-sm"] {
    opacity: 0;
    transform: translateY(20px);
    transition-property: opacity, transform;
}

[data-aos="fade-up-sm"].aos-animate {
    opacity: 1;
    transform: translateY(0);
}

[data-aos="fade-in-scale"] {
    opacity: 0;
    transform: scale(0.9);
    transition-property: opacity, transform;
}

[data-aos="fade-in-scale"].aos-animate {
    opacity: 1;
    transform: scale(1);
}

[data-aos="slide-in-left"] {
    opacity: 0;
    transform: translateX(-50px);
    transition-property: opacity, transform;
}

[data-aos="slide-in-left"].aos-animate {
    opacity: 1;
    transform: translateX(0);
}

[data-aos="slide-in-right"] {
    opacity: 0;
    transform: translateX(50px);
    transition-property: opacity, transform;
}

[data-aos="slide-in-right"].aos-animate {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@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;
    }
    
    .parallax-bg {
        transform: none !important;
    }
    
    .floating,
    .floating-slow,
    .floating-fast,
    .rotating,
    .rotating-slow,
    .rotating-fast,
    .pulsing,
    .bouncing {
        animation: none !important;
    }
}