/* Optimisations Mobile Spécifiques */

/* Section d'accueil mobile */
@media (max-width: 768px) {
    .hero {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .hero-content {
        width: 100%;
        max-width: 100%;
        padding: 24px;
    }

    .hero-title {
        font-size: clamp(2rem, 8vw, 3.5rem) !important;
        line-height: 1.15 !important;
        margin-bottom: 24px !important;
        letter-spacing: -0.02em !important;
        word-break: keep-all !important;
        overflow-wrap: anywhere !important;
        hyphens: none !important;
        text-wrap: balance !important;
        padding: 0 14px !important;
        /* Style corporate - pas d'effets néon */
        -webkit-text-fill-color: var(--text-primary) !important;
        background: none !important;
        color: var(--text-primary) !important;
        text-shadow: none !important;
        filter: none !important;
        text-transform: none !important;
    }

    .hero-info {
        display: flex;
        flex-direction: column;
        gap: 25px;
        align-items: center;
        margin-top: 40px;
    }

    .info-item {
        text-align: center;
        max-width: 280px;
        width: 100%;
    }

    .info-icon {
        width: 60px;
        height: 60px;
        font-size: 24px;
        margin: 0 auto 15px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .info-title {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 5px;
        letter-spacing: 0.5px;
    }

    .info-desc {
        font-size: 12px;
        opacity: 0.8;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: clamp(2rem, 14vw, 3.2rem);
        line-height: 1.06;
        margin-bottom: 24px;
        padding: 0 16px;
    }

    .hero-info {
        gap: 20px;
        margin-top: 30px;
    }

    .info-item {
        max-width: 250px;
    }

    .info-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
        margin-bottom: 12px;
    }

    .info-title {
        font-size: 13px;
    }

    .info-desc {
        font-size: 11px;
    }
}

@media (max-width: 320px) {
    .hero-title {
        font-size: clamp(1.8rem, 17vw, 2.6rem);
        line-height: 1.08;
        margin-bottom: 20px;
        padding: 0 16px;
    }

    .hero-info {
        gap: 18px;
        margin-top: 25px;
    }

    .info-item {
        max-width: 220px;
    }

    .info-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
        margin-bottom: 10px;
    }

    .info-title {
        font-size: 12px;
    }

    .info-desc {
        font-size: 10px;
    }
}

/* Optimisations pour les catégories avec défilement horizontal */
@media (max-width: 768px) {
    .portfolio-filters {
        position: relative;
        background: transparent; /* supprimer le fond noir */
    }

    .portfolio-filters::before,
    .portfolio-filters::after {
        content: '';
        position: absolute;
        top: 0;
        bottom: 0;
        width: 24px;
        z-index: 2;
        pointer-events: none;
        display: none; /* masquer les ombres latérales si non désirées */
    }

    .portfolio-filters::before {
        left: 0;
        background: linear-gradient(90deg, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    }

    .portfolio-filters::after {
        right: 0;
        background: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    }

    .filter-btn {
        background: var(--bg-card);
        border: 2px solid var(--border-color);
        color: var(--text-secondary);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;
    }

    .filter-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.2), transparent);
        transition: left 0.5s ease;
    }

    .filter-btn:hover::before,
    .filter-btn:focus::before {
        left: 100%;
    }

    .filter-btn.active {
        background: var(--primary-color);
        border-color: var(--primary-color);
        color: white;
        transform: scale(1.05);
    }

    .filter-btn:active {
        transform: scale(0.95);
    }
}

/* Indicateur de scroll pour les filtres */
@media (max-width: 768px) {
    .portfolio-filters {
        position: relative;
    }

    .scroll-indicator {
        position: absolute;
        bottom: 5px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: rgba(37, 99, 235, 0.3);
        border-radius: 2px;
        opacity: 0.7;
    }

    .scroll-indicator::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        width: 20px;
        background: var(--primary-color);
        border-radius: 2px;
        animation: scrollIndicator 2s ease-in-out infinite;
    }

    @keyframes scrollIndicator {
        0%, 100% { transform: translateX(0); }
        50% { transform: translateX(20px); }
    }
}

