/**
 * Visa Experts - Interactive Enhancements
 * Extra animations, micro-interactions, and polish
 */

/* ---- Page Loader ---- */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f0c29 0%, #302b63 50%, #24243e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    text-align: center;
}

.loader-plane {
    font-size: 3rem;
    color: var(--accent);
    animation: loaderFly 2s ease-in-out infinite;
}

.loader-text {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-top: 16px;
    opacity: 0;
    animation: fadeInUp 0.8s ease 0.3s forwards;
}

@keyframes loaderFly {
    0% {
        transform: translateX(-20px) rotate(-5deg);
    }

    50% {
        transform: translateX(20px) rotate(5deg);
    }

    100% {
        transform: translateX(-20px) rotate(-5deg);
    }
}

/* ---- Typed Text Effect ---- */
.typed-cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background: var(--accent);
    margin-left: 4px;
    animation: blink 1s step-end infinite;
    vertical-align: text-bottom;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

/* ---- Tilt Card Effect ---- */
.tilt-card {
    transform-style: preserve-3d;
    perspective: 1000px;
}

.tilt-card:hover {
    transform: perspective(1000px) rotateY(5deg) rotateX(3deg);
}

/* ---- Ripple Button Effect ---- */
.btn-ripple {
    position: relative;
    overflow: hidden;
}

.btn-ripple .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: scale(0);
    animation: rippleEffect 0.6s ease-out;
    pointer-events: none;
}

@keyframes rippleEffect {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ---- Parallax Background ---- */
.parallax-bg {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
}

/* ---- Service Cards Enhanced ---- */
.service-card {
    transform-style: preserve-3d;
}

.service-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.4s ease;
    border-radius: 3px;
}

.service-card:hover::after {
    width: 60%;
}

.service-detail-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-detail-card:hover {
    transform: translateY(-12px) scale(1.02);
}

/* ---- Hover Gradient Underline for Links ---- */
.gradient-underline {
    position: relative;
    display: inline-block;
}

.gradient-underline::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.gradient-underline:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* ---- Glow Effect ---- */
.glow-on-hover:hover {
    box-shadow: 0 0 20px rgba(230, 57, 70, 0.3),
        0 0 40px rgba(10, 102, 194, 0.15);
}

/* ---- Enhanced Destination Cards ---- */
.destination-card::after {
    content: 'View Details →';
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform: translate(-50%, 50%) scale(0.8);
    background: var(--primary);
    color: white;
    padding: 10px 24px;
    border-radius: 50px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 3;
    white-space: nowrap;
}

.destination-card:hover::after {
    opacity: 1;
    transform: translate(-50%, 50%) scale(1);
}

/* ---- Testimonial Card Shine ---- */
.testimonial-card::before {
    content: '"';
    position: absolute;
    top: 16px;
    right: 24px;
    font-family: Georgia, serif;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.06);
    line-height: 1;
}

/* ---- FAQ Enhanced ---- */
.faq-item {
    transition: all 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    border-color: rgba(230, 57, 70, 0.3);
}

.faq-question::before {
    content: '';
    width: 4px;
    height: 100%;
    position: absolute;
    left: 0;
    top: 0;
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.faq-item.active .faq-question::before {
    opacity: 1;
}

.faq-question {
    position: relative;
    padding-left: 32px;
}

/* ---- Floating Particles (CSS only) ---- */
.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 209, 102, 0.3);
    border-radius: 50%;
    animation: particleFloat linear infinite;
}

