/* ===================================
   OPTIMISATIONS MOBILE COMPLÈTES
   ================================= */

/* Amélioration des performances mobile */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container mobile */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

/* Header Mobile Amélioré */
@media (max-width: 968px) {
    .site-header {
        padding: 1rem 0;
    }
    
    .logo {
        font-size: 1.25rem;
    }
    
    .mobile-menu-toggle {
        z-index: 1001;
    }
    
    .main-nav {
        z-index: 999;
        height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .main-nav ul {
        width: 100%;
        text-align: center;
    }
    
    .main-nav a {
        font-size: 1.1rem;
        padding: 0.75rem 0;
    }
    
    .cta-button {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

/* Hero Section Mobile */
@media (max-width: 768px) {
    .hero {
        padding-top: 100px;
        padding-bottom: 3rem;
    }
    
    .hero-content {
        gap: 2rem;
    }
    
    .hero-text h1 {
        font-size: 2rem;
        line-height: 1.3;
    }
    
    .subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .hero-badges {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .badge {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .badge-icon {
        width: 16px;
        height: 16px;
    }
    
    .hero-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .hero-image-container {
        max-width: 100%;
    }
    
    .hero-visual {
        order: -1;
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 1.75rem;
    }
    
    .subtitle {
        font-size: 0.9rem;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Projets Phares Mobile */
@media (max-width: 768px) {
    .section-header-projects h2 {
        font-size: 1.75rem;
    }
    
    .projects-slider-container {
        min-height: auto;
    }
    
    /* Teranga Pass Mobile */
    .teranga-pass-content {
        gap: 2rem;
        padding: 2rem 0;
    }
    
    .teranga-title {
        font-size: 2rem;
    }
    
    .teranga-subtitle {
        font-size: 1.1rem;
    }
    
    .teranga-description {
        font-size: 1rem;
        line-height: 1.6;
    }
    
    .teranga-features {
        gap: 0.75rem;
    }
    
    .teranga-feature {
        font-size: 0.9rem;
    }
    
    .feature-check {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
    }
    
    .tech-tags {
        gap: 0.5rem;
    }
    
    .tech-tag-tp {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .teranga-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-teranga-primary,
    .btn-teranga-secondary {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    /* Phone Mockup Mobile */
    .teranga-carousel-only {
        max-width: 100%;
    }
    
    .phone-mockup-container {
        width: 280px;
        height: 560px;
        padding: 12px;
    }
    
    .phone-mockup-container::before {
        width: 80px;
        height: 22px;
        top: 22px;
    }
    
    .carousel-image-teranga {
        width: 85%;
        max-height: 85%;
    }
    
    .teranga-floating-stats {
        margin-top: 1.5rem;
    }
    
    .stat-card {
        padding: 10px 12px;
        font-size: 0.85rem;
    }
    
    .stat-icon {
        font-size: 20px;
    }
    
    .stat-number {
        font-size: 14px;
    }
    
    .stat-text {
        font-size: 10px;
    }
    
    /* DISLAB Mobile */
    .dislab-content {
        padding: 2rem 0;
    }
    
    .dislab-title {
        font-size: 2rem;
    }
    
    .dislab-subtitle {
        font-size: 1.1rem;
    }
    
    .dislab-description {
        font-size: 1rem;
    }
    
    .dislab-feature {
        font-size: 0.9rem;
    }
    
    .tech-tag-dislab {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .dislab-cta {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-dislab-primary,
    .btn-dislab-secondary {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .browser-mockup {
        margin: 0;
    }
    
    .browser-header {
        padding: 8px 10px;
    }
    
    .browser-dots span {
        width: 10px;
        height: 10px;
    }
    
    .browser-url {
        font-size: 0.75rem;
        padding: 4px 10px;
    }
    
    .dislab-screenshot {
        height: 300px;
    }
    
    .dislab-floating-stats {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 20px;
    }
    
    /* Navigation Slider Mobile */
    .projects-slider-nav {
        padding: 30px 0 40px;
        gap: 20px;
    }
    
    .slider-nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .slider-nav-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .slider-dots .dot {
        width: 10px;
        height: 10px;
    }
    
    .slider-dots .dot.active {
        width: 30px;
    }
}

@media (max-width: 480px) {
    .teranga-title,
    .dislab-title {
        font-size: 1.75rem;
    }
    
    .teranga-subtitle,
    .dislab-subtitle {
        font-size: 1rem;
    }
    
    .teranga-description,
    .dislab-description {
        font-size: 0.9rem;
    }
    
    .phone-mockup-container {
        width: 240px;
        height: 480px;
    }
    
    .dislab-screenshot {
        height: 250px;
    }
}

/* Sections communes Mobile */
@media (max-width: 768px) {
    .section-header {
        margin-bottom: 2.5rem;
    }
    
    .section-header h2 {
        font-size: 1.75rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
    
    .section-tag {
        font-size: 0.8rem;
        letter-spacing: 1px;
    }
}

/* Expertise Section Mobile */
@media (max-width: 768px) {
    .expertise-section {
        padding: 3rem 0;
    }
    
    .expertise-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .expertise-card {
        padding: 2rem;
    }
    
    .expertise-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .expertise-card h3 {
        font-size: 1.25rem;
    }
    
    .expertise-card p {
        font-size: 0.95rem;
    }
    
    .expertise-tags span {
        font-size: 0.8rem;
        padding: 0.3rem 0.8rem;
    }
}

/* Plugins Section Mobile */
@media (max-width: 768px) {
    .plugins-section {
        padding: 3rem 0;
    }
    
    .plugins-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .plugin-card {
        padding: 2rem;
    }
    
    .plugin-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .plugin-card h3 {
        font-size: 1.25rem;
    }
    
    .plugin-description {
        font-size: 0.95rem;
    }
    
    .plugin-features .feature {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }
    
    .tech-tag {
        font-size: 0.75rem;
        padding: 0.3rem 0.7rem;
    }
}

/* Stats Section Mobile */
@media (max-width: 768px) {
    .stats-section {
        padding: 3rem 0;
    }
    
    .stats-section .container {
        padding: 0 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .stat-item .stat-number {
        font-size: 2.5rem;
    }
    
    .stat-item .stat-label {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-item .stat-number {
        font-size: 2rem;
    }
    
    .stat-item .stat-label {
        font-size: 0.8rem;
    }
}

/* Portfolio Section Mobile */
@media (max-width: 768px) {
    .portfolio-section {
        padding: 3rem 0;
    }
    
    .portfolio-filters {
        gap: 0.5rem;
        padding: 0 0.5rem;
    }
    
    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .portfolio-image-wrapper {
        min-height: 200px;
    }
    
    .portfolio-info {
        padding: 1rem;
    }
    
    .portfolio-info h3 {
        font-size: 1rem;
    }
    
    .portfolio-category {
        font-size: 0.7rem;
        padding: 0.25rem 0.7rem;
    }
    
    .btn-load-more {
        width: 100%;
        padding: 14px 24px;
        font-size: 0.9rem;
    }
    
    .portfolio-counter {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* Services Section Mobile */
@media (max-width: 768px) {
    .services-section {
        padding: 3rem 0;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2rem 1.5rem;
    }
    
    .service-icon {
        font-size: 2.5rem;
    }
    
    .service-card h3 {
        font-size: 1.25rem;
    }
    
    .service-card p {
        font-size: 0.95rem;
    }
    
    .service-price {
        font-size: 1.1rem;
    }
}

/* Contact Section Mobile */
@media (max-width: 768px) {
    .contact-section {
        padding: 3rem 0;
    }
    
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .contact-info h3 {
        font-size: 1.25rem;
    }
    
    .contact-item {
        font-size: 0.9rem;
    }
    
    .contact-icon {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .contact-form {
        padding: 1.5rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.875rem;
        font-size: 0.95rem;
    }
    
    .form-group textarea {
        min-height: 120px;
    }
}

/* Footer Mobile */
@media (max-width: 768px) {
    .site-footer {
        padding: 3rem 0 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-bottom: 2rem;
    }
    
    .footer-about h3 {
        font-size: 1.25rem;
    }
    
    .footer-about p {
        font-size: 0.9rem;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .footer-links h4 {
        font-size: 1.1rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .footer-bottom {
        font-size: 0.85rem;
        padding-top: 1.5rem;
    }
}

/* Optimisations Performance Mobile */
@media (max-width: 768px) {
    /* Réduction des animations pour meilleures performances */
    .floating-card,
    @keyframes orbit1,
    @keyframes orbit2,
    @keyframes orbit3 {
        animation: none !important;
    }
    
    /* Optimisation des images */
    img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
    
    /* Simplification des ombres */
    .hero-image,
    .phone-mockup-container,
    .browser-mockup,
    .expertise-card:hover,
    .plugin-card:hover,
    .portfolio-item:hover {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    }
    
    /* Désactivation du backdrop-filter pour meilleures performances */
    .site-header {
        backdrop-filter: none;
        background: rgba(255, 255, 255, 0.98);
    }
    
    .floating-card {
        backdrop-filter: none;
        background: rgba(0, 182, 122, 0.15);
    }
}

/* Touch-friendly elements */
@media (max-width: 768px) {
    button,
    a.btn-primary,
    a.btn-secondary,
    .filter-btn,
    .slider-nav-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .main-nav a {
        padding: 1rem 0;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Prévention du zoom sur les inputs */
@media (max-width: 768px) {
    input,
    textarea,
    select {
        font-size: 16px !important;
    }
}

/* Orientation paysage mobile */
@media (max-width: 968px) and (orientation: landscape) {
    .hero {
        padding-top: 100px;
        padding-bottom: 2rem;
    }
    
    .hero-content {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .hero-visual {
        order: 0;
    }
    
    .phone-mockup-container {
        width: 200px;
        height: 400px;
    }
}

/* Loading states optimisés pour mobile */
@media (max-width: 768px) {
    .portfolio-image-wrapper::before {
        width: 30px;
        height: 30px;
    }
}

/* Améliorations de lisibilité */
@media (max-width: 768px) {
    body {
        font-size: 15px;
        line-height: 1.6;
    }
    
    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
    }
    
    p {
        margin-bottom: 1rem;
    }
}