/* Section Galerie Vidéo */
.video-gallery-section {
    padding: 60px 0;
    background-color: var(--bg-light);
    position: relative;
    border-radius: 20px 20px 0 0;
}

.video-gallery-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-title {
    font-size: 2.2rem;
    margin-bottom: 40px;
    color: var(--primary-color);
    text-align: left;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 60px;
}

.video-item {
    display: flex;
    flex-direction: column;
}

.video-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-color);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 ratio */
    height: 0;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
}

.video-wrapper iframe, .video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Slider Styles */
    .slider-wrapper {
        position: relative;
        width: 100%;
        padding-bottom: 56.25%;
        height: 0;
        overflow: hidden;
        border-radius: 12px;
        box-shadow: var(--box-shadow);
        background: #000;
    }

    .slider {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .slide {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        transition: opacity 0.5s ease-in-out;
        z-index: 1;
    }

    .slide.active {
        
        opacity: 1;
        z-index: 2;
    }

    .slide img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .slide video {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .slider-nav {
        position: absolute;
        bottom: 15px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        gap: 10px;
        z-index: 10;
    }

    .slider-dot {
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background-color: rgba(255, 255, 255, 0.5);
        cursor: pointer;
        transition: var(--transition);
    }

    .slider-dot.active,
    .slider-dot:hover {
        background-color: white;
        transform: scale(1.2);
    }
/* Boutons Explorer */
.explore-button {
    font-size: 12px !important;
    display: inline-block !important;
    padding: 5px 24px !important;
    border-radius: 5px !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: var(--transition) !important;
    border: none !important;
    outline: none !important;
    height: 28px !important;
    display: flex !important;
    justify-content: center !important;
    text-align: center !important;
    margin: auto !important;
    margin-top: 1rem !important;
    background: linear-gradient(90deg, #5de0e6, #004aad) !important;
    scale:0.9;
}

    .explore-button:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    }

    /* Media Popup - Complètement refait */
    .media-popup {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.95);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 9999;
        padding: 20px;
    }

    .popup-content {
        position: relative;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        padding: 0;
        /*max-width: 95%;*/
        width: 1200px;
        max-height: 90vh;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
        display: flex;
        flex-direction: column;
    }

    /* Header avec bouton fermer */
    .popup-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        /*padding: 20px 30px;*/
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);

    }

    .popup-title {
        /*color: white;*/
        font-size: 1.5rem;
        /*font-weight: 600;*/
        margin-bottom: 10px;
    }

    .close-btn {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        width: 40px;
        height: 40px;
        border-radius: 50%;
        /* color: white; */
        font-size: 20px;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
    }

    .close-btn:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }

    /* Zone d'affichage principal */
.media-display {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    /* padding: 30px; */
    /* background: rgba(0, 0, 0, 0.3); */
    position: relative;
    /* min-height: 400px; */
}

    .media-display img,
    .media-display video {
        max-width: 100%;
        max-height: 100%;
        border-radius: 12px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    }

    /* Chevrons de navigation */
    .nav-arrow {
        display: none;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        background: rgba(255, 255, 255, 0.9);
        border: none;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        color: var(--primary-color);
        font-size: 20px;
        cursor: pointer;
        transition: var(--transition);
        z-index: 10;
    }

    .nav-arrow:hover {
        background: white;
        transform: translateY(-50%) scale(1.1);
    }

    .nav-arrow.prev {
        left: 20px;
    }

    .nav-arrow.next {
        right: 20px;
    }

    /* Thumbnails en bas */
    .thumbnails-container {
        display: flex;
        gap: 15px;
        padding: 10px 30px 20px;
        background: rgba(255, 255, 255, 0.1);
        backdrop-filter: blur(10px);
        overflow-x: auto;
        justify-content: center;
        /*flex-wrap: wrap;*/
    }

    .thumbnail {
        width: 80px;
        height: auto;
        object-fit: cover;
        cursor: pointer;
        border-radius: 6px;
        border: 2px solid transparent;
        transition: border 0.3s;
        aspect-ratio: 16 / 9;
    }

    .thumbnail:hover,
    .thumbnail.active {
        border-color: white;
        transform: scale(1.1);
    }

    /* Message sans média */
    .no-media-message {
        text-align: center;
        padding: 60px 20px;
        color: var(--text-color);
        font-size: 1.1rem;
        background-color: rgba(255, 255, 255, 0.5);
        border-radius: 12px;
        border: 2px dashed var(--primary-color);
    }

/* Media Queries */
@media screen and (max-width: 768px) {
    section .container h1 {
        /*font-size: 1.2rem;*/
        font-size: 30px;
    }

    .section-espace-mobile
    {
        padding-top:-1rem;
    }
    
    form[action="process_contact.php"] button
    {
        justify-content: center;
    margin: auto;
    display: flex;
    }

    .formulaire-envoyer
    {
        justify-content: center !important;
    }

    #contact
    {
        margin-top:1rem;
        margin-bottom: -3rem;
    }

    .valeurs-section .container
    {
        margin-bottom:4rem !important;
    }

    .card-input
    {
        width: 85%;
    }

   .donation-stats
   {
    margin-top:1rem;
   }

   .sadaqah-container-hadith
   {
    margin-top:4rem !important;
   }

    .valeurs-section
    {
        margin-top:-3rem;
    }
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .video-gallery-section {
        padding: 60px 0;
        margin-top:-2.5rem;
        margin-bottom:-0.5rem ;
    }

    .why-choose-content
    {
        margin-top:0.5rem;
    }

    .hero-bottom-content h1
    {
        padding:0;
    }

    .hero-bottom-content p
    {
        padding:0;
    }

    .video-gallery-container
    {
        max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
    margin-top: -2rem;
    }

    .project-illustrations
    {
        margin-top: 5rem;
    margin-bottom: 4rem;
    }

    .titre-espace-mobile
    {
        margin-bottom:4rem !important
    }
} 

.no-media-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-color);
    font-size: 1.1rem;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    border: 2px dashed var(--primary-color);
}

/* Amélioration des contrôles vidéo */
.slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.slide video::-webkit-media-controls {
    display: flex !important;
}

.slide video::-webkit-media-controls-panel {
    background-color: rgba(0, 0, 0, 0.8);
}

/* Navigation slider conditionnelle */
.slider-nav:empty {
    display: none;
}

/* Responsive pour les petits écrans */
@media screen and (max-width: 768px) {
    .no-media-message {
        padding: 40px 15px;
        font-size: 1rem;
    }
}
.media-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    overflow-y: auto;
}

.popup-content {
    position: relative;
    background: #fff;
    padding: 20px;
    /*max-width: 90%;*/
    width: 1000px;
    border-radius: 10px;
    text-align: center;
}

.close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    font-size: 20px;
    cursor: pointer;
}

.thumbnails-container {
    display: flex;
    /*flex-wrap: wrap;*/
    gap: 10px;
    /*margin-bottom: 20px;*/
    justify-content: center;
}

.thumbnail {
    width: 80px;
    height: auto;
    object-fit: cover;
    cursor: pointer;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: border 0.3s;
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
}

.thumbnail:hover {
    border: 2px solid var(--primary-color);
}

.media-display img,
.media-display video {
    width: auto;
    height: auto;
    border-radius: 10px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    max-height: 50vh;
}

.explore-button {
    margin-top: 15px;
    padding: 5px 24px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 12px;
}

.explore-button:hover {
    background-color: #333;
}