/*
    TechDwar Solutions — Mobile Experience CSS
    Sticky Bottom CTA, Floating WhatsApp, Swipe Navigation, Card Stack UI
*/

/* ================================================================
   1. STICKY BOTTOM CTA BAR (Mobile Only)
   ================================================================ */
.mobile-bottom-cta {
    display: none;
}

@media screen and (max-width: 767px) {
    .mobile-bottom-cta {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9990;
        display: flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.65rem 1rem;
        background: rgba(10, 31, 68, 0.96);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(212, 175, 55, 0.15);
        box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.25);
        transform: translateY(0);
        transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .mobile-bottom-cta.hidden {
        transform: translateY(100%);
    }

    [data-theme='dark'] .mobile-bottom-cta {
        background: rgba(6, 13, 26, 0.97);
        border-top-color: rgba(240, 208, 96, 0.12);
    }

    .mobile-cta-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.5rem;
        padding: 1rem 0.75rem;
        min-height: 52px;
        border-radius: 12px;
        font-family: 'Poppins', sans-serif;
        font-weight: 600;
        font-size: 0.875rem;
        text-decoration: none;
        transition: all 0.3s ease;
        border: none;
        cursor: pointer;
        white-space: nowrap;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-cta-btn--primary {
        background: linear-gradient(135deg, #D4AF37, #E8C84A);
        color: #0A1F44;
        box-shadow: 0 4px 16px rgba(212, 175, 55, 0.25);
    }

    .mobile-cta-btn--primary:active {
        transform: scale(0.97);
    }

    .mobile-cta-btn--secondary {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255, 255, 255, 0.12);
        color: #E2E8F0;
    }

    .mobile-cta-btn--secondary:active {
        background: rgba(255, 255, 255, 0.12);
    }

    .mobile-cta-btn--whatsapp {
        background: #25D366;
        color: #fff;
        max-width: 60px;
        padding: 1rem;
        flex: 0 0 auto;
        min-height: 52px;
    }

    .mobile-cta-btn--whatsapp:active {
        transform: scale(0.95);
    }

    /* Push page content above the sticky bar */
    body {
        padding-bottom: 72px !important;
    }

    /* Unhide the standalone WhatsApp float on mobile and stack it ABOVE the mobile CTA bar */
    .whatsapp-float {
        display: flex !important;
        bottom: 90px !important;
        right: 16px !important; /* give slightly more breathing room */
        width: 50px !important;
        height: 50px !important;
    }

    /* Move chatbot fab ABOVE the WhatsApp float */
    .chatbot-fab {
        bottom: 156px !important;
        right: 16px !important;
        width: 50px !important;
        height: 50px !important;
    }

    .chatbot-panel {
        bottom: 220px !important;
        right: 16px !important;
    }
}


/* ================================================================
   2. FLOATING WHATSAPP TOOLTIP (Desktop — enhanced)
   ================================================================ */
@media screen and (min-width: 768px) {
    .whatsapp-float::after {
        content: 'Chat with us!';
        position: absolute;
        right: calc(100% + 16px);
        top: 50%;
        transform: translateY(-50%);
        background: rgba(10, 31, 68, 0.95);
        color: #D4AF37;
        padding: 0.5rem 1rem;
        border-radius: 8px;
        border: 1px solid rgba(212, 175, 55, 0.3);
        font-family: 'Poppins', sans-serif;
        font-size: 0.75rem;
        font-weight: 600;
        white-space: nowrap;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .whatsapp-float:hover::after {
        opacity: 1;
        right: calc(100% + 20px);
    }

    [data-theme='dark'] .whatsapp-float::after {
        background: rgba(15, 23, 42, 0.95);
        color: #F0D060;
        border-color: rgba(240, 208, 96, 0.3);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }
}


/* ================================================================
   3. SWIPE-BASED HORIZONTAL NAVIGATION (Mobile Services / Cards)
   ================================================================ */
@media screen and (max-width: 767px) {
    /* Services grid: horizontal swipe */
    .svc-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding: 0 1rem 1.5rem;
        scrollbar-width: none;
    }

    .svc-grid::-webkit-scrollbar { display: none; }

    .svc-grid .svc-card {
        flex: 0 0 85vw;
        max-width: 85vw;
        scroll-snap-align: center;
    }

    /* Swipe indicators (dots) */
    .swipe-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 0.5rem 0 1rem;
    }

    .swipe-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(255, 255, 255, 0.15);
        transition: all 0.3s;
    }

    .swipe-dot.active {
        background: #D4AF37;
        width: 24px;
        border-radius: 4px;
    }

    /* Trust & Proof cases: horizontal swipe */
    .tp-cases-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding-bottom: 1rem;
        scrollbar-width: none;
    }

    .tp-cases-grid::-webkit-scrollbar { display: none; }

    .tp-cases-grid > * {
        flex: 0 0 82vw;
        max-width: 82vw;
        scroll-snap-align: center;
    }

    /* Swipe hint animation */
    .swipe-hint {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.4rem;
        font-size: 0.7rem;
        color: rgba(255, 255, 255, 0.3);
        font-weight: 500;
        padding-top: 0.5rem;
        animation: swipe-bounce 2s ease-in-out infinite;
    }

    .swipe-hint svg {
        animation: swipe-arrow 2s ease-in-out infinite;
    }

    @keyframes swipe-bounce {
        0%, 100% { opacity: 0.4; }
        50% { opacity: 0.8; }
    }

    @keyframes swipe-arrow {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(6px); }
    }

    /* LPT Stats Grid: horizontal swipe */
    .lpt-stats-grid {
        display: flex !important;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 0.75rem;
        scrollbar-width: none;
    }

    .lpt-stats-grid::-webkit-scrollbar { display: none; }

    .lpt-stats-grid .lpt-stat {
        flex: 0 0 140px;
        scroll-snap-align: start;
    }
}


