/* Variables CSS - Assurez-vous que ces variables sont cohérentes avec votre style0.css */

/* Base et typographie */


@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* Conteneur générique pour centrer le contenu */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px; /* Ajout de padding pour éviter que le contenu ne touche les bords sur les petits écrans */
}

/* --- Header --- */

/* --- Section de téléchargement du beat --- */
.download-page-main {
    padding: 100px 20px 60px; /* Padding pour le header fixe et le bas */
    min-height: calc(100vh - 100px); /* Assure une hauteur minimale */
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.section-container {
    max-width: 800px;
    margin: 20px auto; /* Centrage et marge */
    padding: 40px;
    background-color: var(--card-bg);
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 100%; /* S'assure que la section prend la largeur disponible */
    box-sizing: border-box; /* Inclut padding et border dans la largeur */
}

.beat-download-section h2 {
    font-size: 2.2em;
    color: var(--primary-color);
    margin-bottom: 20px;
    position: relative;
    display: inline-block;
}

.beat-download-section h2::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -10px;
    transform: translateX(-50%);
    width: 70px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.beat-download-section .description,
.instruction {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 30px;
    line-height: 1.8;
}

.instruction strong {
    color: var(--primary-color);
}

/* --- Lecteur YouTube personnalisé --- */
.beat-player-container {
    width: 100%; /* Permet au conteneur de prendre toute la largeur disponible */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px; /* Espace entre le lecteur et le lien de téléchargement */
}

.custom-youtube-player {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--secondary-color);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 480px; /* Limite la largeur du lecteur sur les grands écrans */
    color: var(--text-light);
    gap: 20px;
    position: relative;
    box-sizing: border-box;
}

.beat-cover {
    width: 100%;
    padding-bottom: 56.25%; /* Ratio 16:9 pour l'image de couverture */
    height: 0;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.beat-cover img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.beat-cover.playing img {
    opacity: 0;
}

.play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 4em;
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    z-index: 2;
}

.play-overlay:hover {
    background-color: rgba(0, 0, 0, 0.7);
}

.play-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.youtube-player-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 15px;
}

.iframe-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none; /* L'iframe ne doit pas être directement cliquable via ses contrôles natifs */
}

.iframe-wrapper iframe {
    width: 100%;
    height: 100%;
    opacity: 0; /* Masqué par défaut */
    transition: opacity 0.3s ease;
    border-radius: 10px; /* Conserver le border-radius de l'iframe */
}

.iframe-wrapper.visible iframe {
    opacity: 1; /* Visible quand le lecteur est actif */
}

.player-buttons {
    display: flex;
    justify-content: center; /* Centre les boutons */
    gap: 15px;
}

.player-buttons button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.player-buttons button:hover {
    background-color: #cc3700;
    transform: translateY(-2px);
}

.player-buttons button:active {
    transform: translateY(0);
}

/* Styles pour les barres de progression et de volume */
.progress-bar-container-yt, .volume-container-yt {
    width: 100%;
    display: flex;
    align-items: center; /* Centre verticalement */
    gap: 10px;
}

.progress-bar-container-yt {
    flex-direction: column; /* La barre et le temps en colonne */
    gap: 5px;
}

#progress-bar-yt, #volume-bar-yt {
    width: 100%; /* Prend toute la largeur disponible */
    -webkit-appearance: none;
    appearance: none;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    cursor: pointer;
    outline: none;
    transition: background 0.3s ease;
}

#progress-bar-yt::-webkit-slider-thumb, #volume-bar-yt::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

#progress-bar-yt::-moz-range-thumb, #volume-bar-yt::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.time-display-yt {
    font-size: 0.9em;
    color: rgba(255, 255, 255, 0.7);
}

.volume-container-yt i {
    font-size: 1.2em;
    color: rgba(255, 255, 255, 0.7);
    /* Optionnel : ajuster la taille de l'icône de volume si elle est trop petite */
}

/* --- Boutons CTA --- */
.cta-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 30px;
    flex-wrap: wrap; /* Permet aux boutons de passer à la ligne */
}

.btn {
    display: inline-block;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center; /* Pour que le texte soit centré si le bouton s'élargit */
}

.btn.primary {
    background-color: var(--primary-color);
    color: var(--card-bg);
}

.btn.primary:hover {
    background-color: #cc3700;
    transform: translateY(-3px);
}

/* --- Conteneur du lien de téléchargement --- */
#lien-container {
    width: 100%;
    max-width: 480px; /* Alignée avec la largeur max du lecteur */
    height: 50px;
    background-color: var(--primary-color);
    color: var(--card-bg);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0px 0px 5px 0px rgba(255, 255, 0, 0.7);
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out, background-color 0.3s ease;
    box-sizing: border-box;
}

