/* ==========================================================================
   Algoloom Tech Solutions — Extra Graphics Layer v2
   Wave Dividers, Process Steps, WhatsApp Button, 3D Tilt, Neon Cards,
   Cursor Spotlight, Glassmorphism Enhancements, Code Grid BG
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SVG WAVE DIVIDERS
   -------------------------------------------------------------------------- */
.wave-divider {
    line-height: 0;
    overflow: hidden;
    position: relative;
    z-index: 2;
}

.wave-divider svg {
    display: block;
    width: 100%;
    height: 80px;
}

.wave-top {
    margin-top: -2px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 50%, #dbeafe 100%);
}

.wave-cta {
    background: white;
    margin-bottom: -2px;
}

/* --------------------------------------------------------------------------
   2. HOW WE WORK — PROCESS STEPS
   -------------------------------------------------------------------------- */
.process-section {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0f172a 100%);
    padding: 90px 0;
    position: relative;
    overflow: hidden;
}

.process-section .section-title h2 {
    color: #ffffff;
}

.process-section .section-title p {
    color: rgba(255, 255, 255, 0.65);
}

.process-section .section-title h2::after {
    background: linear-gradient(90deg, #06b6d4, #6366f1);
}

/* Animated dot grid background */
.process-bg-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(6, 182, 212, 0.15) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    position: relative;
    z-index: 2;
}

.process-step {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 36px 28px;
    text-align: center;
    position: relative;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.35s ease, background 0.35s ease, border-color 0.35s ease,
                box-shadow 0.35s ease;
    overflow: hidden;
}

.process-step::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(2, 132, 199, 0.08), rgba(99, 102, 241, 0.08));
    opacity: 0;
    transition: opacity 0.35s ease;
}

.process-step:hover {
    transform: translateY(-10px);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(6, 182, 212, 0.4);
    box-shadow: 0 20px 40px rgba(6, 182, 212, 0.2), 0 0 0 1px rgba(6, 182, 212, 0.2);
}

.process-step:hover::before {
    opacity: 1;
}

.process-step-number {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 3.5rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.04);
    font-family: 'Poppins', sans-serif;
    line-height: 1;
    pointer-events: none;
    transition: color 0.35s ease;
}

.process-step:hover .process-step-number {
    color: rgba(6, 182, 212, 0.12);
}

.process-step-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #06b6d4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    margin: 0 auto 22px;
    box-shadow: 0 8px 24px rgba(2, 132, 199, 0.4);
    position: relative;
    z-index: 2;
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.35s ease;
}

.process-step:hover .process-step-icon {
    transform: scale(1.12) rotate(-5deg);
    box-shadow: 0 12px 32px rgba(6, 182, 212, 0.55);
}

.process-step h3 {
    color: #ffffff;
    font-size: 1.2rem;
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.process-step p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.6;
    position: relative;
    z-index: 2;
}

/* Connecting arrow between steps */
.process-connector {
    display: none; /* JS injects desktop arrows */
}

/* Desktop arrow connectors via pseudo on grid */
@media (min-width: 993px) {
    .process-step:not(:last-child)::after {
        content: '\f054'; /* fa-chevron-right */
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        position: absolute;
        top: 50%;
        right: -22px;
        transform: translateY(-50%);
        font-size: 1.1rem;
        color: rgba(6, 182, 212, 0.4);
        z-index: 5;
        pointer-events: none;
    }
}

/* --------------------------------------------------------------------------
   3. NEON GLOW SERVICE CARDS (enhanced)
   -------------------------------------------------------------------------- */
.service-card {
    transition: transform 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.35s ease,
                border-color 0.35s ease;
}

.service-card:hover {
    border-color: rgba(2, 132, 199, 0.45);
    box-shadow: 0 20px 40px rgba(2, 132, 199, 0.18),
                0 0 0 1px rgba(2, 132, 199, 0.1),
                inset 0 0 40px rgba(2, 132, 199, 0.03);
}

