/* ============================================
   Recovery UAE - Responsive Stylesheet
   ============================================ */

/* ============================================
   Large Desktop (1400px and above)
   ============================================ */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .hero h1 {
        font-size: 4.5rem;
    }

    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .coverage-grid {
        grid-template-columns: repeat(7, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ============================================
   Desktop (1024px - 1399px)
   ============================================ */
@media (max-width: 1399px) {
    :root {
        --font-size-hero: clamp(2.25rem, 4vw, 3.75rem);
    }

    .container {
        max-width: 1140px;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .coverage-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gulf-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-2xl);
    }
}

/* ============================================
   Tablet Landscape (768px - 1023px)
   ============================================ */
@media (max-width: 1023px) {
    :root {
        --header-height: 70px;
        --space-4xl: 64px;
        --space-3xl: 48px;
    }

    .container {
        max-width: 720px;
    }

    /* Header */
    .nav {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
    }

    .header-actions {
        gap: var(--space-sm);
    }

    .header-actions .btn {
        display: none;
    }

    .header-actions .btn-mobile {
        display: flex;
    }

    /* Hero */
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--space-3xl)) 0 var(--space-3xl);
    }

    .hero-content {
        max-width: 600px;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: var(--space-xl);
    }

    .hero-stat {
        flex: 1 1 40%;
    }

    /* Services */
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-md);
    }

    .service-card {
        padding: var(--space-xl);
    }

    .service-icon {
        width: 60px;
        height: 60px;
    }

    .service-icon svg {
        width: 30px;
        height: 30px;
    }

    /* Coverage */
    .coverage-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .coverage-card {
        height: 220px;
    }

    /* Features */
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }

    .feature-icon {
        width: 64px;
        height: 64px;
    }

    .feature-number {
        font-size: var(--font-size-4xl);
    }

    /* Gulf */
    .gulf-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Blog */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .blog-featured {
        grid-template-columns: 1fr;
    }

    .blog-featured-image {
        height: 250px;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-xl);
    }

    .footer-column:last-child {
        grid-column: span 2;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-md);
        text-align: center;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    /* Gulf Pages */
    .gulf-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Emirate Pages */
    .emirate-services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   Tablet Portrait (768px)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --font-size-hero: clamp(2rem, 6vw, 3rem);
        --space-4xl: 56px;
        --space-3xl: 40px;
        --space-2xl: 32px;
    }

    .container {
        max-width: 100%;
        padding: 0 var(--space-md);
    }

    /* Hero */
    .hero-content {
        max-width: 100%;
    }

    .hero-subtitle {
        font-size: var(--font-size-base);
    }

    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: var(--space-lg);
    }

    .hero-stat {
        flex: none;
        width: 100%;
    }

    /* Services */
    .services-grid {
        grid-template-columns: 1fr;
    }

    .section-header h2 {
        font-size: var(--font-size-3xl);
    }

    /* Coverage */
    .coverage-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .coverage-card {
        height: 200px;
    }

    .coverage-content {
        padding: var(--space-md);
    }

    .coverage-card h3 {
        font-size: var(--font-size-lg);
    }

    /* Features */
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .feature-item {
        display: flex;
        align-items: center;
        gap: var(--space-lg);
        text-align: right;
    }

    [dir="rtl"] .feature-item {
        text-align: left;
    }

    .feature-icon {
        margin: 0;
        flex-shrink: 0;
    }

    .feature-content {
        flex: 1;
    }

    /* Gulf */
    .gulf-grid {
        grid-template-columns: 1fr;
    }

    /* Blog */
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: var(--space-md);
        -webkit-overflow-scrolling: touch;
    }

    .blog-filter {
        flex-shrink: 0;
    }

    /* CTA */
    .cta-actions {
        flex-direction: column;
        width: 100%;
    }

    .cta-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    .footer-column:last-child {
        grid-column: span 1;
    }

    .footer-brand {
        text-align: center;
    }

    .footer-social {
        justify-content: center;
    }

    .footer-column h4 {
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }

    .footer-bottom-links {
        flex-direction: column;
        gap: var(--space-sm);
    }

    /* WhatsApp Float */
    .whatsapp-float {
        bottom: var(--space-md);
        right: var(--space-md);
    }

    [dir="rtl"] .whatsapp-float {
        right: auto;
        left: var(--space-md);
    }

    .whatsapp-btn {
        width: 56px;
        height: 56px;
    }

    /* Emirate Pages */
    .emirate-hero {
        padding: calc(var(--header-height) + var(--space-2xl)) 0 var(--space-2xl);
    }

    .emirate-content h1 {
        font-size: var(--font-size-3xl);
    }

    .emirate-actions {
        flex-direction: column;
    }

    .emirate-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .emirate-services-grid {
        grid-template-columns: 1fr;
    }

    /* Gulf Pages */
    .gulf-info-grid {
        grid-template-columns: 1fr;
    }

    .gulf-tips-list {
        gap: var(--space-md);
    }

    .gulf-tip {
        flex-direction: column;
        text-align: center;
    }

    .gulf-tip-number {
        margin: 0 auto;
    }

    /* Contact */
    .contact-form {
        padding: var(--space-xl);
    }

    /* FAQ */
    .faq-question {
        font-size: var(--font-size-sm);
    }

    /* Page Header */
    .page-header {
        padding: calc(var(--header-height) + var(--space-2xl)) 0 var(--space-2xl);
    }

    .page-header h1 {
        font-size: var(--font-size-3xl);
    }

    /* Blog Featured */
    .blog-featured-image {
        height: 200px;
    }

    .blog-featured-content {
        padding: var(--space-xl);
    }

    .blog-featured-content h2 {
        font-size: var(--font-size-2xl);
    }

    /* Article */
    .article-body {
        font-size: var(--font-size-base);
    }

    h2 {
        font-size: var(--font-size-2xl);
    }

    h3 {
        font-size: var(--font-size-xl);
    }
}

