/* ==========================================================================
   GALLERY SECTIONS - Galeries d'images et visualisations
   04-sections/gallery.css
   ========================================================================== */

/* Titre et introduction de galerie */
.gallery-title {
    color: var(--astro-blue);
    text-align: center;
    margin: 50px 0 25px;
    font-size: 2.2rem;
    font-weight: 700;
}

.gallery-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px;
    color: #555;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Hero section pour galerie */
.gallery-hero {
    background: linear-gradient(135deg, #1a73e8 0%, #34a853 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

/* Navigation par catégories */
.category-nav {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.category-nav .btn {
    padding: 10px 20px;
    border: 2px solid #1a73e8;
    background: white;
    color: #1a73e8;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.category-nav .btn:hover,
.category-nav .btn.active {
    background: #1a73e8;
    color: white;
}

/* Galerie principale */
.photo-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 40px 0;
}

/* Items de galerie */
.gallery-item {
    background-color: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

/* Image avec overlay */
.gallery-image {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-image:hover .gallery-overlay {
    opacity: 1;
}

.overlay-content {
    text-align: center;
    color: white;
    padding: 20px;
}

.overlay-content h3 {
    margin-bottom: 10px;
    font-size: 1.3rem;
}

.view-btn {
    background: #1a73e8;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: #0d5bbc;
    transform: translateY(-2px);
}

/* Légendes d'images */
.gallery-caption {
    padding: 25px;
}

.gallery-caption h3 {
    color: var(--astro-blue);
    margin-bottom: 12px;
    font-size: 1.3rem;
    font-weight: 600;
}

.gallery-caption p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

/* Visualisations 3D et projets */
.visualization-project,
.exploded-views,
.visualization-3d {
    padding: 80px 0;
}

.visualization-project {
    background-color: #f0f7ff;
}

.exploded-views {
    background-color: white;
}

.visualization-3d {
    background-color: #f0f7ff;
}

.visualization-3d h2,
.exploded-views h2 {
    font-size: 2.2rem;
    color: var(--astro-blue);
    text-align: center;
    margin-bottom: 25px;
    font-weight: 700;
}

/* Grilles pour modèles 3D */
.model-3d-grid,
.project-view-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.model-3d-item,
.project-view-item {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.model-3d-container,
.project-view-container {
    position: relative;
    overflow: hidden;
}

.model-preview,
.project-view-img {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.model-3d-item:hover .model-preview,
.project-view-item:hover .project-view-img {
    transform: scale(1.08);
}

/* Informations sur les modèles */
.model-3d-info,
.project-view-info {
    padding: 25px;
    flex-grow: 1;
}

.model-3d-info h3,
.project-view-info h3 {
    color: var(--astro-blue);
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.model-3d-info p,
.project-view-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Overlays pour interactions */
.model-overlay,
.project-view-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.model-3d-item:hover .model-overlay,
.project-view-item:hover .project-view-overlay {
    opacity: 1;
}

.model-overlay .btn,
.project-view-overlay .btn {
    background: rgba(255,255,255,0.9);
    color: #1a73e8;
    padding: 12px 24px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.model-overlay .btn:hover,
.project-view-overlay .btn:hover {
    background: white;
    transform: scale(1.05);
}

/* Vues éclatées */
.exploded-view-grid {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.exploded-view-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.exploded-view-item.reverse {
    direction: rtl;
}

.exploded-view-item.reverse .exploded-view-info {
    direction: ltr;
}

.exploded-view-img {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.exploded-view-img:hover {
    transform: scale(1.03);
}

.exploded-view-info h3 {
    color: var(--astro-blue);
    font-size: 1.6rem;
    margin-bottom: 20px;
}

.exploded-view-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Liste des pièces éclatées */
.exploded-parts-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

.exploded-parts-list li {
    padding: 10px 0;
    padding-left: 25px;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
}

.exploded-parts-list li::before {
    content: '▶';
    position: absolute;
    left: 0;
    color: var(--astro-blue);
    font-weight: bold;
    font-size: 0.9rem;
}

.exploded-parts-list li:last-child {
    border-bottom: none;
}

/* Modal pour images */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0,0,0,0.5);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-modal:hover {
    background: rgba(0,0,0,0.8);
    transform: scale(1.1);
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    margin: auto;
}

.modal-content img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.modal-caption {
    color: white;
    text-align: center;
    margin-top: 20px;
    font-size: 1.2rem;
    padding: 0 20px;
}

/* Navigation dans le modal */
.modal-prev, .modal-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 20px;
    font-size: 30px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

.modal-prev:hover,
.modal-next:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.1);
}

/* Images avec commentaires */
.comment-image {
    margin: 30px 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.comment-image:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.comment-image img {
    width: 100%;
    height: auto;
    display: block;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.comment-image img:hover {
    transform: scale(1.02);
}

.image-comment {
    padding: 25px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.image-comment h4 {
    color: #1a73e8;
    margin: 0 0 12px 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.image-comment p {
    color: #555;
    margin: 0;
    line-height: 1.6;
}

/* Types de commentaires */
.image-comment.info {
    background: #e3f2fd;
    border-top-color: #1a73e8;
}

.image-comment.warning {
    background: #fff3cd;
    border-top-color: #ffc107;
}

.image-comment.success {
    background: #e8f5e8;
    border-top-color: #28a745;
}

.image-comment.info h4 { color: #0d47a1; }
.image-comment.warning h4 { color: #856404; }
.image-comment.success h4 { color: #155724; }

/* Grilles d'images */
.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

/* Variantes d'images */
.comment-image.full-width {
    max-width: none;
    width: 100%;
}

.comment-image.centered {
    max-width: 600px;
    margin: 30px auto;
}

.comment-image.small {
    max-width: 300px;
}

/* Légende simple */
.image-caption {
    text-align: center;
    font-style: italic;
    color: #666;
    margin: 15px 0 0 0;
    font-size: 0.9rem;
    padding: 0 10px;
}

/* Responsive design */
@media (max-width: 992px) {
    .project-view-grid {
        grid-template-columns: 1fr;
    }
    
    .exploded-view-item {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .exploded-view-item.reverse {
        direction: ltr;
    }
}

@media (max-width: 768px) {
    .photo-gallery,
    .gallery-grid,
    .model-3d-grid,
    .images-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gallery-title {
        font-size: 1.8rem;
    }
    
    .category-nav {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .category-nav .btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .comment-image.centered {
        max-width: 100%;
        margin: 20px 0;
    }
    
    .comment-image.small {
        max-width: 100%;
    }
    
    .close-modal {
        top: 10px;
        right: 15px;
        font-size: 30px;
        width: 50px;
        height: 50px;
    }
    
    .modal-prev,
    .modal-next {
        padding: 15px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .gallery-item img {
        height: 200px;
    }
    
    .gallery-caption {
        padding: 20px;
    }
    
    .image-comment {
        padding: 20px;
    }
    
    .image-comment h4 {
        font-size: 1.1rem;
    }
    
    .modal-prev {
        left: 10px;
    }
    
    .modal-next {
        right: 10px;
    }
    
    .exploded-view-grid {
        gap: 40px;
    }
    
    .visualization-project,
    .exploded-views,
    .visualization-3d {
        padding: 50px 0;
    }
}

/* ==========================================================================
   GALERIE PRODUIT - Spécifique pour pages produits (filtre_focal.php)
   Classes additionnelles pour la galerie de produits
   ========================================================================== */

/* Conteneur des images produit */
.product-images {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Image principale du produit */
.main-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    cursor: zoom-in;
    transition: transform 0.3s ease;
    display: block;
}

.main-image:hover {
    transform: scale(1.02);
}

/* Grille de miniatures */
.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

/* Style des miniatures */
.thumbnail {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
}

.thumbnail:hover {
    border-color: var(--astro-blue, #1a73e8);
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
}

.thumbnail.active {
    border-color: var(--astro-blue, #1a73e8);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* Zone d'agrandissement des images */
.image-zoom-area {
    margin-top: 2rem;
    min-height: 400px;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 2rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-zoom-placeholder {
    color: #6c757d;
    text-align: center;
    font-style: italic;
    font-size: 1rem;
}

/* Image agrandie dans la zone zoom */
.enlarged-image {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: block;
}

/* Overlay de commentaire sur l'image */
.image-comment-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 1rem;
    border-radius: 0 0 8px 8px;
    backdrop-filter: blur(5px);
}

.image-comment-overlay p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Bouton de fermeture de la zone zoom */
.close-zoom {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 10;
}

.close-zoom:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

/* Afficher le bouton quand il y a une image */
.image-zoom-area:not(:has(.image-zoom-placeholder)) .close-zoom {
    display: flex;
}

/* Lightbox modale pour affichage plein écran */
.image-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(10px);
}

.image-lightbox.show {
    display: flex;
}

.image-lightbox img {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
}

/* Bouton de fermeture du lightbox */
.close-lightbox {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-lightbox:hover {
    background: white;
    transform: rotate(90deg) scale(1.1);
}

/* Responsive pour galerie produit */
@media (max-width: 768px) {
    .thumbnail-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 0.5rem;
    }
    
    .thumbnail {
        height: 80px;
    }
    
    .image-zoom-area {
        min-height: 300px;
        padding: 1rem;
    }
    
    .enlarged-image {
        max-height: 350px;
    }
    
    .close-lightbox {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .thumbnail-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .thumbnail {
        height: 70px;
    }
    
    .image-zoom-area {
        min-height: 250px;
    }
}