/* Each card gets a different accent color via nth-child */
.service-card:nth-child(2):hover {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 20px 40px rgba(16, 185, 129, 0.15), 0 0 0 1px rgba(16, 185, 129, 0.1);
}
.service-card:nth-child(3):hover {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15), 0 0 0 1px rgba(99, 102, 241, 0.1);
}
.service-card:nth-child(4):hover {
    border-color: rgba(245, 158, 11, 0.45);
    box-shadow: 0 20px 40px rgba(245, 158, 11, 0.15), 0 0 0 1px rgba(245, 158, 11, 0.1);
}
.service-card:nth-child(5):hover {
    border-color: rgba(236, 72, 153, 0.45);
    box-shadow: 0 20px 40px rgba(236, 72, 153, 0.12), 0 0 0 1px rgba(236, 72, 153, 0.1);
}

/* --------------------------------------------------------------------------
   4. 3D TILT EFFECT — Project Cards (applied via JS)
   -------------------------------------------------------------------------- */
.project-card {
    transform-style: preserve-3d;
    will-change: transform;
}

.project-card.tilt-active {
    transition: none; /* disable transition during mouse tracking */
}

/* --------------------------------------------------------------------------
   5. FLOATING WHATSAPP CHAT BUTTON
   -------------------------------------------------------------------------- */
.whatsapp-float {
    position: fixed;
    bottom: 90px;
    right: 28px;
    width: 58px;
    height: 58px;
    background: #25d366;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    z-index: 998;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.45);
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.12) translateY(-3px);
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.6);
    color: white;
}

/* Pulse rings */
.wa-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(37, 211, 102, 0.4);
    animation: waPulse 2.4s ease-out infinite;
    pointer-events: none;
}

.wa-pulse-ring-2 {
    animation-delay: 1.2s;
}

@keyframes waPulse {
    0%   { transform: scale(1); opacity: 0.6; }
    100% { transform: scale(2.2); opacity: 0; }
}

/* Tooltip */
.wa-tooltip {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    background: #1f2937;
    color: white;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    transform: translateY(-50%) translateX(8px);
}

.wa-tooltip::after {
    content: '';
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: #1f2937;
}

.whatsapp-float:hover .wa-tooltip {
    opacity: 1;
    transform: translateY(-50%) translateX(0px);
}

/* --------------------------------------------------------------------------
   6. CURSOR SPOTLIGHT (Hero / Dark Sections)
   -------------------------------------------------------------------------- */
#cursor-spotlight {
    position: fixed;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(2, 132, 199, 0.07) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s ease;
    opacity: 0;
    top: 0;
    left: 0;
}

body:hover #cursor-spotlight {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   7. SECTION BADGE ANIMATION
   -------------------------------------------------------------------------- */
.badge {
    position: relative;
    overflow: hidden;
}

.badge::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    animation: badgeSheen 3s ease-in-out infinite;
}

@keyframes badgeSheen {
    0%   { left: -100%; }
    50%, 100% { left: 150%; }
}

/* --------------------------------------------------------------------------
   8. HERO CONSOLE — Glowing Border on Hover
   -------------------------------------------------------------------------- */
.hero-tech-console:hover {
    border-color: rgba(2, 132, 199, 0.5);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.15),
                0 0 0 1px rgba(255, 255, 255, 0.5) inset,
                0 0 40px rgba(2, 132, 199, 0.12);
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

/* --------------------------------------------------------------------------
   9. FOOTER — Glowing TOP BORDER
   -------------------------------------------------------------------------- */
footer {
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #0284c7, #06b6d4, #6366f1, transparent);
    animation: footerGlow 4s ease-in-out infinite alternate;
}

@keyframes footerGlow {
    0%   { opacity: 0.5; }
    100% { opacity: 1; }
}

/* --------------------------------------------------------------------------
   10. PROJECT CARD — Image Hover Zoom + Shine
   -------------------------------------------------------------------------- */
.project-img {
    transition: filter 0.4s ease;
    overflow: hidden;
}

