/* 
   RESPONSIVE ENHANCEMENTS - TheLionAI
   "God Mode" Fluid Layouts & Mobile Optimizations
*/

/* ==========================================
   GLOBAL FLUID LAYOUT
   ========================================== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding-left: clamp(1rem, 5vw, 2rem);
    padding-right: clamp(1rem, 5vw, 2rem);
}

/* Prevent horizontal overflow globally */
body, html {
    overflow-x: hidden;
    width: 100%;
}

/* ==========================================
   GRID SYSTEM ADAPTATIONS
   ========================================== */

/* Standard Grid (Features, Agents, etc.) */
.grid, .features-grid, .products-grid, .agents-grid, .sector-grid-preview {
    display: grid;
    gap: clamp(1rem, 2vw, 2rem);
}

/* Desktop: 4 Columns */
@media (min-width: 1200px) {
    .products-grid, .sector-grid-preview {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Laptop: 3 Columns */
@media (max-width: 1199px) and (min-width: 900px) {
    .products-grid, .sector-grid-preview {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Tablet: 2 Columns */
@media (max-width: 899px) and (min-width: 600px) {
    .products-grid, .sector-grid-preview, .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: 1 Column */
@media (max-width: 599px) {
    .products-grid, .features-grid {
        grid-template-columns: 1fr;
    }
    
    /* Special case for sector preview on mobile - 2 cols looks better than 1 long list */
    .sector-grid-preview {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    /* Agent cards - 1 column on small mobile */
    .agents-grid {
        grid-template-columns: 1fr;
    }
    
    /* Pricing cards stack */
    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Testimonials */
    .testimonials-track {
        flex-direction: column;
    }
}

/* ==========================================
   COMPONENT RESPONSIVENESS
   ========================================== */

/* 1. Hero Section */
.hero-content {
    flex-direction: column;
    text-align: center;
    /* Keep hero vertically balanced; main spacing is controlled by .hero padding */
    padding-top: 0;
}

.hero-title {
    /* Prevent extreme wrapping like single-word lines on desktop */
    font-size: clamp(2.15rem, 4.2vw, 4.15rem);
    line-height: 1.05;
}

.hero-buttons {
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

@media (min-width: 768px) {
    .hero-buttons {
        flex-direction: row;
        justify-content: center;
        width: auto;
    }
}

/* 2. Stats / Metrics */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 3. Footer */
.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: center;
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
        gap: 3rem;
    }
}

/* 4. Agent Detail Pages */
.agent-hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .agent-hero-grid {
        grid-template-columns: 1.2fr 0.8fr;
        align-items: center;
    }
}

/* Process Steps (Timeline) */
.process-steps {
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .process-steps {
        flex-direction: row;
    }
}

/* ==========================================
   TOUCH OPTIMIZATIONS
   ========================================== */
@media (hover: none) {
    /* Increase tap targets */
    a, button, .nav-link {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Disable hover effects that stick */
    .card:hover {
        transform: none;
    }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */
.hide-on-mobile {
    display: none !important;
}

@media (min-width: 768px) {
    .hide-on-mobile {
        display: block !important;
    }
    
    .hide-on-desktop {
        display: none !important;
    }
}

/* Fix for 3D Canvas blocking clicks */
#canvas-container {
    pointer-events: none;
    z-index: -1;
}

/* Ensure images are responsive */
img, video, svg {
    max-width: 100%;
    height: auto;
}

/* ==========================================
   MOBILE NAVIGATION FIXES
   ========================================== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(15, 23, 42, 0.98);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-menu li {
        width: 100%;
        text-align: center;
    }
    
    .nav-menu a {
        display: block;
        padding: 1rem 2rem;
        font-size: 1.25rem;
    }
    
    .mobile-menu-toggle {
        display: flex;
        z-index: 1000;
    }
}

/* ==========================================
   TABLET SPECIFIC FIXES
   ========================================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .hero-title {
        font-size: clamp(2.5rem, 6vw, 3.5rem);
    }
    
    .section-title {
        font-size: clamp(2rem, 5vw, 2.5rem);
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ==========================================
   LANDSCAPE MOBILE FIXES
   ========================================== */
@media (max-width: 896px) and (orientation: landscape) {
    .hero {
        min-height: initial;
        padding: 4rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    section {
        padding: 3rem 0;
    }
}

/* ==========================================
   SMALL MOBILE SCREENS (iPhone SE, etc.)
   ========================================== */
@media (max-width: 375px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
    }
    
    .sector-grid-preview {
        gap: 0.5rem;
    }
    
    .sector-card-preview {
        padding: 1rem 0.5rem;
    }
    
    .sector-card-preview i {
        font-size: 1.5rem;
    }
    
    .sector-card-preview span {
        font-size: 0.8rem;
    }
}