/* Optimisations pour la page de projet mobile */
@media (max-width: 768px) {
    .project-modal {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1000;
        background: var(--bg-primary);
    }

    .project-modal-content {
        height: 100vh;
        display: flex;
        flex-direction: column;
        background: var(--bg-primary);
    }

    .project-modal-header {
        flex-shrink: 0;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-card);
    }

    .project-modal-body {
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: var(--bg-primary);
    }

    /* Galerie mobile optimisée */
    .project-gallery {
        margin: 0;
    }

    .gallery-main-image {
        position: relative;
        background: var(--bg-secondary);
        border-radius: 0;
        border: 1px solid var(--border-color);
    }

    .gallery-current-image {
        width: 100%;
        height: auto;
        object-fit: contain;
        display: block;
    }

    /* Contrôles de galerie mobile */
    .gallery-controls {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        border-radius: 8px;
        padding: 10px 20px;
        display: flex;
        align-items: center;
        gap: 15px;
        box-shadow: var(--shadow-md);
    }

    .gallery-prev,
    .gallery-next {
        background: var(--primary-color);
        border: none;
        color: white;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .gallery-prev:hover,
    .gallery-next:hover {
        background: var(--primary-dark);
        transform: scale(1.1);
    }

    .gallery-counter {
        color: var(--text-primary);
        font-weight: 600;
        min-width: 50px;
        text-align: center;
    }

    /* Thumbnails mobile */
    .gallery-thumbnails {
        background: var(--bg-secondary);
        margin: 0;
        padding: 20px 0;
        position: relative;
        border-top: 1px solid var(--border-color);
    }

    .gallery-thumbnails-container {
        display: flex;
        gap: 10px;
        padding: 0 50px;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .gallery-thumb {
        scroll-snap-align: center;
        border: 2px solid transparent;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        opacity: 0.6;
    }

    .gallery-thumb:hover,
    .gallery-thumb.active {
        border-color: var(--primary-color);
        opacity: 1;
        transform: scale(1.05);
    }

    /* Navigation des thumbnails */
    .gallery-slider-nav {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: var(--primary-color);
        border: none;
        color: white;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 3;
    }

    .gallery-slider-nav:hover {
        background: var(--primary-dark);
        transform: translateY(-50%) scale(1.1);
    }

    .gallery-slider-nav.prev {
        left: 10px;
    }

    .gallery-slider-nav.next {
        right: 10px;
    }

    .gallery-slider-nav:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }
}

/* Optimisations pour les très petits écrans */
@media (max-width: 480px) {
    .gallery-controls {
        bottom: 15px;
        padding: 8px 16px;
        gap: 12px;
    }

    .gallery-prev,
    .gallery-next {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .gallery-counter {
        font-size: 12px;
        min-width: 45px;
    }

    .gallery-thumbnails {
        padding: 15px 0;
    }

    .gallery-thumbnails-container {
        padding: 0 40px;
        gap: 8px;
    }

    .gallery-thumb {
        width: 60px;
        height: 35px;
    }

    .gallery-slider-nav {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .gallery-slider-nav.prev {
        left: 8px;
    }

    .gallery-slider-nav.next {
        right: 8px;
    }
}

/* Optimisations pour l'orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .project-modal-header {
        padding: 10px 25px;
    }

    .project-modal-header h2 {
        font-size: 18px;
    }

    .back-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .project-modal-body {
        padding: 15px 25px;
    }

    .gallery-current-image {
        max-height: 80vh;
    }

    .gallery-controls {
        bottom: 10px;
        padding: 6px 12px;
    }

    .gallery-thumbnails {
        padding: 10px 0;
    }

    .gallery-thumb {
        width: 80px;
        height: 45px;
    }
}

/* Améliorations pour le scroll tactile */
@media (hover: none) and (pointer: coarse) {
    .portfolio-filters {
        scroll-snap-type: x proximity;
    }

    .filter-btn {
        scroll-snap-align: center;
        touch-action: pan-x;
    }

    .gallery-thumbnails-container {
        scroll-snap-type: x proximity;
    }

    .gallery-thumb {
        scroll-snap-align: center;
        touch-action: pan-x;
    }

    /* Indicateur visuel pour le scroll */
    .portfolio-filters::-webkit-scrollbar {
        height: 4px;
        display: block;
    }

    .portfolio-filters::-webkit-scrollbar-track {
        background: var(--bg-secondary);
        border-radius: 0;
    }

    .portfolio-filters::-webkit-scrollbar-thumb {
        background: var(--primary-color);
        border-radius: 0;
    }

    .portfolio-filters::-webkit-scrollbar-thumb:hover {
        background: var(--primary-dark);
    }
}

/* Animations d'entrée pour mobile */
@media (max-width: 768px) {
    .hero-title {
        animation: fadeInUp 1s ease-out;
    }

    .hero-info {
        animation: fadeInUp 1s ease-out 0.3s both;
    }

    .portfolio-filters {
        animation: slideInUp 0.8s ease-out 0.5s both;
    }

    .portfolio-grid {
        animation: fadeIn 1s ease-out 0.7s both;
    }

    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes slideInUp {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
}

/* Optimisations pour les écrans haute densité */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .filter-btn {
        border-width: 1px;
    }

    .gallery-thumb {
        border-width: 1px;
    }

    .gallery-slider-nav {
        border-width: 1px;
    }
} 