/* Enhanced Mobile Responsiveness - Video & Iframe Fix */

/* Video Container Responsive */
.hero-youtube-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100vw;
    height: 56.25vw; /* 16:9 Aspect Ratio */
    min-height: 100vh;
    min-width: 177.77vh; /* 16:9 Aspect Ratio */
    pointer-events: none;
}

/* Responsive Iframe Container */
.responsive-iframe-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.responsive-iframe-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Tablet and Below (< 1024px) */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 3rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.1rem !important;
    }
    
    .service-intro {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .tech-showcase-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)) !important;
    }
    
    /* Contact wrapper */
    .contact-wrapper {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    /* Portfolio slider */
    .slider-prev, .slider-next {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.2rem !important;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    /* Hero Section */
    .hero-video {
        min-height: 70vh !important;
    }
    
    .hero-youtube-video {
        min-height: 70vh;
        height: 125vw; /* Adjust for mobile */
    }
    
    .hero-title {
        font-size: 2.5rem !important;
        line-height: 1.2 !important;
        padding: 0 1rem !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        padding: 0 1rem !important;
    }
    
    .audio-visualizer {
        max-width: 250px !important;
    }
    
    .spectrum-analyzer {
        max-width: 250px !important;
    }
    
    /* Navigation */
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(10, 14, 26, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 2rem;
        transition: left 0.3s ease;
        z-index: 999;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Services Grid */
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    /* Solutions Grid - Fix for portfolio page */
    .solutions-summary [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    /* Portfolio Grid */
    .portfolio-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Advantages Grid */
    .advantages-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Stats Grid */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    /* Tech Tabs */
    .tab-buttons {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .tab-btn {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .tech-list {
        grid-template-columns: 1fr !important;
    }
    
    /* Section Headers */
    .section-title {
        font-size: 2rem !important;
    }
    
    .section-subtitle {
        font-size: 0.85rem !important;
    }
    
    /* Buttons */
    .btn, .btn-chroma, .btn-primary, .btn-secondary {
        padding: 0.875rem 1.5rem !important;
        font-size: 0.95rem !important;
    }
    
    /* Cards */
    .service-card, .pro-card, .advantage-card {
        padding: 1.5rem !important;
    }
    
    /* Images */
    .about-image-container img,
    .intro-image img,
    .tech-showcase-image {
        max-height: 300px !important;
        object-fit: cover !important;
    }
    
    /* Footer */
    .footer-content {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: center !important;
    }
    
    /* Contact Form */
    .contact-wrapper {
        grid-template-columns: 1fr !important;
    }
    
    .contact-form-container,
    .contact-info-container {
        padding: 2rem 1.5rem !important;
    }
    
    /* Map Container */
    .contact-info-container [style*="height: 300px"] {
        height: 250px !important;
    }
    
    /* Portfolio Slider */
    .hero-slider {
        height: 60vh !important;
    }
    
    .slider-prev {
        left: 1rem !important;
    }
    
    .slider-next {
        right: 1rem !important;
    }
    
    /* Reduce Padding on Mobile */
    .section-padding {
        padding: 3rem 0 !important;
    }
    
    .container {
        padding: 0 1rem !important;
    }
    
    /* FAQ Items */
    .faq-question {
        padding: 1rem !important;
    }
    
    .faq-question h3 {
        font-size: 1rem !important;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem !important;
    }
    
    .section-title {
        font-size: 1.75rem !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr !important;
    }
    
    .stat-number {
        font-size: 2.5rem !important;
    }
    
    .audio-visualizer,
    .spectrum-analyzer {
        max-width: 200px !important;
    }
    
    /* Smaller cards on very small screens */
    .service-card h3,
    .advantage-card h3 {
        font-size: 1.25rem !important;
    }
    
    .service-card p,
    .advantage-card p {
        font-size: 0.95rem !important;
    }
    
    /* Portfolio slider full height on small mobile */
    .hero-slider {
        height: 50vh !important;
    }
    
    .slider-prev, .slider-next {
        width: 35px !important;
        height: 35px !important;
        font-size: 1rem !important;
    }
    
    /* Contact info items */
    .contact-info-item {
        padding: 1rem !important;
    }
    
    .contact-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 1.1rem !important;
    }
}

/* Landscape Mobile */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-video {
        min-height: 100vh !important;
    }
    
    .hero-slider {
        height: 100vh !important;
    }
    
    .section-padding {
        padding: 2rem 0 !important;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Remove hover effects on touch devices */
    .service-card:hover,
    .portfolio-item:hover,
    .advantage-card:hover,
    .pro-card:hover {
        transform: none !important;
    }
    
    /* Make tap targets larger */
    .btn, .btn-chroma, .btn-primary, .btn-secondary {
        min-height: 48px !important;
        padding: 1rem 2rem !important;
    }
    
    .tab-btn {
        min-height: 48px !important;
    }
    
    /* Improve touch scrolling */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Better touch targets for links */
    a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Use higher quality images on retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Very Small Screens (< 360px) */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.75rem !important;
    }
    
    .section-title {
        font-size: 1.5rem !important;
    }
    
    .container {
        padding: 0 0.75rem !important;
    }
    
    .contact-form-container,
    .contact-info-container {
        padding: 1.5rem 1rem !important;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .mobile-menu-toggle,
    .scroll-indicator,
    .cta-section,
    footer,
    .hero-youtube-video {
        display: none !important;
    }
    
    .section-padding {
        padding: 1rem 0 !important;
    }
    
    * {
        background: white !important;
        color: black !important;
    }
}
