/* U4Ea - Enhanced Responsive Styles */

/* Mobile First Approach */

/* Extra Small Devices (phones, less than 576px) */
@media (max-width: 575.98px) {
    /* Typography */
    h1 {
        font-size: 2.25rem !important;
        line-height: 1.2;
    }
    
    h2 {
        font-size: 1.875rem !important;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.5rem !important;
    }
    
    /* Spacing */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    section {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    /* Navigation */
    #navbar .nav-link {
        font-size: 1.125rem;
    }
    
    /* Hero Section */
    .hero-title {
        font-size: 2.5rem;
    }
    
    /* Buttons */
    .cta-button {
        width: 100%;
        justify-content: center;
    }
    
    /* Cards */
    .feature-card,
    .testimonial-slide > div {
        padding: 1.5rem;
    }
    
    /* Grid Adjustments */
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    /* Interactive Form */
    .feeling-btn,
    .boost-btn,
    .activity-btn {
        font-size: 0.875rem;
        padding: 0.625rem 1rem;
    }
}

/* Small Devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px;
    }
}

/* Medium Devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px;
    }
    
    /* Adjust grid for tablets */
    .md\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Large Devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
}

/* Extra Large Devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .hover\:scale-105:hover {
        transform: scale(1);
    }
    
    /* Disable parallax on touch devices for performance */
    .parallax-bg {
        transform: none !important;
        position: relative;
    }
}

/* Landscape Orientation */
@media (orientation: landscape) and (max-height: 600px) {
    /* Reduce hero height in landscape */
    #home {
        min-height: 100vh;
        padding: 6rem 0 2rem;
    }
    
    /* Adjust section padding */
    section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

/* Portrait Orientation (tablets) */
@media (orientation: portrait) and (min-width: 768px) {
    /* Optimize for portrait tablets */
    .grid {
        gap: 2rem;
    }
}

/* Foldable Devices */
@media (min-width: 280px) and (max-width: 653px) {
    /* Handle narrow foldable screens */
    .flex-col {
        gap: 0.5rem;
    }
}

/* High Resolution Displays */
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
    /* Optimize for retina displays */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Media */
@media print {
    /* Hide non-essential elements */
    nav,
    footer,
    .no-print,
    button,
    #particles {
        display: none !important;
    }
    
    /* Optimize for printing */
    section {
        page-break-inside: avoid;
    }
    
    /* Show all content */
    .hidden {
        display: block !important;
    }
}

/* iOS Specific */
@supports (-webkit-touch-callout: none) {
    /* Fix iOS Safari issues */
    body {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix input zoom on iOS */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* Android Specific */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    /* Android optimizations */
    select {
        background-image: none;
    }
}

/* Notch/Safe Area Support (iPhone X+) */
@supports (padding: max(0px)) {
    body {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
    
    #navbar {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
}

/* Specific Device Breakpoints */

/* iPhone SE */
@media (max-width: 375px) {
    h1 {
        font-size: 2rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
}

/* iPhone 12/13/14 */
@media (min-width: 390px) and (max-width: 430px) {
    .container {
        padding-left: 1.25rem;
        padding-right: 1.25rem;
    }
}

/* iPad Mini */
@media (min-width: 744px) and (max-width: 768px) {
    /* Specific iPad mini optimizations */
    .grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* iPad Pro */
@media (min-width: 1024px) and (max-width: 1366px) {
    /* iPad Pro optimizations */
    .container {
        max-width: 90%;
    }
}

/* Ultra-wide Screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1400px;
    }
}

/* Performance Optimizations for Low-End Devices */
@media (max-width: 768px) {
    /* Disable expensive animations on mobile */
    .particle {
        display: none;
    }
    
    /* Simplify animations */
    * {
        animation-duration: 0.3s !important;
    }
}

/* Accessibility: Large Text Mode */
@media (min-width: 1px) {
    html.large-text {
        font-size: 125%;
    }
    
    html.extra-large-text {
        font-size: 150%;
    }
}

/* Screen Reader Only Class */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Within for Better Accessibility */
.group:focus-within {
    outline: 2px solid #00A1E2;
    outline-offset: 2px;
}

/* Better tap highlighting */
* {
    -webkit-tap-highlight-color: rgba(0, 174, 100, 0.2);
}

/* Smooth Font Rendering */
@media screen and (min-width: 768px) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        text-rendering: optimizeLegibility;
    }
}

/* Prevent text inflation on mobile */
@media (max-width: 768px) {
    body {
        text-size-adjust: 100%;
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
    }
}

