/* ===== PAGE REPERTORIU ===== */

.rep-main {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 58px);
}

/* ── Toggle Categurie / Lochi ── */

.rep-view-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 2rem 1.2rem 0;
    flex-shrink: 0;
}

/* Recherche sur sa propre ligne sur mobile */
@media (max-width: 768px) {
    .rep-search-wrap {
        flex: 0 0 100%;
        max-width: 100%;
        margin: 0;
    }
}

.rep-toggle-btn {
    padding: 0.45rem 1.1rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: rgba(220,200,165,0.45);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.rep-toggle-btn:hover {
    color: rgba(220,200,165,0.75);
    background: rgba(255,255,255,0.09);
}

.rep-toggle-btn.active {
    background: rgba(255,140,0,0.18);
    border-color: rgba(255,140,0,0.45);
    color: #FF8C00;
}

/* ── Barre de recherche ── */

.rep-search-wrap {
    flex: 1 1 0;
    max-width: 360px;
    margin: 0 auto;
}

.rep-search-inner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    transition: border-color 0.2s, background 0.2s;
}

.rep-search-inner:focus-within {
    border-color: rgba(255,140,0,0.5);
    background: rgba(255,140,0,0.06);
}

.rep-search-icon {
    font-size: 1rem;
    color: rgba(220,200,165,0.35);
    line-height: 1;
    flex-shrink: 0;
}

.rep-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: rgba(220,200,165,0.9);
    font-size: 0.78rem;
    letter-spacing: 0.3px;
    min-width: 0;
}

.rep-search-input::placeholder {
    color: rgba(220,200,165,0.3);
}

.rep-search-input::-webkit-search-cancel-button {
    filter: invert(0.6);
    cursor: pointer;
}

.rep-search-count {
    font-size: 0.65rem;
    color: rgba(255,140,0,0.7);
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Onglets estompés pendant la recherche */
.rep-tabs.rep-search-active {
    opacity: 0.35;
    pointer-events: none;
}

@media (min-width: 769px) {
    .rep-view-toggle {
        padding: 2.5rem 18% 0;
    }
}

/* ── Vue Lochi ── */

.rep-locu-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1rem 1.75rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(220,200,165,0.75);
    border-top: 1px solid rgba(255,255,255,0.07);
    position: sticky;
    top: 0;
    background: rgba(255,140,0,0.06);
    z-index: 10;
    cursor: pointer;
    transition: background 0.2s;
}

.rep-locu-header:hover {
    background: rgba(255,140,0,0.1);
}

.rep-locu-group:first-child .rep-locu-header {
    border-top: none;
}

.rep-locu-dot {
    color: #FF8C00;
    font-size: 0.65rem;
}

.rep-locu-chevron {
    margin-left: auto;
    font-size: 1.2rem;
    color: rgba(255,255,255,0.25);
    line-height: 1;
    transition: transform 0.25s;
}

.rep-locu-body {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.3s ease;
}

.rep-locu-collapsed .rep-locu-body {
    max-height: 0;
}

.rep-locu-collapsed .rep-locu-chevron {
    transform: rotate(90deg);
}

