/*
 * MVK REFORMS - Premium Visual Effects
 * Version: 2.0
 * Advanced animations, particles, glassmorphism, 3D effects
 */

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

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

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

.loader-logo {
    font-family: var(--font-display);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    animation: pulse-glow 2s ease-in-out infinite;
}

.loader-logo span {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loader-bar {
    width: 200px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.loader-progress {
    width: 0%;
    height: 100%;
    background: var(--gradient-gold);
    border-radius: 10px;
    animation: loading 2s ease-out forwards;
}

@keyframes loading {
    0% {
        width: 0%;
    }

    50% {
        width: 60%;
    }

    80% {
        width: 85%;
    }

    100% {
        width: 100%;
    }
}

@keyframes pulse-glow {

    0%,
    100% {
        text-shadow: 0 0 20px rgba(201, 162, 39, 0.3);
    }

    50% {
        text-shadow: 0 0 40px rgba(201, 162, 39, 0.6), 0 0 80px rgba(201, 162, 39, 0.3);
    }
}

/* ========================================
   PARTICLE BACKGROUND SYSTEM
======================================== */
.particles-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 12px;
    height: 12px;
    background: var(--gold);
    border-radius: 50%;
    opacity: 0;
    animation: float-particle 15s infinite linear;
    box-shadow:
        0 0 10px var(--gold),
        0 0 20px var(--gold),
        0 0 30px rgba(201, 162, 39, 0.6),
        0 0 50px rgba(201, 162, 39, 0.4);
}

.particle:nth-child(1) {
    left: 5%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.particle:nth-child(2) {
    left: 15%;
    animation-delay: 2s;
    animation-duration: 22s;
}

.particle:nth-child(3) {
    left: 25%;
    animation-delay: 4s;
    animation-duration: 28s;
}

.particle:nth-child(4) {
    left: 35%;
    animation-delay: 1s;
    animation-duration: 24s;
}

.particle:nth-child(5) {
    left: 45%;
    animation-delay: 3s;
    animation-duration: 26s;
}

.particle:nth-child(6) {
    left: 55%;
    animation-delay: 5s;
    animation-duration: 23s;
}

.particle:nth-child(7) {
    left: 65%;
    animation-delay: 2.5s;
    animation-duration: 27s;
}

.particle:nth-child(8) {
    left: 75%;
    animation-delay: 1.5s;
    animation-duration: 21s;
}

.particle:nth-child(9) {
    left: 85%;
    animation-delay: 0.5s;
    animation-duration: 29s;
}

.particle:nth-child(10) {
    left: 95%;
    animation-delay: 3.5s;
    animation-duration: 25s;
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }

    5% {
        opacity: 0.8;
    }

    50% {
        transform: translateY(50vh) translateX(30px) scale(1.2);
        opacity: 0.6;
    }

    95% {
        opacity: 0.3;
    }

    100% {
        transform: translateY(-20vh) translateX(-30px) scale(0.5);
        opacity: 0;
    }
}

/* ========================================
   ANIMATED NEON GLOW EFFECTS
======================================== */
.neon-glow {
    position: relative;
    animation: neon-brightness 3s ease-in-out infinite alternate;
}

/* For gradient text, we use a glowing pseudo-element behind */
.highlight.neon-glow::before {
    content: attr(data-i18n);
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: blur(8px);
    opacity: 0.7;
    z-index: -1;
    animation: glow-pulse 2s ease-in-out infinite alternate;
}

/* For non-gradient text with neon glow */
.stat-number.neon-glow {
    color: var(--gold);
    text-shadow:
        0 0 5px var(--gold),
        0 0 10px var(--gold),
        0 0 20px rgba(201, 162, 39, 0.5);
    animation: stat-glow 2s ease-in-out infinite alternate;
}

@keyframes neon-brightness {
    0% {
        filter: brightness(1);
    }

    100% {
        filter: brightness(1.15);
    }
}

@keyframes glow-pulse {
    0% {
        filter: blur(6px);
        opacity: 0.5;
    }

    100% {
        filter: blur(12px);
        opacity: 0.9;
    }
}

@keyframes stat-glow {
    0% {
        text-shadow:
            0 0 5px var(--gold),
            0 0 10px var(--gold),
            0 0 20px rgba(201, 162, 39, 0.5);
    }

    100% {
        text-shadow:
            0 0 10px var(--gold),
            0 0 20px var(--gold),
            0 0 40px var(--gold),
            0 0 60px rgba(201, 162, 39, 0.3);
    }
}

.neon-border {
    position: relative;
}

.neon-border::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(45deg, var(--gold), transparent, var(--gold));
    border-radius: inherit;
    z-index: -1;
    animation: neon-rotate 3s linear infinite;
}

