/* ===================================
   Mohamed Tours - CSS Responsive
   Optimisation pour tous les appareils
   =================================== */

/* Extra Large Devices (1400px+) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    .excursions-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Devices (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
    .container {
        max-width: 1140px;
    }
    
    .excursions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Medium Large Devices (992px - 1199px) */
@media (min-width: 992px) and (max-width: 1199px) {
    .container {
        max-width: 960px;
    }
    
    /* Navigation Adjustments */
    .nav-menu {
        gap: var(--spacing-lg);
    }
    
    .nav-link {
        font-size: 0.875rem;
    }
    
    /* Hero Adjustments */
    .hero-title {
        font-size: 3.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    /* Grid Adjustments */
    .excursions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-xl);
    }
    
    .gallery .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* About Section */
    .about-stats {
        gap: var(--spacing-lg);
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    /* Contact Form */
    .contact-info {
        padding-left: var(--spacing-md);
    }
}

/* Medium Devices (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .container {
        max-width: 720px;
    }
    
    /* Layout Adjustments */
    .col-lg-6, .col-lg-4, .col-lg-3, .col-lg-8 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: var(--spacing-xl);
    }
    
    /* Navigation */
    .navbar {
        padding: var(--spacing-sm) 0;
    }
    
    .nav-menu {
        gap: var(--spacing-md);
    }
    
    /* Hero Section */
    .hero {
        min-height: 500px;
    }
    
    .hero-title {
        font-size: 3rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: var(--spacing-xl);
    }
    
    .hero-actions {
        gap: var(--spacing-md);
    }
    
    /* Sections */
    section {
        padding: var(--spacing-2xl) 0;
    }
    
    .section-title {
        font-size: 2.25rem;
    }
    
    /* Features */
    .feature-card {
        padding: var(--spacing-xl);
        margin-bottom: var(--spacing-lg);
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    /* Excursions */
    .excursions-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .excursion-card {
        max-width: 500px;
        margin: 0 auto;
    }
    
    /* About Section */
    .about-content {
        padding-right: 0;
        margin-bottom: var(--spacing-xl);
    }
    
    .about-stats {
        justify-content: center;
        margin-bottom: var(--spacing-xl);
    }
    
    .about-media {
        text-align: center;
    }
    
    /* Gallery */
    .gallery .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gallery-filter {
        gap: var(--spacing-xs);
    }
    
    .filter-btn {
        padding: var(--spacing-xs) var(--spacing-sm);
        font-size: 0.75rem;
    }
    
    /* Contact */
    .contact-info {
        padding-left: 0;
        margin-top: var(--spacing-xl);
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }
    
    /* Footer */
    .footer-content .row > [class*="col-"] {
        margin-bottom: var(--spacing-lg);
    }
}

