/* Optimisations pour les résolutions intermédiaires */

/* Variables pour les breakpoints */
:root {
    --breakpoint-small: 480px;
    --breakpoint-medium: 768px;
    --breakpoint-large: 1024px;
    --breakpoint-xlarge: 1440px;
}

/* Corrections générales pour toutes les résolutions */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Optimisations pour les résolutions intermédiaires (tablettes et petits moniteurs) */
@media screen and (min-width: 769px) and (max-width: 1200px) {
    /* Ajustement du conteneur principal */
    .container {
        width: 80% !important;
        padding: 15px !important;
    }
    
    /* Ajustement des grilles */
    .photo-grid, .video-grid, .music-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 15px !important;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
        gap: 20px !important;
    }
    
    .prototypes-grid, .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
        gap: 15px !important;
    }
    
    /* Ajustement des tailles de texte */
    .section-title {
        font-size: 1.8rem !important;
    }
    
    .hero h1 {
        font-size: 2.5rem !important;
    }
    
    .hero p {
        font-size: 1.1rem !important;
    }
    
    /* Ajustement des cartes */
    .photo-card {
        height: 180px !important;
    }
    
    .video-thumbnail, .music-card-cover {
        height: 160px !important;
    }
    
    .project-card img {
        height: 180px !important;
    }
    
    .prototype-card img, .blog-card img {
        height: 140px !important;
    }
    
    /* Ajustement des infos */
    .photo-info, .video-info, .music-card-info, .project-info, .prototype-info, .blog-info {
        padding: 12px !important;
    }
    
    .project-title {
        font-size: 1.3rem !important;
    }
    
    .prototype-title, .blog-title {
        font-size: 1.1rem !important;
    }
    
    .project-description, .prototype-description, .blog-excerpt {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
    }
    
    /* Ajustement de la barre de navigation */
    .navBar {
        width: 90vw !important;
    }
    
    .navLinks {
        width: 40% !important;
    }
    
    .mainTrackInfo {
        width: 25% !important;
    }
    
    .mainControlBar {
        width: 35% !important;
    }
}

/* Optimisations pour les petits écrans d'ordinateur portable */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Ajustement du conteneur principal */
    .container {
        width: 90% !important;
        padding: 10px !important;
    }
    
    /* Ajustement des grilles */
    .photo-grid, .video-grid, .music-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        gap: 12px !important;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 15px !important;
    }
    
    .prototypes-grid, .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 12px !important;
    }
    
    /* Ajustement des tailles de texte */
    .section-title {
        font-size: 1.6rem !important;
    }
    
    .hero h1 {
        font-size: 2.2rem !important;
    }
    
    .hero p {
        font-size: 1rem !important;
    }
    
    /* Ajustement des cartes */
    .photo-card {
        height: 160px !important;
    }
    
    .video-thumbnail, .music-card-cover {
        height: 140px !important;
    }
    
    .project-card img {
        height: 160px !important;
    }
    
    .prototype-card img, .blog-card img {
        height: 120px !important;
    }
    
    /* Ajustement des infos */
    .photo-info, .video-info, .music-card-info, .project-info, .prototype-info, .blog-info {
        padding: 10px !important;
    }
    
    .project-title {
        font-size: 1.2rem !important;
    }
    
    .prototype-title, .blog-title {
        font-size: 1rem !important;
    }
    
    .project-description, .prototype-description, .blog-excerpt {
        font-size: 0.85rem !important;
        line-height: 1.2 !important;
    }
    
    /* Ajustement de la barre de navigation */
    .navBar {
        width: 95vw !important;
    }
    
    .navLinks {
        width: 45% !important;
    }
    
    .mainTrackInfo {
        width: 20% !important;
    }
    
    .mainControlBar {
        width: 35% !important;
    }
    
    /* Ajustement des boutons de navigation */
    .section-nav a {
        padding: 6px 12px !important;
        font-size: 0.9rem !important;
    }
    
    .section-link {
        padding: 8px 15px !important;
        font-size: 0.9rem !important;
    }
}

/* Optimisations pour les tablettes en mode paysage */
@media screen and (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    /* Ajustement du conteneur principal */
    .container {
        width: 85% !important;
    }
    
    /* Ajustement des grilles pour mieux utiliser l'espace horizontal */
    .photo-grid, .video-grid, .music-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    }
    
    .prototypes-grid, .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
    }
}

