/* ===========================================================================
 * Donner la note — feuille de style (version web mobile)
 * ======================================================================== */

:root {
    --theme-primary: #003788;
    --theme-light: #0258bd;
    --theme-dark: #001c52;
    --background-alpha: rgba(0, 20, 60, 0.55);

    --whisper: #E4E4E4;
    --silver: #A9A9A9;
    --white: #FFFFFF;
}

/* --- Polices ------------------------------------------------------------- */
@font-face {
    font-family: 'Material Icons';
    font-style: normal;
    font-weight: 400;
    src: url(../fonts/materialicons.woff2) format('woff2');
    font-display: swap;
}
@font-face {
    font-family: "Symphony";
    src: url(../fonts/symphony.ttf) format("truetype");
    font-display: swap;
}
@font-face {
    font-family: "Boogaloo";
    src: url(../fonts/boogaloo.ttf) format("truetype");
    font-display: swap;
}

.material-icons {
    font-family: 'Material Icons';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
}

/* --- Base --------------------------------------------------------------- */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

*:focus { outline: none; }

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

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* Image statique = repli si la vidéo n'est pas (encore) jouée. */
    background: var(--theme-dark) url(../img/background_image.jpg) center / cover no-repeat fixed;

    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    -webkit-text-size-adjust: 100%;

    padding: env(safe-area-inset-top) env(safe-area-inset-right)
             env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Vidéo de fond plein écran (derrière l'interface). */
#backgroundVideo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    pointer-events: none;
}

.app {
    position: relative;
    height: 100%;
    width: 100%;
    text-align: center;
    background-color: var(--background-alpha);
    backdrop-filter: blur(1px);
}

/* --- Mise en page colonne ----------------------------------------------- */
.content {
    display: flex;
    flex-flow: column;
    height: 100%;
}

.row { width: 100%; position: relative; }

.content .row.appBanner {
    background-color: var(--theme-primary);
    flex: 0 0 auto;
    min-height: 64px;
    text-align: center;
    display: flex;
    align-items: center;
    /* Titre centré horizontalement dans le bandeau */
    justify-content: center;
    padding: 0 16px;
}

.content .row.appSection {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.content .row.appFooter {
    background-color: var(--theme-primary);
    flex: 0 0 auto;
    padding: 4px 0;
}
.quote {
    font-family: "Boogaloo", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: var(--white);

}
/* --- Bandeau ------------------------------------------------------------ */
#titreContainer {
    display: inline-block;
    vertical-align: middle;
}

#titreContainer h1 {
    color: var(--white);
    font-family: "Symphony", Helvetica, Arial, sans-serif;
    font-size: 26px;
    font-weight: normal;
    /* Bord gauche du titre aligné sur la barre de recherche (plus de décalage logo) */
    /* margin: 0; */
}

.appFooter > span {
    color: var(--white);
    font-family: "Boogaloo", Helvetica, Arial, sans-serif;
    font-size: 15px;
}

/* Crédit auteur : sur sa propre ligne, sous la citation, aligné à droite et plus discret */
.appFooter .credit {
    display: block;
    text-align: right;
    padding-right: 12px;
    margin-top: 1rem;
    font-size: 11px;
    opacity: 0.8;
}

/* Lien e-mail de l'auteur : lisible sur le fond sombre (hérite du blanc, souligné) */
.appFooter .credit a {
    color: inherit;
    text-decoration: underline;
}

/* --- Dégradés partagés -------------------------------------------------- */
.searchBackground,
.search #icon-search,
.icon_section2,
.searchElem,
.slider:before {
    background: linear-gradient(to bottom right, var(--theme-light), var(--theme-dark));
}

/* --- Recherche ---------------------------------------------------------- */
.searchBackground {
    padding: 18px 16px;
}

.search {
    border-radius: 25px;
    height: 50px;
    margin: auto;
    position: relative;
    width: 100%;
    max-width: 520px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search input {
    font-family: "Boogaloo", Helvetica, Arial, sans-serif;
    background: var(--white);
    border: none;
    border-radius: 25px;
    color: var(--theme-primary);
    font-size: 18px;
    height: 100%;
    padding: 0 16px;
    flex: 1 1 auto;
    min-width: 0;
}

.search #icon-search {
    border: 1px solid var(--silver);
    border-radius: 50%;
    height: 50px;
    width: 50px;
    flex: 0 0 50px;
    text-align: center;
}