#lien-container.visible {
    opacity: 1;
    transform: translateY(0);
}

#loading-text {
    font-family: 'Poppins', sans-serif;
    font-size: 1em;
    color: white;
    font-weight: 600;
    text-align: center;
}

#download-link {
    display: none;
    text-decoration: none;
    background-color: var(--card-bg);
    color: var(--primary-color);
    border-radius: 10px;
    padding: 10px 20px;
    text-align: center;
    text-transform: uppercase;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1em;
    font-weight: 700;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
    white-space: nowrap; /* Empêche le texte de se casser sur plusieurs lignes */
    overflow: hidden; /* Cache le texte s'il déborde */
    text-overflow: ellipsis; /* Ajoute des points de suspension si le texte est tronqué */
}

#download-link:hover {
    background-color: #eee;
    color: #cc3700;
    transform: translateY(-2px);
}

/* --- Footer --- */
footer {
    background-color: var(--secondary-color);
    color: var(--text-light);
    padding: 40px 20px;
    text-align: center;
    font-size: 0.9em;
}

.footer-content {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.social-links {
    margin-top: 15px;
}

.social-links a {
    color: var(--text-light);
    font-size: 1.8em;
    margin: 0 15px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-links a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}


/* --- Media Queries pour la Responsivité --- */

/* Pour les tablettes et les écrans plus petits que 768px */
@media (max-width: 768px) {
    

    .download-page-main {/* Ajuste le padding pour le header */
        padding-bottom: 40px;
        margin-top: -50px;
    }

    .section-container {
        padding: 30px 20px; /* Réduit le padding interne de la section */
        margin-top: 0; /* Pas de marge supérieure si padding du main est suffisant */
    }

    .beat-download-section h2 {
        font-size: 1.8em; /* Réduit la taille du titre */
    }

    .beat-download-section .description,
    .instruction {
        font-size: 1em; /* Réduit la taille du texte */
    }

    .custom-youtube-player {
        padding: 20px; /* Réduit le padding du lecteur */
        max-width: 90%; /* Prend plus de largeur sur les tablettes */
    }

    .player-buttons button {
        width: 45px;
        height: 45px;
        font-size: 1.3em;
    }

    #progress-bar-yt, #volume-bar-yt {
        height: 7px; /* Légèrement plus fin */
    }

    .cta-buttons {
        flex-direction: column; /* Empile les boutons CTA verticalement */
        gap: 15px;
    }

    .btn {
        width: 100%; /* Les boutons CTA prennent toute la largeur */
        padding: 12px 20px; /* Réduit le padding des boutons */
    }

    #lien-container {
        max-width: 90%; /* Prend plus de largeur pour le lien de téléchargement */
        height: auto; /* Hauteur automatique pour s'adapter au contenu */
        padding: 10px; /* Ajuste le padding */
    }
}

/* Pour les téléphones mobiles (écrans plus petits que 480px) */
@media (max-width: 480px) {
    .main-header .logo {
        font-size: 1.5em;
    }

    .menu-toggle {
        font-size: 1.5em;
    }

    .download-page-main {
        padding-left: 15px;
        padding-right: 15px;
    }

    .section-container {
        padding: 20px 15px;
    }

    .beat-download-section h2 {
        font-size: 1.5em;
    }

    .beat-download-section .description,
    .instruction {
        font-size: 0.95em;
    }

    .custom-youtube-player {
        padding: 15px;
        max-width: 100%; /* Pleine largeur sur les très petits écrans */
    }

    .play-overlay {
        font-size: 3em; /* Réduit la taille de l'icône Play */
    }

    .player-buttons button {
        width: 40px;
        height: 40px;
        font-size: 1.2em;
    }

    #progress-bar-yt::-webkit-slider-thumb, #volume-bar-yt::-webkit-slider-thumb,
    #progress-bar-yt::-moz-range-thumb, #volume-bar-yt::-moz-range-thumb {
        width: 16px;
        height: 16px;
    }

    .time-display-yt {
        font-size: 0.8em;
    }

    .volume-container-yt i {
        font-size: 1em;
    }

    #download-link {
        font-size: 0.9em; /* Réduit la taille du texte du lien de téléchargement */
        padding: 8px 15px;
    }

    .footer-content {
        padding: 20px 15px;
    }

    .social-links a {
        font-size: 1.5em;
        margin: 0 10px;
    }
}
/* préloader au chargement de l'iframe*/