.project-img > div {
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.project-card:hover .project-img > div {
    transform: scale(1.06) translateY(-4px);
}

/* Shine sweep */
.project-img::before {
    content: '';
    position: absolute;
    top: -50%; left: -70%;
    width: 50%; height: 200%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transform: skewX(-20deg);
    transition: none;
    z-index: 3;
}

.project-card:hover .project-img::before {
    animation: projectShine 0.6s ease forwards;
}

@keyframes projectShine {
    from { left: -70%; }
    to   { left: 130%; }
}

/* --------------------------------------------------------------------------
   11. METRIC PILLS — Live Pulse Dot
   -------------------------------------------------------------------------- */
.metric-pill {
    position: relative;
    overflow: hidden;
}

.metric-pill::before {
    content: '';
    position: absolute;
    top: 8px; right: 8px;
    width: 6px; height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.6);
    animation: pulseDot 2s infinite;
}

/* --------------------------------------------------------------------------
   12. HERO BADGE — Animated Icon Spin
   -------------------------------------------------------------------------- */
.hero-content .badge i {
    display: inline-block;
    animation: boltSpin 3s ease-in-out infinite;
}

@keyframes boltSpin {
    0%, 100% { transform: rotate(0deg) scale(1); }
    15%       { transform: rotate(-15deg) scale(1.2); }
    30%       { transform: rotate(15deg) scale(1.2); }
    45%       { transform: rotate(0deg) scale(1); }
}

/* --------------------------------------------------------------------------
   13. SECTION HEADERS — Gradient Text Accent
   -------------------------------------------------------------------------- */
.section-title h2 {
    background: linear-gradient(135deg, var(--dark, #0f172a) 60%, var(--primary, #0284c7) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Override for dark sections */
.process-section .section-title h2 {
    background: linear-gradient(135deg, #ffffff 40%, #06b6d4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cta-section h2 {
    background: none !important;
    -webkit-text-fill-color: white !important;
    color: white !important;
}

/* --------------------------------------------------------------------------
   14. TESTIMONIAL CARDS — Quote Icon Animate
   -------------------------------------------------------------------------- */
.testimonial-card .quote-icon {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

.testimonial-card:hover .quote-icon {
    transform: scale(1.2) rotate(-5deg);
    opacity: 0.35;
}

/* --------------------------------------------------------------------------
   15. CONTACT ICON — Bounce on Hover
   -------------------------------------------------------------------------- */
.contact-icon {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s ease;
}

.contact-item:hover .contact-icon {
    transform: translateY(-4px) scale(1.08);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
}

/* --------------------------------------------------------------------------
   16. NAV LINKS — Highlight Glow on Active
   -------------------------------------------------------------------------- */
.nav-links a.active {
    text-shadow: 0 0 20px rgba(2, 132, 199, 0.4);
}

/* --------------------------------------------------------------------------
   17. HERO STATS — Hover Card Effect
   -------------------------------------------------------------------------- */
.hero-stat-item {
    padding: 8px 12px;
    border-radius: 10px;
    transition: background 0.3s ease, transform 0.3s ease;
    cursor: default;
}

.hero-stat-item:hover {
    background: rgba(2, 132, 199, 0.08);
    transform: translateY(-3px);
}

.hero-stat-item .num {
    background: linear-gradient(135deg, var(--primary, #0284c7), var(--secondary, #06b6d4));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* --------------------------------------------------------------------------
   18. ANIMATED BACKGROUND PATTERN on services section
   -------------------------------------------------------------------------- */
section[style*="background: white"] {
    position: relative;
}

/* --------------------------------------------------------------------------
   RESPONSIVE FIXES
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-step:not(:last-child)::after {
        display: none;
    }
}

@media (max-width: 600px) {
    .process-steps {
        grid-template-columns: 1fr;
    }

    .whatsapp-float {
        bottom: 80px;
        right: 16px;
        width: 50px;
        height: 50px;
        font-size: 1.4rem;
    }

    .wa-tooltip {
        display: none;
    }

    .wave-divider svg {
        height: 50px;
    }
}