/* ================================================================
   4. CARD STACK UI (Mobile)
   ================================================================ */
@media screen and (max-width: 767px) {
    /* Why Choose Us benefits: card stack */
    #why-us .grid[style] {
        gap: 2rem !important;
    }

    #why-us [style*="display: grid; gap: 2rem"] > .flex {
        background: var(--card-bg, #fff);
        border: 1px solid var(--glass-border, rgba(10, 31, 68, 0.08));
        border-radius: 16px;
        padding: 1.25rem;
        box-shadow: 0 2px 8px rgba(10, 31, 68, 0.06);
        transition: all 0.3s ease;
    }

    [data-theme='dark'] #why-us [style*="display: grid; gap: 2rem"] > .flex {
        background: #131C2E;
        border-color: rgba(255, 255, 255, 0.06);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }

    /* Service cards stack with depth */
    .svc-grid .svc-card {
        box-shadow: 
            0 2px 8px rgba(0, 0, 0, 0.15),
            0 8px 24px rgba(0, 0, 0, 0.08);
        border-radius: 20px;
    }

    /* ABA options: card stack */
    .aba-options {
        gap: 0.75rem !important;
    }

    .aba-option {
        border-radius: 16px !important;
        padding: 1rem !important;
    }

    /* Contact info cards */
    .card {
        border-radius: 20px !important;
    }

    /* General card stack depth effect */
    .card-stack {
        position: relative;
    }

    .card-stack::before {
        content: '';
        position: absolute;
        bottom: -6px;
        left: 8px;
        right: 8px;
        height: 100%;
        border-radius: 20px;
        background: var(--card-bg, #fff);
        border: 1px solid var(--glass-border, rgba(10, 31, 68, 0.08));
        z-index: -1;
        opacity: 0.6;
    }

    .card-stack::after {
        content: '';
        position: absolute;
        bottom: -12px;
        left: 16px;
        right: 16px;
        height: 100%;
        border-radius: 20px;
        background: var(--card-bg, #fff);
        border: 1px solid var(--glass-border, rgba(10, 31, 68, 0.08));
        z-index: -2;
        opacity: 0.3;
    }

    [data-theme='dark'] .card-stack::before,
    [data-theme='dark'] .card-stack::after {
        background: #131C2E;
        border-color: rgba(255, 255, 255, 0.04);
    }
}


/* ================================================================
   5. MOBILE MICRO-INTERACTIONS & POLISH
   ================================================================ */
@media screen and (max-width: 767px) {
    /* Tap feedback for all interactive elements */
    .btn:active,
    .svc-card:active,
    .aba-option:active,
    .chatbot-quick-btn:active {
        transform: scale(0.97) !important;
        transition: transform 0.1s ease !important;
    }

    /* Faster transitions on mobile */
    * {
        -webkit-tap-highlight-color: transparent;
    }

    /* Reduce motion for performance */
    .hero-orb { animation: none !important; }
    .animate-float { animation-duration: 4s !important; }

    /* Smoother section padding on mobile */
    .section-padding {
        padding: 40px 0 !important;
    }

    /* Better touch scrolling */
    html {
        -webkit-overflow-scrolling: touch;
        scroll-padding-top: 70px;
    }

    /* Chatbot panel: full-width on small screens */
    .chatbot-panel {
        width: calc(100vw - 24px) !important;
        right: 12px !important;
        max-height: 420px !important;
        border-radius: 16px !important;
    }

    /* Voice overlay: adjusted for mobile */
    .voice-mic-ring {
        width: 100px;
        height: 100px;
    }

    .voice-mic-icon {
        width: 50px;
        height: 50px;
    }

    .voice-transcript {
        font-size: 1.2rem;
        padding: 0 1.5rem;
    }

    /* Navbar progress bar: thinner on mobile */
    .nav-progress-bar {
        height: 2px;
    }
}


/* ================================================================
   6. TABLET ADJUSTMENTS
   ================================================================ */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    /* Hide mobile bottom CTA on tablet */
    .mobile-bottom-cta {
        display: none !important;
    }

    /* Service grid: 2-col on tablet, no swipe */
    .svc-grid {
        display: grid !important;
        overflow-x: visible !important;
        scroll-snap-type: none !important;
    }

    .svc-grid .svc-card {
        flex: unset;
        max-width: unset;
    }
}
