/* Galerie Événements - Styles Frontend */

/* Grille d'événements */
.galerie-evenements-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

.evenement-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.evenement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.evenement-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.evenement-content {
    padding: 20px;
}

.evenement-title {
    font-size: 1.4em;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #333;
    line-height: 1.3;
}

.evenement-date {
    color: #77A7FF;
    font-weight: 600;
    margin-bottom: 15px;
    font-size: 0.95em;
}

.evenement-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-galerie {
    background: #77A7FF;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-galerie:hover {
    background: #5A94FF;
    color: white;
    text-decoration: none;
}

.btn-galerie.btn-videos {
    background: #28a745;
}

.btn-galerie.btn-videos:hover {
    background: #218838;
}

/* Galerie d'images simple (shortcode) */
.galerie-evenements-grid.simple {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.galerie-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    cursor: pointer;
}

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

.galerie-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

/* Galerie de vidéos simple (shortcode) */
.galerie-videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.video-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    aspect-ratio: 16/9;
}

.video-item iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Modal/Popup pour galeries */
.galerie-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: scale(0.8);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

.modal-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 8px;
}

.modal-video {
    width: 80vw;
    height: 45vw;
    max-width: 1000px;
    max-height: 563px;
    border-radius: 8px;
}

/* Contrôles du modal */
.modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.modal-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-prev {
    left: -60px;
}

.modal-next {
    right: -60px;
}

/* Compteur d'images */
.modal-counter {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
}

/* Titre du modal vidéo */
.modal-title {
    position: absolute;
    top: -60px;
    left: 0;
    right: 0;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .galerie-evenements-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
        padding: 0 10px;
    }

    .evenement-actions {
        flex-direction: column;
    }

    .btn-galerie {
        width: 100%;
        text-align: center;
    }

    .modal-content {
        max-width: 95%;
        max-height: 95%;
    }

    .modal-nav {
        display: none;
    }

    .modal-close {
        top: -30px;
        right: -10px;
        font-size: 24px;
        width: 35px;
        height: 35px;
    }

    .modal-counter {
        bottom: -30px;
        font-size: 12px;
        padding: 3px 10px;
    }

    .modal-title {
        top: -50px;
        font-size: 16px;
    }

    .modal-video {
        width: 95vw;
        height: 53vw;
    }

    .galerie-videos-grid {
        grid-template-columns: 1fr;
    }

    .galerie-evenements-grid.simple {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }

    .galerie-image {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .evenement-card {
        margin: 0 10px;
    }

    .evenement-content {
        padding: 15px;
    }

    .evenement-title {
        font-size: 1.2em;
    }

    .galerie-evenements-container {
        padding: 10px;
    }

    .modal-image {
        max-height: 70vh;
    }
}

/* Animation pour le chargement */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #77A7FF;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}