/* ========================================
   RESPONSIVE OPTIMIZATION FOR ALL DEVICES
   100% Mobile & Device Optimization
   GreenClassBD - Performance Edition
   ======================================== */

/* Performance Optimizations */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

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

/* Container Responsive Adjustments */
.container {
    width: 100%;
    max-width: 100%;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* Ultra-Wide Screens (1920px+) */
@media (min-width: 1920px) {
    .container {
        max-width: 1800px;
        margin: 0 auto;
    }
    
    .hero-title {
        font-size: 5rem;
    }
    
    .glass-nav {
        max-width: 1600px;
    }
}

/* Large Desktop (1440px - 1919px) */
@media (min-width: 1440px) and (max-width: 1919px) {
    .hero-title {
        font-size: 4.5rem;
    }
    
    .container {
        max-width: 1400px;
    }
}

/* Standard Desktop (1200px - 1439px) */
@media (min-width: 1200px) and (max-width: 1439px) {
    .hero-title {
        font-size: 3.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
}

/* Laptop (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    .hero {
        padding: 130px 2rem 2rem;
    }
    
    .hero-title {
        font-size: 3.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.15rem;
    }
    
    .glass-nav {
        width: 96%;
    }
}

/* Tablet Landscape (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        padding-left: 1.75rem;
        padding-right: 1.75rem;
    }
    
    .hero {
        padding: 130px 1.75rem 2rem;
        min-height: 90vh;
    }
    
    .hero-title {
        font-size: 2.8rem;
    }
    
    .hero-subtitle {
        font-size: 1.15rem;
        max-width: 90%;
    }
    
    .cta-buttons {
        gap: 1rem;
    }
    
    .btn {
        padding: 13px 26px;
        font-size: 0.9rem;
    }
    
    .glass-nav {
        width: 95%;
        padding: 1rem 1.5rem;
    }
}

/* Tablet Portrait (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .hero {
        padding: 110px 1.5rem 2rem;
        min-height: 85vh;
    }
    
    .hero-title {
        font-size: 2.3rem;
        line-height: 1.15;
    }
    
    .hero-subtitle {
        font-size: 1.05rem;
        margin-bottom: 2rem;
    }
    
    .cta-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.875rem;
    }
    
    .btn {
        flex: 1;
        min-width: 140px;
        padding: 13px 22px;
    }
    
    .btn-outline {
        margin-left: 0;
    }
    
    .glass-nav {
        width: 94%;
        padding: 0.875rem 1.25rem;
    }
    
    .logo-text {
        font-size: 1.3rem;
    }
}

/* Mobile Large (480px - 575px) */
@media (min-width: 480px) and (max-width: 575px) {
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
    
    .hero {
        padding: 100px 1.25rem 1.75rem;
        min-height: 82vh;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 1.75rem;
        line-height: 1.5;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 0.875rem;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        padding: 14px 20px;
        font-size: 0.9rem;
    }
    
    .glass-nav {
        width: 93%;
        padding: 0.75rem 1rem;
        top: 8px;
    }
    
    .logo-text {
        font-size: 1.2rem;
    }
    
    .hero-visual {
        height: 320px;
        max-width: 380px;
    }
}

/* Mobile Medium (375px - 479px) */
@media (min-width: 375px) and (max-width: 479px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero {
        padding: 95px 1rem 1.5rem;
        min-height: 80vh;
    }
    
    .hero-title {
        font-size: 1.85rem;
        line-height: 1.2;
        margin-bottom: 0.875rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
        line-height: 1.5;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        padding: 13px 18px;
        font-size: 0.875rem;
    }
    
    .glass-nav {
        width: 92%;
        padding: 0.625rem 0.875rem;
        top: 6px;
    }
    
    .logo-text {
        font-size: 1.1rem;
    }
    
    .hero-visual {
        height: 280px;
        max-width: 320px;
    }
    
    .glass-sphere {
        width: 220px;
        height: 220px;
    }
}

/* Mobile Small (320px - 374px) */
@media (max-width: 374px) {
    .container {
        padding-left: 0.875rem;
        padding-right: 0.875rem;
    }
    
    .hero {
        padding: 90px 0.875rem 1.25rem;
        min-height: 78vh;
    }
    
    .hero-title {
        font-size: 1.65rem;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1.25rem;
        line-height: 1.5;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: 0.625rem;
        width: 100%;
    }
    
    .btn {
        width: 100%;
        padding: 12px 16px;
        font-size: 0.8rem;
        letter-spacing: 0.5px;
    }
    
    .glass-nav {
        width: 90%;
        padding: 0.5rem 0.75rem;
        top: 5px;
        border-radius: 10px;
    }
    
    .logo {
        padding: 0.25rem 0.375rem;
    }
    
    .logo-text {
        font-size: 0.95rem;
    }
    
    .mobile-menu-btn {
        width: 40px;
        height: 40px;
        padding: 0.375rem;
    }
    
    .mobile-menu-btn span {
        width: 20px;
        height: 2px;
        margin: 2.5px 0;
    }
    
    .hero-visual {
        height: 250px;
        max-width: 280px;
    }
    
    .glass-sphere {
        width: 200px;
        height: 200px;
    }
}

/* Landscape Orientation Optimization */
@media (max-height: 600px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 100px 2rem 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    .glass-nav {
        padding: 0.625rem 1.25rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-link {
        padding: 0.875rem 1.25rem;
    }
    
    .mobile-menu-btn {
        min-width: 44px;
        min-height: 44px;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: subpixel-antialiased;
    }
}

/* Reduce Motion for Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .fiber-line,
    .glass-sphere,
    .fiber-network {
        animation: none !important;
    }
}

/* Footer Responsive Optimization */
.footer-bottom {
    width: 100%;
}

@media (max-width: 768px) {
    .footer-bottom > .container > div {
        flex-direction: column !important;
        text-align: center !important;
    }
    
    .footer-bottom > .container > div > div:first-child {
        margin-bottom: 1.5rem;
    }
    
    .footer-bottom a {
        font-size: 0.8rem !important;
    }
}

@media (max-width: 576px) {
    .footer-bottom > .container > div {
        padding: 1.5rem 0 !important;
        gap: 1rem !important;
    }
    
    .footer-bottom > .container > div > div:last-child {
        gap: 1rem !important;
    }
    
    .footer-bottom > .container > div > div:last-child span {
        display: none;
    }
    
    .footer-bottom a {
        font-size: 0.75rem !important;
    }
}

/* Print Optimization */
@media print {
    .fiber-background,
    .glass-overlay,
    .mobile-menu,
    .mobile-menu-btn,
    .glass-nav {
        display: none !important;
    }
    
    .hero {
        padding: 2rem 1rem;
        min-height: auto;
    }
    
    body {
        background: white;
        color: black;
    }
}

/* Performance: Reduce animations on low-end devices */
@media (max-width: 768px) {
    .fiber-line {
        display: none;
    }
    
    .glass-sphere {
        animation: none;
    }
}

/* Fix for iOS Safari viewport height */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
}

/* Smooth Scrolling Performance */
@media (prefers-reduced-motion: no-preference) {
    html {
        scroll-behavior: smooth;
    }
}