.search #icon-search i {
    color: var(--white);
    font-size: 25px;
    line-height: 50px;
}

/* Texte superposé au champ : affiche l'invite puis l'autocomplétion « fantôme »
   (la partie déjà tapée est rendue invisible via .ghost-hidden, cf. app.js setSuggestion) */
.search-label-suggest {
    font-family: "Boogaloo", Helvetica, Arial, sans-serif;
    font-size: 18px;
    color: rgba(67, 75, 87, 0.35);
    position: absolute;
    left: 16px;
    top: 0;
    height: 50px;
    line-height: 50px;
    pointer-events: none;
    z-index: 5;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    max-width: calc(100% - 76px);
}

.ghost-hidden { opacity: 0; }

/* --- Résultats ---------------------------------------------------------- */
.results {
    margin: 0 auto;
    max-width: 520px;
    padding: 0 16px 16px;
    text-align: left;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
}

.searchElem {
    color: var(--white);
    font-family: "Boogaloo", Helvetica, Arial, sans-serif;
    font-size: 22px;
    padding: 8px 18px;
    border: none;
    border-radius: 25px;
    width: fit-content;
    max-width: 100%;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.searchElem:active { transform: scale(0.97); }

.no-result {
    color: var(--white);
    font-family: "Boogaloo", Helvetica, Arial, sans-serif;
    font-size: 18px;
    opacity: 0.8;
    padding: 8px 4px;
}

/* --- Section 2 (détail) ------------------------------------------------- */
/* Les deux vues sont alternées par app.js : openGroup() affiche .section2,
   goBack() revient à .section1 (recherche). */
.section1 { display: block; }

.section2 {
    display: none;
    background: radial-gradient(circle, var(--theme-light) 40%, var(--theme-primary));
}

.section2_menu {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    background: inherit;
}

.icon_section2 {
    border: 1px solid var(--silver);
    border-radius: 50%;
    height: 50px;
    width: 50px;
    flex: 0 0 50px;
    text-align: center;
    cursor: pointer;
    padding: 0;
}

.icon_section2 i {
    color: var(--white);
    font-size: 25px;
    line-height: 50px;
}

.icon_section2:active { transform: scale(0.94); }

.playSong.playing {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.45);
    animation: pulse 0.8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25); }
    50%      { box-shadow: 0 0 0 7px rgba(255, 255, 255, 0.5); }
}

/* --- Sélecteur de fréquence -------------------------------------------- */
.frequencies {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 50px;
}

.frequencies span {
    color: var(--silver);
    font-family: "Boogaloo", Helvetica, Arial, sans-serif;
    font-size: 18px;
    transition: color .2s, font-size .2s;
}

.frequencies span.active {
    color: var(--white);
    font-size: 22px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 32px;
    flex: 0 0 56px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: var(--whisper);
    border: 1px solid var(--silver);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 3px;
    bottom: 2px;
    border: 1px solid var(--silver);
    transition: .4s;
}

input:checked + .slider:before {
    transform: translateX(24px);
}

.slider.round { border-radius: 34px; }
.slider.round:before { border-radius: 50%; }

/* --- Liste des chants --------------------------------------------------- */
.section2_song_container {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px 24px;
}

.song {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--white);
    font-family: "Boogaloo", Helvetica, Arial, sans-serif;
    padding: 10px 0;
    text-align: left;
}

.song_desc { flex: 1 1 auto; min-width: 0; }

.song_title {
    margin: 0;
    font-size: 22px;
    line-height: 1.2;
}

.song_meta {
    margin: 2px 0 0;
    font-size: 16px;
    color: var(--whisper);
}

.line {
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    margin: 0 auto;
    width: 100%;
}

/* --- Grand écran -------------------------------------------------------- */
@media (min-width: 700px) {
    #titreContainer h1 { font-size: 30px; }
}