@keyframes neon-rotate {
    0% {
        filter: hue-rotate(0deg);
    }

    100% {
        filter: hue-rotate(30deg);
    }
}

/* Gold shimmer effect for headers */
.highlight {
    position: relative;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s ease-in-out infinite;
    background-size: 200% 100%;
}

@keyframes shimmer {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ========================================
   GLASSMORPHISM COMPONENTS
======================================== */
.glass-card {
    background: rgba(26, 26, 26, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-card-gold {
    background: rgba(201, 162, 39, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(201, 162, 39, 0.3);
    border-radius: var(--border-radius-lg);
    box-shadow:
        0 8px 32px rgba(201, 162, 39, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.glass-nav {
    background: rgba(10, 10, 10, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* ========================================
   3D CARD PARALLAX EFFECTS
======================================== */
.card-3d {
    perspective: 1000px;
    transform-style: preserve-3d;
}

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

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

/* Enhanced service card with 3D effect */
.service-card {
    perspective: 1000px;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.service-card:hover {
    transform: translateY(-15px) rotateX(5deg);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(201, 162, 39, 0.1);
}

.service-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg,
            rgba(201, 162, 39, 0) 0%,
            rgba(201, 162, 39, 0.1) 50%,
            rgba(201, 162, 39, 0) 100%);
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.service-card:hover::after {
    opacity: 1;
}

/* ========================================
   TYPING ANIMATION
======================================== */
.typing-text {
    overflow: hidden;
    border-right: 3px solid var(--gold);
    white-space: nowrap;
    animation:
        typing 3s steps(30, end) forwards,
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--gold);
    }
}

/* Typing cursor that stops after animation */
.typing-complete {
    border-right: none;
    animation: typing 3s steps(30, end) forwards;
}

/* ========================================
   SMOOTH PAGE TRANSITIONS
======================================== */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    z-index: 10000;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.65, 0, 0.35, 1);
}

.page-transition.active {
    transform: translateY(0);
}

.page-transition.exit {
    transform: translateY(-100%);
}

/* ========================================
   ENHANCED SCROLL ANIMATIONS
======================================== */
.fade-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

.fade-in {
    opacity: 0;
    transition: opacity 1s ease;
}

.fade-in.visible {
    opacity: 1;
}

.slide-left {
    opacity: 0;
    transform: translateX(-100px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.slide-right {
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

.rotate-in {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.rotate-in.visible {
    opacity: 1;
    transform: rotate(0) scale(1);
}

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

.stagger-7 {
    transition-delay: 0.7s;
}

.stagger-8 {
    transition-delay: 0.8s;
}

/* ========================================
   BUTTON HOVER EFFECTS
======================================== */
.btn-primary {
    position: relative;
    overflow: hidden;
    z-index: 1;
}

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

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

.btn-outline {
    position: relative;
    overflow: hidden;
}

.btn-outline::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: all 0.4s ease;
    transform: translateX(-50%);
}

.btn-outline:hover::after {
    width: 60%;
}

/* Magnetic button effect (requires JS) */
.btn-magnetic {
    transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ========================================
   FLOATING CTA ENHANCEMENTS
======================================== */
.floating-cta {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 999;
}

.float-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    animation: float-bounce 3s ease-in-out infinite;
}

.float-whatsapp {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    animation-delay: 0s;
}

.float-phone {
    background: var(--gradient-gold);
    animation-delay: 0.5s;
}

.float-btn:hover {
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

@keyframes float-bounce {

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

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

/* Pulse ring effect */
.float-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: pulse-ring 2s ease-out infinite;
}

.float-whatsapp::before {
    border-color: #25D366;
}

.float-phone::before {
    border-color: var(--gold);
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ========================================
   STATS COUNTER ANIMATION
======================================== */
.stat-number {
    display: inline-block;
    transition: all 0.3s ease;
}

.stat-number.counting {
    animation: count-pulse 0.1s ease;
}

@keyframes count-pulse {

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

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

/* ========================================
   HERO ENHANCEMENTS
======================================== */
.hero {
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 200px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    z-index: 1;
    pointer-events: none;
}

/* Animated gradient border */
.hero-content {
    position: relative;
}

.hero h1 {
    line-height: 1.1;
}

/* ========================================
   SECTION DIVIDERS
======================================== */
.section-divider {
    position: relative;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            var(--gold),
            transparent);
    margin: 4rem auto;
    max-width: 200px;
    animation: divider-glow 2s ease-in-out infinite;
}

@keyframes divider-glow {

    0%,
    100% {
        box-shadow: 0 0 10px var(--gold-glow);
        opacity: 0.7;
    }

    50% {
        box-shadow: 0 0 30px var(--gold-glow);
        opacity: 1;
    }
}

/* ========================================
   TESTIMONIAL CARD EFFECTS
======================================== */
.test-card {
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    overflow: hidden;
}

.test-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle,
            rgba(201, 162, 39, 0.1) 0%,
            transparent 50%);
    opacity: 0;
    transition: opacity 0.5s ease;
}

.test-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

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

/* ========================================
   PROCESS STEP ANIMATIONS
======================================== */
.process-step {
    position: relative;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
}

.process-step::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--gradient-gold);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s ease;
}

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

.process-step:hover::before {
    transform: scaleX(1);
}

/* ========================================
   MOUSE CURSOR TRAIL (requires JS)
======================================== */
.cursor-trail {
    position: fixed;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--gold-glow), transparent);
    pointer-events: none;
    z-index: 9999;
    opacity: 0.5;
    transition: transform 0.1s ease;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
======================================== */
@media (max-width: 768px) {
    .particle {
        width: 3px;
        height: 3px;
    }

    .float-btn {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }

    .floating-cta {
        bottom: 1rem;
        right: 1rem;
        gap: 0.75rem;
    }
}

/* Reduce animations for users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .particle {
        display: none;
    }
}

/* ========================================
   THEME TOGGLE BUTTON
======================================== */
.theme-toggle {
    position: fixed;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    z-index: 1000;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 2px solid var(--gold);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
}

.theme-toggle:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: var(--shadow-gold);
}

.theme-toggle::before {
    content: '☀️';
    font-size: 1.5rem;
    position: absolute;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 0;
    transform: translateY(30px) rotate(-180deg);
}

.theme-toggle::after {
    content: '🌙';
    font-size: 1.5rem;
    position: absolute;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

/* Light mode - show sun, hide moon */
[data-theme="light"] .theme-toggle::before {
    opacity: 1;
    transform: translateY(0) rotate(0deg);
}

[data-theme="light"] .theme-toggle::after {
    opacity: 0;
    transform: translateY(-30px) rotate(180deg);
}

[data-theme="light"] .theme-toggle {
    background: #ffffff;
    border-color: #b8941f;
}

/* Theme toggle tooltip */
.theme-toggle-tooltip {
    position: absolute;
    right: 60px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.theme-toggle:hover .theme-toggle-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Mobile responsive */
@media (max-width: 768px) {
    .theme-toggle {
        top: auto;
        bottom: 10rem;
        right: 1rem;
        width: 45px;
        height: 45px;
        transform: none;
    }

    .theme-toggle:hover {
        transform: scale(1.1);
    }

    .theme-toggle::before,
    .theme-toggle::after {
        font-size: 1.25rem;
    }
}