/* 
* Responsive Design Fixes for BlueAI Website
* Ensures proper mobile layout without horizontal scrolling
*/

/* ===== MOBILE-FIRST RESPONSIVE FIXES ===== */

/* Prevent horizontal scrolling */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Improved container responsive behavior */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* ===== HEADER & NAVIGATION RESPONSIVE FIXES ===== */

/* Mobile Navigation Menu */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 0;
    }
    
    .header-wrapper {
        position: relative;
    }
    
    .main-nav {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: var(--shadow-lg);
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        z-index: 999;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .main-nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav-list {
        flex-direction: column;
        padding: 1rem;
        gap: 0;
    }
    
    .nav-list a {
        display: block;
        padding: 1rem;
        border-bottom: 1px solid var(--gray-light);
        font-size: 1.1rem;
    }
    
    .nav-list a:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 30px;
        height: 30px;
        z-index: 1001;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
        height: 2px;
        background-color: var(--dark);
        margin: 2px 0;
        transition: all 0.3s ease;
    }
    
    .mobile-menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .mobile-menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .mobile-menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    .header-buttons .btn {
        display: none;
    }
    
    /* Prevent body scroll when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

/* ===== HERO SECTION RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .hero-content {
        order: 1;
        max-width: 100%;
    }
    
    .hero-image {
        order: 2;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
}

/* ===== SOLUTIONS GRID RESPONSIVE FIXES ===== */
@media (max-width: 992px) {
    .solutions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

@media (max-width: 576px) {
    .solutions-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .solution-card {
        padding: 1.5rem;
    }
}

/* ===== FEATURES GRID RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .feature-card {
        text-align: center;
        padding: 2rem 1.5rem;
    }
}

/* ===== TESTIMONIALS RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .testimonial-card {
        padding: 1.5rem;
    }
}

/* ===== CONTACT FORM RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-form {
        order: 1;
    }
    
    .contact-info {
        order: 2;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-row .form-group {
        flex: 1;
    }
}

/* ===== FOOTER RESPONSIVE FIXES ===== */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-col {
        margin-bottom: 1rem;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ===== GENERAL RESPONSIVE IMPROVEMENTS ===== */

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Responsive tables */
@media (max-width: 768px) {
    table {
        font-size: 0.875rem;
    }
    
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Responsive text sizing */
@media (max-width: 576px) {
    :root {
        --h1-size: 2rem;
        --h2-size: 1.5rem;
        --h3-size: 1.25rem;
        --h4-size: 1.125rem;
        --body-size: 0.875rem;
        --spacing-xxl: 2rem;
        --spacing-xl: 1.5rem;
        --spacing-lg: 1rem;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .section-header {
        margin-bottom: 2rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* ===== SPECIFIC PAGE RESPONSIVE FIXES ===== */

/* About Page */
@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .about-grid.reverse {
        direction: ltr;
    }
    
    .about-image {
        order: 2;
    }
    
    .about-content {
        order: 1;
        text-align: center;
    }
}

/* Contact Page */
@media (max-width: 768px) {
    .location-tabs {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .location-tab {
        width: 100%;
        text-align: center;
    }
    
    .location-details {
        padding: 1.5rem;
    }
}

/* Solution Pages */
@media (max-width: 768px) {
    .solution-hero {
        padding: 3rem 0;
    }
    
    .solution-features {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .case-studies-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ===== UTILITY CLASSES FOR RESPONSIVE DESIGN ===== */
.hide-mobile {
    display: block;
}

.show-mobile {
    display: none;
}

@media (max-width: 768px) {
    .hide-mobile {
        display: none;
    }
    
    .show-mobile {
        display: block;
    }
}

/* Text alignment utilities */
@media (max-width: 768px) {
    .text-center-mobile {
        text-align: center;
    }
    
    .text-left-mobile {
        text-align: left;
    }
}

/* Spacing utilities for mobile */
@media (max-width: 768px) {
    .mb-mobile {
        margin-bottom: 1rem;
    }
    
    .mt-mobile {
        margin-top: 1rem;
    }
    
    .p-mobile {
        padding: 1rem;
    }
}