/* Optimisations pour les tablettes en mode portrait */
@media screen and (min-width: 600px) and (max-width: 768px) and (orientation: portrait) {
    /* Ajustement du conteneur principal */
    .container {
        width: 90% !important;
    }
    
    /* Ajustement des grilles */
    .photo-grid, .video-grid, .music-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .projects-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    .prototypes-grid, .blog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Correction pour les écrans très larges */
@media screen and (min-width: 1440px) {
    .container {
        width: 70% !important;
        max-width: 1400px !important;
    }
}

/* Correctifs CSS purs pour MOrg - Sans JavaScript */

/* ===== CORRECTIONS GÉNÉRALES ===== */

/* Supprimer les barres de défilement visibles tout en gardant la fonctionnalité */
html, body {
    overflow: auto !important;
    height: auto !important;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* Cacher la barre de défilement pour Chrome/Safari/Opera */
html::-webkit-scrollbar, body::-webkit-scrollbar {
    display: none;
}

/* S'assurer que le conteneur principal n'affiche pas de barres de défilement */
.container {
    overflow: visible !important;
    max-height: none !important;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.container::-webkit-scrollbar {
    display: none;
}

/* ===== CORRECTION DES MINIATURES VIDÉO ET BLOG ===== */

/* Correction pour les miniatures vidéo */
.video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #111;
}

/* Fallback pour les miniatures vidéo manquantes */
.video-thumbnail img:not([src]), 
.video-thumbnail img[src=""], 
.video-thumbnail img[src*="?thumb=1"] {
    background-image: url('/static/media/default_video.jpg');
    background-size: cover;
    background-position: center;
}

/* Correction pour les miniatures blog */
.blog-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #111;
}

/* Fallback pour les miniatures blog manquantes */
.blog-card img:not([src]), 
.blog-card img[src=""] {
    background-image: url('/static/media/default_blog.jpg');
    background-size: cover;
    background-position: center;
}

/* ===== CORRECTION DES DESCRIPTIONS D'IMAGES SUR LA PAGE ART ===== */

/* Correction pour les descriptions d'images */
.photo-card {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 200px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    cursor: pointer;
}

.photo-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
    border-radius: 8px; /* Même border-radius que le conteneur */
}

.photo-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%; /* Assure que la largeur est exactement la même que l'image */
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 15px;
    transform: translateY(100%);
    transition: transform 0.3s;
    border-bottom-left-radius: 8px; /* Même border-radius que le conteneur */
    border-bottom-right-radius: 8px; /* Même border-radius que le conteneur */
    box-sizing: border-box; /* Assure que le padding est inclus dans la largeur */
}

.photo-card:hover .photo-info {
    transform: translateY(0);
}

.photo-card:hover img {
    transform: scale(1.05);
}

/* ===== CORRECTION DU FOOTER ===== */

/* Footer style handled in base.css to ensure consistency */

/* Ajout d'un espace en bas du contenu pour éviter que le footer ne cache du contenu */
#content {
    padding-bottom: calc(2vh + 30px) !important; /* Hauteur du footer + marge supplémentaire */
}

/* Ajustements pour mobile */
@media screen and (max-width: 768px) {
    /* Footer style handled in base.css */
    #content {
        padding-bottom: calc(50px + 30px) !important; /* Hauteur de la navbar mobile + hauteur du footer + marge */
    }
}

/* ===== OPTIMISATIONS POUR LES RÉSOLUTIONS INTERMÉDIAIRES ===== */

/* Variables pour les breakpoints */
:root {
    --breakpoint-small: 480px;
    --breakpoint-medium: 768px;
    --breakpoint-large: 1024px;
    --breakpoint-xlarge: 1440px;
}