.particle:nth-child(1) {
    left: 5%;
    animation-duration: 15s;
    animation-delay: 0s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(2) {
    left: 15%;
    animation-duration: 20s;
    animation-delay: 2s;
    width: 8px;
    height: 8px;
}

.particle:nth-child(3) {
    left: 25%;
    animation-duration: 18s;
    animation-delay: 4s;
}

.particle:nth-child(4) {
    left: 40%;
    animation-duration: 22s;
    animation-delay: 1s;
    width: 5px;
    height: 5px;
}

.particle:nth-child(5) {
    left: 55%;
    animation-duration: 16s;
    animation-delay: 3s;
    width: 7px;
    height: 7px;
}

.particle:nth-child(6) {
    left: 70%;
    animation-duration: 19s;
    animation-delay: 5s;
}

.particle:nth-child(7) {
    left: 80%;
    animation-duration: 17s;
    animation-delay: 2s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(8) {
    left: 90%;
    animation-duration: 21s;
    animation-delay: 6s;
    width: 8px;
    height: 8px;
}

@keyframes particleFloat {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100px) rotate(720deg);
        opacity: 0;
    }
}

/* ---- Scroll Progress Bar ---- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--secondary));
    z-index: 99999;
    transition: width 0.1s linear;
}

/* ---- Back to Top ---- */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 32px;
    width: 44px;
    height: 44px;
    background: var(--text-primary);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    z-index: 998;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

/* ---- Stagger Animation Helper ---- */
.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;
}

/* ---- Enhanced Hover States ---- */
.footer-social a:hover {
    transform: translateY(-5px) rotate(5deg);
}

.contact-info-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.contact-info-card:hover {
    transform: translateX(8px);
    border-color: var(--primary);
}

.why-image-badge {
    animation: float 3s ease-in-out infinite;
}

/* ---- Stats Counter Animation ---- */
.stat-item {
    transition: all 0.3s ease;
}

.stat-item:hover {
    transform: scale(1.08);
}

.stat-item:hover .stat-value {
    text-shadow: 0 0 20px rgba(255, 209, 102, 0.5);
}

/* ---- Mission Card Hover ---- */
.mission-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mission-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.mission-card:hover .mission-card-icon {
    transform: scale(1.15) rotate(5deg);
    transition: transform 0.3s ease;
}

/* ---- CTA Wrapper Glow ---- */
.cta-wrapper {
    transition: box-shadow 0.4s ease;
}

.cta-wrapper:hover {
    box-shadow: 0 20px 60px rgba(230, 57, 70, 0.3);
}

/* ---- Navbar Active Link Indicator ---- */
.nav-menu .current-menu-item a,
.nav-menu .current_page_item a {
    position: relative;
}

.nav-menu .current-menu-item a::after,
.nav-menu .current_page_item a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
}

/* ---- Mobile Menu Enhanced ---- */
@media (max-width: 768px) {
    .nav-menu.active {
        background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    }

    .nav-menu.active a {
        animation: slideInLeft 0.4s ease forwards;
        opacity: 0;
    }

    .nav-menu.active a:nth-child(1) {
        animation-delay: 0.1s;
    }

    .nav-menu.active a:nth-child(2) {
        animation-delay: 0.2s;
    }

    .nav-menu.active a:nth-child(3) {
        animation-delay: 0.3s;
    }

    .nav-menu.active a:nth-child(4) {
        animation-delay: 0.4s;
    }

    .nav-menu.active li a {
        animation: slideInLeft 0.4s ease forwards;
        opacity: 0;
    }

    .nav-menu.active li:nth-child(1) a {
        animation-delay: 0.1s;
    }

    .nav-menu.active li:nth-child(2) a {
        animation-delay: 0.2s;
    }

    .nav-menu.active li:nth-child(3) a {
        animation-delay: 0.3s;
    }

    .nav-menu.active li:nth-child(4) a {
        animation-delay: 0.4s;
    }

    @keyframes slideInLeft {
        from {
            opacity: 0;
            transform: translateX(-30px);
        }

        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .back-to-top {
        bottom: 96px;
        right: 28px;
    }
}

/* ---- Smooth Image Load ---- */
img {
    opacity: 0;
    transition: opacity 0.5s ease;
}

img.loaded,
.logo img,
.hero-bg {
    opacity: 1;
}

/* Override for specific always-visible images */
.footer img,
.navbar img {
    opacity: 1 !important;
}