/* ==========================================================================
   SoftBridge Technology — Responsive & Viewport Media Queries
   Mobile-First & Comprehensive Breakpoints (1440px, 1200px, 992px, 768px, 576px, 375px, 320px)
   ========================================================================== */

/* --- Global Prevent Horizontal Overflow --- */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

img, svg, iframe, canvas {
    max-width: 100%;
    height: auto;
}

/* --- Ultra Wide Screens (1440px +) --- */
@media (min-width: 1440px) {
    .container {
        max-width: 1340px;
    }
    .hero-heading {
        font-size: 4rem;
    }
}

/* --- Laptops & Desktops (max-width: 1200px) --- */
@media (max-width: 1200px) {
    .hero-heading {
        font-size: 3rem;
    }
    .analytics-spotlight-grid,
    .ai-spotlight-grid,
    .contact-grid {
        gap: 2.5rem;
    }
    .timeline-horizontal {
        grid-template-columns: repeat(3, 1fr);
    }
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* --- Tablets & Medium Screens (max-width: 992px) --- */
@media (max-width: 992px) {
    .section-padding {
        padding: 4.5rem 0;
    }

    /* Hero Layout */
    .hero-container {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    .hero-content {
        max-width: 100%;
        margin: 0 auto;
    }
    .hero-ctas {
        justify-content: center;
    }
    .hero-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    .hero-floating-widget {
        display: none; /* Hide heavy floating widgets on tablet to prevent horizontal overflow */
    }

    /* Grids & Cards */
    .about-grid,
    .analytics-spotlight-grid,
    .ai-spotlight-grid,
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }

    .capabilities-grid,
    .benefits-grid,
    .case-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }

    .synergy-flow-container {
        flex-direction: column;
        gap: 1.5rem;
    }
    .synergy-arrow {
        transform: rotate(90deg);
    }

    .timeline-horizontal {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2.5rem;
    }

    /* Mobile Navigation Drawer */
    .hamburger {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 82%;
        max-width: 360px;
        height: 100vh;
        height: 100dvh;
        background: rgba(11, 18, 32, 0.98);
        backdrop-filter: blur(24px);
        -webkit-backdrop-filter: blur(24px);
        flex-direction: column;
        justify-content: center;
        gap: 1.75rem;
        padding: 3rem 2rem;
        transition: right var(--transition-normal);
        box-shadow: -10px 0 35px rgba(0,0,0,0.6);
        z-index: 1000;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu.active {
        right: 0;
    }

    .nav-link {
        font-size: 1.2rem;
        padding: 0.5rem 0;
        display: block;
    }

    .nav-actions {
        display: none;
    }
    .nav-menu .nav-actions-mobile {
        display: block;
        margin-top: 1rem;
        width: 100%;
    }
    .nav-menu .nav-actions-mobile .btn {
        width: 100%;
    }
}

/* --- Mobile Landscape & Small Tablets (max-width: 768px) --- */
@media (max-width: 768px) {
    .section-padding {
        padding: 3.75rem 0;
    }

    .hero-section {
        padding: 7rem 0 3.5rem 0;
    }
    .hero-heading {
        font-size: 2.25rem;
    }
    .hero-subheading {
        font-size: 1rem;
    }

    .section-header {
        margin-bottom: 2.5rem;
    }
    .section-header h2, 
    .about-content h2, 
    .cta-banner h2 {
        font-size: 1.85rem;
    }
    .section-subtitle {
        font-size: 1rem;
    }

    .dash-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    .dash-period-filters {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 0.25rem;
        -webkit-overflow-scrolling: touch;
    }

    .dash-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }

    .capabilities-grid,
    .benefits-grid,
    .case-grid,
    .tech-grid {
        grid-template-columns: 1fr;
    }

    .form-grid-2 {
        grid-template-columns: 1fr;
    }

    .cta-banner {
        padding: 2.5rem 1.25rem;
        text-align: center;
    }
    .cta-buttons {
        flex-direction: column;
        width: 100%;
    }
    .cta-buttons .btn {
        width: 100%;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 0.85rem;
        text-align: center;
    }

    /* Filter tab scrollable bar on mobile */
    .filter-tab-bar {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 0.75rem;
        margin-bottom: 2rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .filter-tab-bar::-webkit-scrollbar {
        display: none;
    }
    .filter-tab-bar .tab-btn {
        flex-shrink: 0;
    }

    /* AI prompt header wrap on mobile */
    .ai-prompt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .ai-prompt-header div {
        flex-wrap: wrap;
        width: 100%;
    }
    .ai-prompt-header .tab-btn {
        flex: 1;
        min-width: 90px;
        text-align: center;
    }
}

/* --- Mobile Portrait (max-width: 576px) --- */
@media (max-width: 576px) {
    .container {
        padding: 0 1rem;
    }

    .brand-logo-img {
        height: 42px;
        padding: 4px 10px;
    }

    .hero-heading {
        font-size: 1.8rem;
        line-height: 1.2;
    }
    .hero-stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
        padding-top: 1.5rem;
    }
    .stat-number {
        font-size: 1.5rem;
    }
    .stat-label {
        font-size: 0.75rem;
    }

    .hero-ctas {
        flex-direction: column;
        width: 100%;
    }
    .btn {
        width: 100%;
        justify-content: center;
    }
    .btn-lg {
        padding: 0.9rem 1.5rem;
        font-size: 0.95rem;
    }

    .analytics-dashboard-frame,
    .ai-flow-frame,
    .contact-form-card,
    .contact-info-card,
    .hero-visual-card {
        padding: 1.25rem 1rem;
        border-radius: var(--radius-md);
    }

    .dash-metrics-grid {
        grid-template-columns: 1fr;
    }

    .service-card {
        padding: 1.35rem 1.15rem;
    }

    .industries-grid {
        grid-template-columns: 1fr;
    }

    .capability-card, .benefit-card, .case-card {
        padding: 1.25rem 1rem;
    }

    /* Prevent mobile input auto-zoom */
    .form-control, input, select, textarea {
        font-size: 16px !important;
        padding: 0.75rem 0.9rem;
    }
}

/* --- Small Mobile Devices (320px - 375px) --- */
@media (max-width: 375px) {
    .brand-logo {
        font-size: 1.1rem;
    }
    .brand-logo-img {
        height: 38px;
        padding: 3px 8px;
    }
    .hero-heading {
        font-size: 1.55rem;
    }
    .section-header h2, 
    .about-content h2, 
    .cta-banner h2 {
        font-size: 1.5rem;
    }
    .dash-val, .stat-number {
        font-size: 1.35rem;
    }
}