/* ============================================
   Mobile Landscape (480px - 767px)
   ============================================ */
@media (max-width: 767px) {
    :root {
        --font-size-hero: clamp(1.75rem, 7vw, 2.5rem);
        --space-4xl: 48px;
        --space-3xl: 32px;
    }

    .container {
        padding: 0 var(--space-md);
    }

    /* Hero */
    .hero-badge {
        padding: var(--space-xs) var(--space-md);
        font-size: var(--font-size-xs);
    }

    .hero-badge-text {
        font-size: var(--font-size-xs);
    }

    /* Coverage */
    .coverage-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-sm);
    }

    .coverage-card {
        height: 180px;
    }

    /* Services */
    .service-card {
        padding: var(--space-lg);
    }

    .service-card h3 {
        font-size: var(--font-size-base);
    }

    .service-card p {
        font-size: var(--font-size-xs);
    }

    /* Blog */
    .blog-image {
        height: 160px;
    }

    .blog-content {
        padding: var(--space-lg);
    }

    .blog-card h3 {
        font-size: var(--font-size-base);
    }

    .blog-meta {
        font-size: var(--font-size-xs);
    }

    /* Buttons */
    .btn {
        padding: var(--space-sm) var(--space-lg);
        font-size: var(--font-size-sm);
    }

    .btn-lg {
        padding: var(--space-md) var(--space-xl);
        font-size: var(--font-size-base);
    }

    /* Forms */
    .form-input,
    .form-select,
    .form-textarea {
        padding: var(--space-sm) var(--space-md);
        font-size: var(--font-size-sm);
    }

    /* Language Switcher */
    .lang-switch {
        padding: 2px;
    }

    .lang-btn {
        padding: var(--space-xs) var(--space-sm);
        font-size: var(--font-size-xs);
    }

    /* Footer */
    .footer-brand {
        padding-bottom: var(--space-lg);
    }

    .footer-logo {
        justify-content: center;
    }

    .footer-social {
        margin-top: var(--space-md);
    }
}

/* ============================================
   Mobile Portrait (320px - 479px)
   ============================================ */
