﻿/* ============================================
   UTILITIES - Loader, Animations, Floating Buttons
   ============================================ */

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-green), #4a7c43);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.loader-logo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
    margin-bottom: 2rem;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loader-text {
    color: white;
    font-size: 1.2rem;
    margin-top: 1.5rem;
    animation: fadeInOut 1.5s infinite;
}

/* Keyframe Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

@keyframes fadeInOut {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

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

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

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

.reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Staggered animation delays */
.reveal-delay-1 {
    transition-delay: 0.1s;
}

.reveal-delay-2 {
    transition-delay: 0.2s;
}

.reveal-delay-3 {
    transition-delay: 0.3s;
}

.reveal-delay-4 {
    transition-delay: 0.4s;
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    bottom: 40px;
    left: 40px;
    background: var(--whatsapp-green);
    color: white;
    width: 65px;
    height: 65px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
    z-index: 1000;
    transition: var(--transition-bounce);
    animation: bounce 2s infinite;
}

.whatsapp-float:hover {
    transform: scale(1.15) rotate(10deg);
    box-shadow: 0 15px 40px rgba(37, 211, 102, 0.5);
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 55px;
    height: 55px;
    background: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-bounce);
    box-shadow: var(--shadow-md);
    border: 2px solid white;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-10px);
    background: var(--primary-gold);
    box-shadow: var(--shadow-lg);
}

/* Custom Cursor */
.custom-cursor {
    width: 20px;
    height: 20px;
    background: var(--primary-gold);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: difference;
    transition: transform 0.15s ease;
    transform: translate(-50%, -50%);
}

/* Section Dividers */
.section-divider {
    width: 100%;
    height: 100px;
    background: white;
    position: relative;
    z-index: 1;
}

.curve-down {
    clip-path: ellipse(70% 100% at 50% 0%);
}

.curve-up {
    clip-path: ellipse(70% 100% at 50% 100%);
}

/* Responsive */
@media (max-width: 768px) {
    .whatsapp-float {
        width: 55px;
        height: 55px;
        font-size: 2rem;
        bottom: 25px;
        left: 25px;
    }

    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 90px;
        right: 20px;
        font-size: 1.2rem;
    }
}
