/* ===== Page Load ===== */
.page-loader {
    position: fixed;
    inset: 0;
    background: #fff;
    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;
    pointer-events: none;
}

.loader-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e9f0fe;
    border-top-color: #124D9E;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Navbar ===== */
.navbar-animate {
    transition: padding 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.navbar-animate.scrolled {
    padding-top: 0.25rem !important;
    padding-bottom: 0.25rem !important;
    box-shadow: 0 4px 20px rgba(18, 77, 158, 0.12) !important;
}

.navbar-animate .nav-link {
    position: relative;
    transition: color 0.3s ease;
}

.navbar-animate .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #124D9E, #00b4d8);
    transition: width 0.3s ease, left 0.3s ease;
    border-radius: 2px;
}

.navbar-animate .nav-link:hover::after,
.navbar-animate .nav-link.active::after {
    width: 100%;
    left: 0;
}

.navbar-brand img {
    transition: transform 0.3s ease;
}

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

/* ===== Hero Carousel Ken Burns ===== */
.carousel-item img {
    transform: scale(1);
    transition: transform 6s ease-out;
}

.carousel-item.active img {
    animation: kenBurns 6s ease-out forwards;
}

@keyframes kenBurns {
    from { transform: scale(1); }
    to { transform: scale(1.08); }
}

/* ===== Section Titles ===== */
.section-title {
    font-weight: 800;
    position: relative;
    display: inline-block;
    margin-bottom: 1rem;
    animation: titleReveal 0.8s ease forwards;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    width: 70px;
    height: 4px;
    background: linear-gradient(90deg, #124D9E, #00b4d8);
    border-radius: 4px;
    transform-origin: center;
    transform: translateX(-50%) scaleX(0);
    animation: underlineGrow 0.8s ease 0.3s forwards;
}

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

@keyframes underlineGrow {
    to { transform: translateX(-50%) scaleX(1); }
}

/* ===== Stat Counter ===== */
.stat-number {
    display: inline-block;
}

.stat-number.counted {
    animation: popIn 0.5s ease;
}

@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    70% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ===== Cards & Icons ===== */
.card-hover,
.value-card,
.contact-card,
.service-block {
    transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.4, 1.1),
                box-shadow 0.4s ease,
                background 0.3s ease;
}

.why-icon {
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
}

.why-item:hover .why-icon {
    transform: rotate(-8deg) scale(1.1);
    background: #124D9E;
    color: white;
}

.why-item:hover .why-icon i {
    color: white !important;
}

.service-card i,
.value-card i {
    transition: transform 0.4s ease;
    display: inline-block;
}

.service-card:hover i,
.value-card:hover i {
    transform: scale(1.2) rotate(5deg);
}

.service-block img {
    transition: transform 0.5s ease;
    border-radius: 16px;
    overflow: hidden;
}

.service-block:hover img {
    transform: scale(1.03);
}

/* ===== Buttons ===== */
.btn-gradient {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.btn-gradient:hover::before {
    left: 100%;
}

.btn-gradient i {
    transition: transform 0.3s ease;
    display: inline-block;
}

.btn-gradient:hover i {
    transform: translateX(4px);
}

/* ===== WhatsApp Pulse ===== */
.whatsapp-float {
    animation: whatsappPulse 2s infinite;
}

@keyframes whatsappPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5); }
    70% { box-shadow: 0 0 0 15px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

/* ===== Footer Links ===== */
.footer a {
    transition: transform 0.2s ease, opacity 0.2s ease;
    display: inline-block;
}

.footer a:hover {
    transform: translateX(5px);
    opacity: 0.85 !important;
}

.footer h4,
.footer h5 {
    transition: letter-spacing 0.3s ease;
}

/* ===== Form Focus ===== */
.form-control:focus,
.form-select:focus {
    border-color: #124D9E;
    box-shadow: 0 0 0 0.2rem rgba(18, 77, 158, 0.15);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

/* ===== Badge Pulse ===== */
.badge-pulse {
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(18, 77, 158, 0.2); }
    50% { box-shadow: 0 0 0 8px rgba(18, 77, 158, 0); }
}

/* ===== Partner Logo Hover ===== */
.partner-img {
    transition: transform 0.4s ease, filter 0.4s ease, opacity 0.4s ease;
}

.partner-img:hover {
    transform: translateY(-5px) scale(1.08);
}

/* ===== Smooth Scroll ===== */
html {
    scroll-behavior: smooth;
}

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

    .page-loader { display: none; }
}