@media (max-width: 479px) {
    :root {
        --font-size-hero: clamp(1.5rem, 8vw, 2rem);
        --font-size-base: 0.9375rem;
        --space-4xl: 40px;
        --space-3xl: 28px;
    }

    .container {
        padding: 0 var(--space-sm);
    }

    /* Header */
    .logo-icon {
        width: 40px;
        height: 40px;
    }

    .logo-icon svg {
        width: 24px;
        height: 24px;
    }

    .logo-title {
        font-size: var(--font-size-base);
    }

    .logo-subtitle {
        font-size: 0.625rem;
    }

    /* Hero */
    .hero {
        padding: calc(var(--header-height) + var(--space-2xl)) 0 var(--space-2xl);
    }

    .hero-stats {
        padding-top: var(--space-lg);
    }

    .hero-stat-number {
        font-size: var(--font-size-3xl);
    }

    .hero-stat-label {
        font-size: var(--font-size-xs);
    }

    /* Coverage */
    .coverage-grid {
        grid-template-columns: 1fr;
    }

    .coverage-card {
        height: 160px;
    }

    /* Features */
    .feature-icon {
        width: 56px;
        height: 56px;
    }

    .feature-number {
        font-size: var(--font-size-3xl);
    }

    .feature-label {
        font-size: var(--font-size-sm);
    }

    /* Gulf */
    .gulf-card {
        padding: var(--space-lg);
    }

    .gulf-flag {
        width: 64px;
        height: 48px;
        font-size: var(--font-size-2xl);
    }

    /* Blog */
    .blog-image {
        height: 140px;
    }

    .blog-featured-image {
        height: 180px;
    }

    /* Contact */
    .contact-icon {
        width: 48px;
        height: 48px;
    }

    .contact-icon svg {
        width: 24px;
        height: 24px;
    }

    /* Emirate */
    .emirate-badge {
        padding: var(--space-xs) var(--space-md);
    }

    /* FAQ */
    .faq-question {
        padding: var(--space-md);
    }

    .faq-answer-inner {
        padding: 0 var(--space-md) var(--space-md);
        font-size: var(--font-size-sm);
    }

    /* Page Header */
    .page-header {
        padding: calc(var(--header-height) + var(--space-xl)) 0 var(--space-xl);
    }

    .breadcrumb {
        font-size: var(--font-size-xs);
    }
}

/* ============================================
   Extra Small Devices (under 320px)
   ============================================ */
@media (max-width: 319px) {
    :root {
        --font-size-hero: 1.25rem;
        --font-size-base: 0.875rem;
    }

    .hero-actions {
        gap: var(--space-sm);
    }

    .btn {
        padding: var(--space-sm) var(--space-md);
    }

    .coverage-card h3 {
        font-size: var(--font-size-base);
    }

    .service-card h3 {
        font-size: var(--font-size-sm);
    }
}

/* ============================================
   High DPI Displays
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Crisp rendering for high DPI displays */
    .logo-icon svg,
    .service-icon svg,
    .feature-icon svg {
        shape-rendering: geometricPrecision;
    }
}

/* ============================================
   Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .hero-badge-dot {
        animation: none;
    }

    .whatsapp-btn {
        animation: none;
    }

    .hero-glow {
        animation: none;
    }
}

/* ============================================
   Dark Mode (System Preference)
   ============================================ */
@media (prefers-color-scheme: dark) {
    /* Already dark by default, but ensuring consistency */
    :root {
        color-scheme: dark;
    }
}

/* ============================================
   Light Mode Override (if needed)
   ============================================ */
@media (prefers-color-scheme: light) {
    /* Optional: Can be customized for light mode */
    /* body {
        background-color: #f8f9fa;
        color: #1a1a1a;
    } */
}

/* ============================================
   Touch Device Optimizations
   ============================================ */
@media (hover: none) and (pointer: coarse) {
    /* Touch-specific styles */
    .dropdown:hover .dropdown-menu {
        opacity: 0;
        visibility: hidden;
    }

    .dropdown.active .dropdown-menu {
        opacity: 1;
        visibility: visible;
    }

    .service-card .btn {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-link:hover {
        color: var(--text-primary);
    }

    /* Remove hover effects on touch */
    .service-card:hover {
        transform: none;
    }

    .coverage-card:hover {
        transform: none;
    }

    .coverage-card:hover .coverage-bg {
        transform: none;
    }
}

/* ============================================
   Landscape Orientation on Mobile
   ============================================ */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: calc(var(--header-height) + var(--space-xl)) 0 var(--space-xl);
    }

    .hero-content {
        padding-top: 0;
    }

    .hero h1 {
        font-size: var(--font-size-3xl);
    }

    .hero-stats {
        margin-top: var(--space-xl);
        padding-top: var(--space-lg);
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    :root {
        --dark: #ffffff;
        --text-primary: #000000;
        --text-secondary: #333333;
    }

    .header,
    .footer,
    .whatsapp-float,
    .mobile-nav,
    .btn,
    .hero-actions,
    form {
        display: none !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
    }

    .hero {
        min-height: auto;
        padding: 0;
    }

    .section {
        padding: 20pt 0;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
}