/* Corrections générales pour toutes les résolutions */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* Optimisations pour les résolutions intermédiaires (tablettes et petits moniteurs) */
@media screen and (min-width: 769px) and (max-width: 1200px) {
    /* Ajustement du conteneur principal */
    .container {
        width: 80% !important;
        padding: 15px !important;
    }
    
    /* Ajustement des grilles */
    .photo-grid, .video-grid, .music-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 15px !important;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important;
        gap: 20px !important;
    }
    
    .prototypes-grid, .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)) !important;
        gap: 15px !important;
    }
    
    /* Ajustement des tailles de texte */
    .section-title {
        font-size: 1.8rem !important;
    }
    
    .hero h1 {
        font-size: 2.5rem !important;
    }
    
    .hero p {
        font-size: 1.1rem !important;
    }
    
    /* Ajustement des cartes */
    .photo-card {
        height: 180px !important;
    }
    
    .video-thumbnail, .music-card-cover {
        height: 160px !important;
    }
    
    .project-card img {
        height: 180px !important;
    }
    
    .prototype-card img, .blog-card img {
        height: 140px !important;
    }
    
    /* Ajustement des infos */
    .photo-info, .video-info, .music-card-info, .project-info, .prototype-info, .blog-info {
        padding: 12px !important;
    }
    
    .project-title {
        font-size: 1.3rem !important;
    }
    
    .prototype-title, .blog-title {
        font-size: 1.1rem !important;
    }
    
    .project-description, .prototype-description, .blog-excerpt {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
    }
    
    /* Ajustement de la barre de navigation */
    .navBar {
        width: 90vw !important;
    }
    
    .navLinks {
        width: 40% !important;
    }
    
    .mainTrackInfo {
        width: 25% !important;
    }
    
    .mainControlBar {
        width: 35% !important;
    }
}

/* Optimisations pour les petits écrans d'ordinateur portable */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    /* Ajustement du conteneur principal */
    .container {
        width: 90% !important;
        padding: 10px !important;
    }
    
    /* Ajustement des grilles */
    .photo-grid, .video-grid, .music-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
        gap: 12px !important;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
        gap: 15px !important;
    }
    
    .prototypes-grid, .blog-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
        gap: 12px !important;
    }
}

/* ===== CORRECTION DE LA NAVBAR MOBILE ET DES DROPDOWNS ===== */

@media screen and (max-width: 768px) {
    /* Largeur du conteneur à 90vw pour mobile */
    .container {
        width: 90vw !important;
        margin: 0 auto !important;
        padding: 10px !important;
    }
    
    /* Fond transparent et flou pour la navbar */
    .navBar {
        background-color: transparent !important;
        backdrop-filter: none !important;
        box-shadow: none !important;
    }
    
    /* Style pour la barre de navigation inférieure */
    .navLinks {
        background-color: rgba(0, 0, 0, 0.3) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2) !important;
        border-radius: 10px 10px 0 0 !important;
    }
    
    /* Positionnement de la waveform */
    .mobileExpandableContent .mainTrackInfo {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: -1 !important;
    }
    
    .mobileExpandableContent .mainWaveform {
        opacity: 0.3 !important;
    }
    
    /* Style des dropdowns qui s'ouvrent vers le haut */
    .nav-dropdown {
        position: relative !important;
    }
    
    .nav-dropdown-content {
        position: absolute !important;
        bottom: 100% !important;
        top: auto !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        background-color: rgba(0, 0, 0, 0.7) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        min-width: 120px !important;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5) !important;
        border-radius: 8px 8px 0 0 !important;
        padding: 8px 0 !important;
        margin-bottom: 5px !important;
        z-index: 1000 !important;
        display: none !important;
    }
    
    /* Affichage du dropdown au survol */
    .nav-dropdown:hover .nav-dropdown-content {
        display: block !important;
    }
    
    /* Style des éléments du dropdown */
    .nav-dropdown-item {
        display: block !important;
        padding: 8px 16px !important;
        color: white !important;
        text-decoration: none !important;
        text-align: center !important;
        white-space: nowrap !important;
    }
    
    .nav-dropdown-item:hover {
        background-color: rgba(255, 255, 255, 0.1) !important;
    }
    
    /* Rotation de la flèche du dropdown */
    .nav-dropdown-arrow {
        display: inline-block !important;
        transition: transfaorm 0.3s !important;
        transform: rotate(180deg) !important; /* Flèche vers le haut par défaut */
    }
    
    .nav-dropdown:hover .nav-dropdown-arrow {
        transform: rotate(0deg) !important; /* Flèche vers le bas au survol */
    }
    
    /* Ajustements pour les contrôles audio */
    .mobileExpandableContent .mainControlBar {
        padding: 10px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    
    /* Espacement entre les contrôles audio */
    .mobileExpandableContent .controlButtons {
        gap: 15px !important;
    }
    
    /* Affichage du contenu mobile */
    .mobileExpandableContent {
        background-color: rgba(0, 0, 0, 0.3) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }
    
    /* Correction pour les boutons de navigation */
    .navLinks > a, .navLinks > div {
        margin: 0 8px !important;
    }
}
