/* BluemarkSA - Styles Responsive */

/* Mobile First Approach */

/* Extra Small devices (phones, moins de 576px) */
@media (max-width: 575.98px) {
    /* Typography mobile */
    h1 {
        font-size: 2rem;
        line-height: 1.1;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    h3 {
        font-size: 1.5rem;
    }
    
    /* Spacing mobile */
    .py-20 {
        padding-top: 3rem !important;
        padding-bottom: 3rem !important;
    }
    
    .py-16 {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    /* Container mobile */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Navigation mobile */
    #navbar .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Hero section mobile */
    #home {
        min-height: 100vh;
        padding-top: 5rem;
        padding-bottom: 2rem;
    }
    
    #home .max-w-4xl {
        max-width: 100%;
    }
    
    #home h1 {
        font-size: 2.25rem;
        margin-bottom: 1.5rem;
    }
    
    #home p {
        font-size: 1.125rem;
        margin-bottom: 2rem;
    }
    
    /* Buttons mobile */
    .flex.flex-col.sm\\:flex-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .flex.flex-col.sm\\:flex-row button {
        width: 100%;
        text-align: center;
    }
    
    /* Cards mobile */
    .grid.grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    /* Services section mobile */
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Connect Africa & Spa sections mobile */
    .grid.grid-cols-1.lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    /* Contact section mobile */
    #contact .grid.grid-cols-1.lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    #contact .bg-gray-800 {
        padding: 1.5rem;
    }
    
    /* Form mobile */
    .grid.grid-cols-1.sm\\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
    
    /* Footer mobile */
    footer .grid.grid-cols-1.md\\:grid-cols-4 {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    footer .md\\:col-span-2 {
        grid-column: span 1;
    }
    
    /* Social media mobile */
    .flex.space-x-4 {
        justify-content: center;
    }
    
    /* Stats mobile */
    .grid.grid-cols-2 {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    .stats-number {
        font-size: 2rem;
    }
    
    /* Spa gallery mobile */
    #spa-gallery.grid.grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
}

/* Small devices (landscape phones, 576px and up) */
@media (min-width: 576px) and (max-width: 767.98px) {
    /* Hero adjustments */
    #home h1 {
        font-size: 2.5rem;
    }
    
    #home p {
        font-size: 1.25rem;
    }
    
    /* Cards grid */
    .grid.grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    /* Services */
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    /* Form improvements */
    .grid.grid-cols-1.sm\\:grid-cols-2 {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }
    
    /* Spa gallery */
    #spa-gallery.grid.grid-cols-2 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) and (max-width: 991.98px) {
    /* Navigation */
    .hidden.md\\:flex {
        display: flex;
    }
    
    .md\\:hidden {
        display: none;
    }
    
    /* Hero */
    #home h1 {
        font-size: 3rem;
    }
    
    #home p {
        font-size: 1.375rem;
    }
    
    /* Buttons */
    .flex.flex-col.sm\\:flex-row {
        flex-direction: row;
        justify-content: center;
    }
    
    /* Cards */
    .grid.grid-cols-1.md\\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Services */
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Two column layouts */
    .grid.grid-cols-1.lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    /* Footer */
    footer .grid.grid-cols-1.md\\:grid-cols-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    footer .md\\:col-span-2 {
        grid-column: span 2;
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    /* Hero */
    #home h1 {
        font-size: 3.5rem;
    }
    
    #home p {
        font-size: 1.5rem;
    }
    
    /* Services full grid */
    .grid.grid-cols-1.md\\:grid-cols-2.lg\\:grid-cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* Two column layouts */
    .grid.grid-cols-1.lg\\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
    
    /* Container adjustments */
    .container {
        max-width: 1140px;
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    /* Full desktop experience */
    .container {
        max-width: 1200px;
    }
    
    #home h1 {
        font-size: 4rem;
    }
    
    #home p {
        font-size: 1.5rem;
    }
    
    /* Enhanced spacing */
    .py-20 {
        padding-top: 5rem;
        padding-bottom: 5rem;
    }
}

/* Landscape orientation adjustments */
@media (orientation: landscape) and (max-height: 600px) {
    #home {
        min-height: 100vh;
        padding-top: 4rem;
        padding-bottom: 1rem;
    }
    
    #home h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
    }
    
    #home p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .py-20 {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Enhanced text rendering */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    /* Crisper borders */
    .card, .form-input, .btn-primary, .btn-secondary {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Print media */
@media print {
    /* Hide non-essential elements */
    nav, footer, .mobile-menu, #mobile-menu-btn {
        display: none !important;
    }
    
    /* Optimize for print */
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
    
    /* Remove colors and backgrounds for print */
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
    }
    
    /* Ensure content fits on page */
    .container {
        max-width: none !important;
        padding: 0 !important;
    }
    
    /* Page breaks */
    section {
        page-break-before: auto;
        page-break-after: auto;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    /* Disable animations for users who prefer reduced motion */
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Dark mode support (if needed in the future) */
@media (prefers-color-scheme: dark) {
    :root {
        --text-dark: #f9fafb;
        --text-light: #d1d5db;
        --white: #111827;
        --gray-100: #1f2937;
        --gray-800: #f3f4f6;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-link, button, .social-link {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    .card:hover, .btn-primary:hover, .gallery-item:hover {
        transform: none;
    }
    
    /* Simplify interactions */
    .icon-container:hover::before {
        transform: none;
    }
}

/* Ultra-wide screens */
@media (min-width: 1600px) {
    .container {
        max-width: 1400px;
    }
    
    /* Prevent content from becoming too stretched */
    .max-w-4xl {
        max-width: 56rem !important;
    }
    
    .max-w-6xl {
        max-width: 72rem !important;
    }
}

/* Small height devices (landscape phones) */
@media (max-height: 500px) and (orientation: landscape) {
    #home {
        min-height: auto;
        padding-top: 6rem;
        padding-bottom: 2rem;
    }
    
    .py-20 {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    
    #home h1 {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    #home p {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
}

/* iPad specific adjustments */
@media only screen 
    and (min-device-width: 768px) 
    and (max-device-width: 1024px) 
    and (-webkit-min-device-pixel-ratio: 1) {
    
    /* Optimize for iPad */
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
    
    /* Better touch targets */
    button, .nav-link, .social-link {
        min-height: 48px;
    }
}

/* iPhone X and similar (with notch) */
@media only screen 
    and (device-width: 375px) 
    and (device-height: 812px) 
    and (-webkit-device-pixel-ratio: 3) {
    
    /* Account for safe areas */
    #navbar {
        padding-top: env(safe-area-inset-top);
    }
    
    #home {
        padding-top: calc(4rem + env(safe-area-inset-top));
    }
}

/* Foldable devices */
@media (min-width: 720px) and (max-width: 1024px) and (orientation: portrait) {
    /* Optimize for unfolded portrait mode */
    .grid.grid-cols-1.lg\\:grid-cols-2 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* Performance optimizations for mobile */
@media (max-width: 768px) {
    /* Reduce expensive effects on mobile */
    .card::before, .btn-primary::before, .icon-container::before {
        display: none;
    }
    
    /* Simplify animations */
    .animate-bounce-hover:hover {
        animation: none;
    }
    
    /* Optimize images */
    img {
        image-rendering: optimizeQuality;
    }
}

/* Container query support (progressive enhancement) */
@supports (container-type: inline-size) {
    .card-container {
        container-type: inline-size;
    }
    
    @container (max-width: 300px) {
        .card {
            padding: 1rem;
        }
        
        .card h3 {
            font-size: 1.125rem;
        }
    }
}