/* Small Devices (576px - 767px) */
@media (min-width: 576px) and (max-width: 767px) {
    .container {
        max-width: 540px;
    }
    
    /* Navigation Mobile */
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        align-items: flex-start;
        padding: var(--spacing-xl);
        box-shadow: var(--shadow-xl);
        transform: translateY(-100vh);
        transition: transform var(--transition-normal);
        z-index: 998;
    }
    
    .nav-menu.active {
        transform: translateY(0);
    }
    
    .nav-item {
        width: 100%;
        border-bottom: 1px solid var(--border);
        padding-bottom: var(--spacing-sm);
        margin-bottom: var(--spacing-sm);
    }
    
    .nav-item:last-child {
        border-bottom: none;
        margin-bottom: 0;
    }
    
    .nav-link {
        font-size: 1.125rem;
        padding: var(--spacing-sm) 0;
    }
    
    .nav-toggle {
        display: flex;
        z-index: 999;
    }
    
    .nav-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    
    .nav-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    
    .nav-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
    
    /* Dropdown Mobile */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--light-gray);
        margin-top: var(--spacing-sm);
    }
    
    /* Hero Mobile */
    .hero {
        min-height: 600px;
        height: auto;
        padding: 100px 0 var(--spacing-2xl);
    }
    
    .hero-slide {
        background-attachment: scroll;
    }
    
    .hero-title {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-actions {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .hero-nav {
        bottom: 20px;
        right: 20px;
    }
    
    .hero-prev,
    .hero-next {
        width: 40px;
        height: 40px;
        font-size: 0.875rem;
    }
    
    .scroll-down {
        bottom: 20px;
    }
    
    /* Sections Mobile */
    section {
        padding: var(--spacing-xl) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-2xl);
    }
    
    .section-title {
        font-size: 2rem;
        line-height: 1.2;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    /* Features Mobile */
    .features .row {
        gap: var(--spacing-lg);
    }
    
    .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .feature-card {
        padding: var(--spacing-lg);
        max-width: 300px;
        margin: 0 auto var(--spacing-lg);
    }
    
    /* Excursions Mobile */
    .special-offer {
        padding: var(--spacing-xl);
        margin-bottom: var(--spacing-2xl);
    }
    
    .excursions-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .excursion-image {
        height: 200px;
    }
    
    .excursion-actions {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .group-details {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
        text-align: center;
    }
    
    .group-detail {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    /* About Mobile */
    .about-stats {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }
    
    .about-skills ul,
    .language-badges {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .about-contact {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }
    
    .contact-info {
        align-self: stretch;
    }
    
    .video-intro {
        margin-top: var(--spacing-lg);
    }
    
    /* Portfolio Mobile */
    .testimonials-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .gallery .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .certificates-grid {
        grid-template-columns: 1fr;
    }
    
    .certificate-item {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
    
    .destinations-list {
        grid-template-columns: 1fr;
    }
    
    /* Gallery Mobile */
    .gallery-filter {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .filter-btn {
        flex: 1;
        min-width: 80px;
        max-width: 120px;
    }
    
    /* Contact Mobile */
    .contact .row {
        flex-direction: column-reverse;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .platform-links {
        gap: var(--spacing-xs);
    }
    
    /* Footer Mobile */
    .footer-legal {
        justify-content: center;
        margin-top: var(--spacing-md);
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
}

/* Extra Small Devices (320px - 575px) */
@media (max-width: 575px) {
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-sm);
    }
    
    /* Language Switcher Mobile */
    .language-switcher {
        top: 10px;
        right: 10px;
        padding: 2px;
    }
    
    .lang-btn {
        padding: 4px 6px;
        font-size: 0.75rem;
    }
    
    .lang-btn img {
        width: 12px;
        height: 9px;
    }
    
    /* Header Mobile */
    .header {
        padding: 0;
    }
    
    .navbar {
        padding: var(--spacing-sm) 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .logo i {
        font-size: 1.5rem;
    }
    
    /* Hero Extra Small */
    .hero {
        min-height: 500px;
        padding: 80px 0 var(--spacing-xl);
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: var(--spacing-md);
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: var(--spacing-xl);
    }
    
    .btn-lg {
        padding: var(--spacing-sm) var(--spacing-lg);
        font-size: 0.875rem;
    }
    
    /* Typography Mobile */
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    h4 { font-size: 1.25rem; }
    h5 { font-size: 1.125rem; }
    h6 { font-size: 1rem; }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .section-subtitle {
        font-size: 0.75rem;
    }
    
    /* Spacing Adjustments */
    section {
        padding: var(--spacing-lg) 0;
    }
    
    .section-header {
        margin-bottom: var(--spacing-xl);
    }
    
    /* Cards Mobile */
    .feature-card,
    .excursion-card,
    .contact-card,
    .social-booking,
    .quick-response {
        margin-bottom: var(--spacing-md);
    }
    
    .feature-card {
        padding: var(--spacing-md);
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
        margin-bottom: var(--spacing-md);
    }
    
    /* Excursions Extra Small */
    .special-offer {
        padding: var(--spacing-lg);
    }
    
    .excursion-image {
        height: 180px;
    }
    
    .excursion-content {
        padding: var(--spacing-md);
    }
    
    .excursion-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs);
    }
    
    .excursion-title {
        font-size: 1.25rem;
    }
    
    .excursion-rating {
        text-align: left;
    }
    
    .group-info {
        padding: var(--spacing-lg);
    }
    
    /* About Extra Small */
    .about-image img {
        height: 300px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .language-badges {
        gap: var(--spacing-xs);
    }
    
    .language-badge {
        font-size: 0.7rem;
        padding: 4px 8px;
    }
    
    /* Portfolio Extra Small */
    .portfolio-title {
        font-size: 1.5rem;
    }
    
    .testimonial-card {
        padding: var(--spacing-lg);
    }
    
    .gallery-item img {
        height: 180px;
    }
    
    .certificate-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    /* Gallery Extra Small */
    .gallery .gallery-item img {
        height: 200px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 0.7rem;
        flex: none;
        min-width: 60px;
    }
    
    .gallery-btn {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .play-button {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    /* Contact Extra Small */
    .contact-form,
    .contact-card {
        padding: var(--spacing-lg);
    }
    
    .contact-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    /* Footer Extra Small */
    .footer {
        padding: var(--spacing-xl) 0 var(--spacing-lg);
    }
    
    .footer-content {
        margin-bottom: var(--spacing-lg);
    }
    
    .footer-section {
        margin-bottom: var(--spacing-lg);
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
        margin-bottom: var(--spacing-md);
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .cert-badges {
        justify-content: center;
    }
    
    /* Utility Mobile */
    .back-to-top,
    .whatsapp-float a {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .whatsapp-float {
        bottom: 70px;
        right: 15px;
    }
    
    .back-to-top {
        bottom: 15px;
        right: 15px;
    }
    
    /* Lightbox Mobile */
    .lightbox-modal {
        padding: var(--spacing-sm);
    }
    
    .lightbox-close {
        top: -40px;
        font-size: 1.5rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo i,
    .feature-icon,
    .certificate-icon,
    .contact-icon {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* 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-down {
        animation: none;
    }
    
    .whatsapp-float a {
        animation: none;
    }
    
    .loading-spinner {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .header,
    .hero-nav,
    .scroll-down,
    .back-to-top,
    .whatsapp-float,
    .loading-screen,
    .language-switcher {
        display: none !important;
    }
    
    .hero {
        height: auto;
        min-height: auto;
        page-break-after: always;
    }
    
    .excursion-card,
    .testimonial-card,
    .certificate-item {
        break-inside: avoid;
        page-break-inside: avoid;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
    }
    
    .btn {
        border: 1pt solid #000;
        color: #000 !important;
        text-decoration: none;
    }
}

/* Dark Mode Support (if needed later) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here if requested */
}

/* Landscape Mobile */
@media (max-width: 767px) and (orientation: landscape) {
    .hero {
        min-height: 400px;
        padding: 60px 0 var(--spacing-lg);
    }
    
    .hero-title {
        font-size: 2rem;
        margin-bottom: var(--spacing-sm);
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: var(--spacing-md);
    }
    
    .hero-actions {
        gap: var(--spacing-sm);
    }
    
    .btn-lg {
        padding: var(--spacing-xs) var(--spacing-md);
        font-size: 0.875rem;
    }
}

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

/* Focus Styles for Accessibility */
@media (min-width: 768px) {
    .btn:focus,
    .nav-link:focus,
    input:focus,
    select:focus,
    textarea:focus,
    button:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Hover Effects for Touch Devices */
@media (hover: none) {
    .excursion-card:hover,
    .gallery-item:hover,
    .feature-card:hover {
        transform: none;
    }
    
    .gallery .gallery-overlay {
        opacity: 1;
    }
    
    .gallery-overlay {
        transform: translateY(0);
    }
}