.rep-song-cat-badge {
    font-size: 0.63rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.rep-song-cat-badge:hover { opacity: 0.75; }

.rep-badge-paghjella { background: rgba(192,57,43,0.2);  color: #e05545; }
.rep-badge-terzettu  { background: rgba(52,152,219,0.2); color: #5dade2; }
.rep-badge-madricalu { background: rgba(39,174,96,0.2);  color: #52c882; }
.rep-badge-messa     { background: rgba(142,68,173,0.2); color: #bb8fce; }

/* ── Lochi : espacement au-dessus de la liste ── */
#rep-lochi-view {
    padding-top: 1.5rem;
}

/* Logo masqué quand le héro est présent */
header .header-left { display: none; }
header .header-right { margin-left: auto; }

/* Hero identique à la page d'accueil */
.home-hero          { padding: 3rem 4rem 2.5rem; flex-shrink: 0; }
.home-hero-badge    { font-size: 0.68rem; padding: 0.28rem 1rem; margin-bottom: 1rem; }
.home-hero-title    { font-size: 3.2rem; margin-bottom: 0.75rem; }
.home-hero-subtitle { font-size: 0.95rem; max-width: 460px; }

/* Contrôles accordéon alignés à droite dans la barre toggle */
.rep-lochi-controls {
    display: flex;
    visibility: hidden;
    margin-left: auto;
    gap: 0.5rem;
    align-items: center;
}

.rep-lochi-action {
    padding: 0.35rem 0.9rem;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    color: rgba(220,200,165,0.45);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s;
}

.rep-lochi-action:hover {
    border-color: rgba(255,255,255,0.25);
    color: rgba(220,200,165,0.8);
}


@media (min-width: 769px) {
    #rep-lochi-view {
        padding-top: 2.5rem;
    }

    #rep-lochi-list {
        display: flex;
        align-items: flex-start;
        gap: 1px;
        margin: 0 18%;
    }

    .rep-lochi-col {
        flex: 1;
        min-width: 0;
        border-left: 1px solid rgba(255,255,255,0.06);
    }

    .rep-lochi-col:first-child {
        border-left: none;
    }

    .rep-locu-header {
        padding: 1rem 2rem;
    }

    #rep-lochi-list .rep-song-card {
        padding: 0.9rem 2rem;
    }
}

/* ── Onglets catégories ── */

.rep-tabs {
    display: flex;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.rep-tabs::-webkit-scrollbar { display: none; }

.rep-tab {
    flex: 1;
    padding: 0.9rem 0.5rem;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: rgba(220,200,165,0.4);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    white-space: nowrap;
    position: relative;
    top: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
}

.rep-tab:not(.active):hover { color: rgba(220,200,165,0.7); }

.rep-tab[data-category="paghjella"].active { color: #C0392B; border-bottom-color: #C0392B; }
.rep-tab[data-category="terzettu"].active  { color: #3498db; border-bottom-color: #3498db; }
.rep-tab[data-category="madricalu"].active { color: #27ae60; border-bottom-color: #27ae60; }
.rep-tab[data-category="messa"].active     { color: #8e44ad; border-bottom-color: #8e44ad; }

/* Icônes — masquées sur mobile */
.rep-tab-icon {
    display: none;
    font-size: 1rem;
    line-height: 1;
}

/* ── Liste des morceaux ── */

.rep-list {
    flex: 1;
    padding: 0.35rem 0;
}

/* ── Carte morceau ── */

.rep-song-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
    min-height: 62px;
}

.rep-cat-paghjella:hover { background: rgba(192,57,43,0.07); }
.rep-cat-terzettu:hover  { background: rgba(52,152,219,0.07); }
.rep-cat-madricalu:hover { background: rgba(39,174,96,0.07); }
.rep-cat-messa:hover     { background: rgba(142,68,173,0.07); }

/* Bouton lecture */
.rep-song-play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.5rem;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.rep-song-card:hover .rep-song-play { transform: scale(1.1); }

.rep-cat-paghjella .rep-song-play { background: rgba(192,57,43,0.18); border: 1px solid rgba(192,57,43,0.4); color: #e05545; }
.rep-cat-terzettu  .rep-song-play { background: rgba(52,152,219,0.18); border: 1px solid rgba(52,152,219,0.4); color: #5dade2; }
.rep-cat-madricalu .rep-song-play { background: rgba(39,174,96,0.18);  border: 1px solid rgba(39,174,96,0.4);  color: #52c882; }
.rep-cat-messa     .rep-song-play { background: rgba(142,68,173,0.18); border: 1px solid rgba(142,68,173,0.4); color: #bb8fce; }

/* Infos du morceau */
.rep-song-info {
    flex: 1;
    min-width: 0;
}

.rep-song-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(232,220,200,0.92);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rep-song-meta {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.2rem;
    align-items: center;
}

.rep-song-voices {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.32);
}

.rep-song-locu {
    font-size: 0.68rem;
    color: rgba(220,200,165,0.5);
    font-weight: 600;
}

/* Flèche */
.rep-song-arrow {
    font-size: 1.5rem;
    color: rgba(255,255,255,0.18);
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.15s, transform 0.15s;
}
.rep-song-card:hover .rep-song-arrow {
    color: rgba(255,255,255,0.5);
    transform: translateX(3px);
}

/* États vides / erreurs */
.rep-loading,
.rep-empty {
    text-align: center;
    padding: 4rem 2rem;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.28);
    font-style: italic;
}

/* ── Desktop ── */

.rep-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Header catégorie — visible uniquement sur desktop */
.rep-category-info {
    display: none;
}

@media (min-width: 769px) {
    /* Tabs avec même marge que le contenu + espace sous le header */
    .rep-tabs {
        margin: 2rem 18% 0;
        border-bottom: 1px solid rgba(255,255,255,0.08);
    }

    /* Icônes visibles sur desktop */
    .rep-tab-icon {
        display: inline;
    }

    /* Corps : centré avec marges comme la page d'accueil */
    .rep-body {
        margin: 0 18%;
    }

    /* Header catégorie visible sur desktop */
    .rep-category-info {
        display: flex;
        align-items: center;
        gap: 1.5rem;
        padding: 2.5rem 2rem 2rem;
        border-bottom: 1px solid rgba(255,255,255,0.07);
        flex-shrink: 0;
    }

    .rep-cat-icon {
        font-size: 2.8rem;
        line-height: 1;
        flex-shrink: 0;
    }
    .rep-cat-info-paghjella .rep-cat-icon { color: #C0392B; }
    .rep-cat-info-terzettu  .rep-cat-icon { color: #3498db; }
    .rep-cat-info-madricalu .rep-cat-icon { color: #27ae60; }
    .rep-cat-info-messa     .rep-cat-icon { color: #8e44ad; }

    .rep-cat-title {
        font-size: 1.8rem;
        font-weight: 900;
        letter-spacing: -0.5px;
        margin-bottom: 0.4rem;
    }
    .rep-cat-info-paghjella .rep-cat-title { color: #C0392B; }
    .rep-cat-info-terzettu  .rep-cat-title { color: #3498db; }
    .rep-cat-info-madricalu .rep-cat-title { color: #27ae60; }
    .rep-cat-info-messa     .rep-cat-title { color: #8e44ad; }

    .rep-cat-desc {
        font-size: 0.85rem;
        color: rgba(220,200,165,0.55);
        line-height: 1.6;
        max-width: 520px;
        margin: 0;
    }

    /* Cards plus généreuses sur desktop */
    .rep-song-card {
        padding: 0.9rem 2rem;
    }
}

/* ── Mobile ── */

@media (max-width: 768px) {
    .rep-song-card {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
        min-height: 58px;
    }

    .rep-song-play {
        width: 32px;
        height: 32px;
    }

    .rep-song-title {
        font-size: 0.88rem;
    }

    .rep-song-arrow {
        font-size: 1.3rem;
    }
}

/* ── PWA standalone ── */

@media (display-mode: standalone) {
    footer { display: none; }
    body { padding-bottom: env(safe-area-inset-bottom, 0px); }
}
