/* Styles globaux pour Paghjella21 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FF8C00;
    --secondary-color: #1a1a1a;
    --accent-color: #FFA500;
    --bg-color: #f5f5f5;
    --text-color: #333;
    --border-color: #ddd;
    --success-color: #27ae60;
    --error-color: #e74c3c;
    --card-bg: #fff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

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

/* Header */
header {
    background-color: transparent;
    color: white;
    padding: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 2rem;
    height: 58px;
}

.header-left {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.logo {
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: -1px;
    color: #ffffff;
    text-decoration: none;
    line-height: 1;
}

.logo-year {
    color: var(--primary-color);
}

.header-nav {
    display: flex;
    gap: 0;
    align-items: stretch;
    flex-grow: 1;
}

.nav-link {
    color: rgba(220, 200, 165, 0.5);
    text-decoration: none;
    padding: 0 1.25rem;
    display: flex;
    align-items: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    position: relative;
    top: 1px; /* compense le border-bottom du header */
}

.nav-link:hover {
    color: rgba(220, 200, 165, 0.9);
}

.nav-link.active {
    color: #f0e8d8;
    border-bottom-color: var(--primary-color);
}

.header-right {
    display: flex;
    gap: 0.6rem;
    align-items: center;
    flex-shrink: 0;
}

#user-info {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

#guest-info {
    display: flex;
    gap: 0.6rem;
    align-items: center;
}

.username {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(220, 200, 165, 0.7);
}

/* Boutons dans le header */
.header-right .btn {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 0.3rem 0.9rem;
    border-radius: 20px;
}

.header-right .btn-primary {
    background: rgba(255, 140, 0, 0.15);
    border: 1px solid rgba(255, 140, 0, 0.45);
    color: var(--primary-color);
}

.header-right .btn-primary:hover {
    background: rgba(255, 140, 0, 0.28);
}

.header-right .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(220, 200, 165, 0.65);
}

.header-right .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(220, 200, 165, 0.95);
}

nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Boutons */
.btn {
    padding: 0.65rem 1.3rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: #E67E00;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.3);
}

.btn-secondary {
    background-color: transparent;
    color: white;
    border: 1px solid white;
}

.btn-secondary:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.btn-full {
    width: 100%;
}

.btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
}

.btn-close:hover {
    color: var(--error-color);
}

/* Main Content */
main {
    min-height: calc(100vh - 60px);
}

main.player-main {
    padding: 0;
}

/* Player Layout */
.player-main {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    min-height: calc(100vh - 60px);
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* Sidebar Navigation */
.sidebar-navigation {
    background: rgba(6, 3, 1, 0.82);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    color: #e8dcc8;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    min-height: calc(100vh - 60px);
}

.sidebar-header {
    padding: 1.25rem 1.2rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-header h2 {
    color: rgba(220, 200, 165, 0.4);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin: 0;
}

.category-filters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-btn {
    padding: 0.35rem 0.4rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.62rem;
    font-weight: 700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    transition: all 0.2s ease;
}

.filter-btn.active {
    background: rgba(255, 140, 0, 0.12);
    border-color: rgba(255, 140, 0, 0.4);
    color: var(--primary-color);
}

/* Category-specific active colors */
.filter-btn[data-category="paghjella"].active {
    background: rgba(192, 57, 43, 0.12);
    border-color: rgba(192, 57, 43, 0.4);
    color: #e05545;
}

.filter-btn[data-category="terzettu"].active {
    background: rgba(52, 152, 219, 0.12);
    border-color: rgba(52, 152, 219, 0.4);
    color: #5aadec;
}

.filter-btn[data-category="madricalu"].active {
    background: rgba(39, 174, 96, 0.12);
    border-color: rgba(39, 174, 96, 0.4);
    color: #3dca7a;
}

.filter-btn[data-category="messa"].active {
    background: rgba(142, 68, 173, 0.12);
    border-color: rgba(142, 68, 173, 0.4);
    color: #b060d8;
}

/* Sidebar toggle Categuria / Lochi */
.sidebar-view-toggle {
    display: flex;
    padding: 0.55rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-toggle-btn {
    flex: 1;
    padding: 0.28rem 0;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(220, 200, 165, 0.4);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.sidebar-toggle-btn:first-child {
    border-radius: 20px 0 0 20px;
    border-right: none;
}

.sidebar-toggle-btn:last-child {
    border-radius: 0 20px 20px 0;
}

.sidebar-toggle-btn.active {
    background: rgba(255, 140, 0, 0.1);
    border-color: rgba(255, 140, 0, 0.4);
    color: var(--primary-color);
}

/* Sidebar lochi view */
#sidebar-cat-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.sidebar-locu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.55);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    transition: color 0.18s, background 0.18s;
}

.sidebar-locu-header:hover {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.03);
}

.sidebar-locu-section:first-child .sidebar-locu-header {
    border-top: none;
}

.sidebar-locu-section.open .sidebar-locu-header {
    color: var(--primary-color);
}

.locu-count {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    letter-spacing: 0;
    font-weight: 600;
}

.sidebar-locu-section.open .locu-count {
    background: rgba(255, 140, 0, 0.12);
    color: rgba(255, 140, 0, 0.7);
}

.sidebar-locu-songs {
    display: none;
    padding: 0 0 0.25rem 0;
}

.sidebar-locu-section.open .sidebar-locu-songs {
    display: block;
}

.songs-list {
    flex: 1;
    overflow-y: scroll; /* scroll fixe au lieu de auto — évite le recalcul de layout à chaque changement de contenu */
    padding: 1rem;
    display: block;
    align-content: flex-start;
    scrollbar-width: none; /* Firefox */
}

.songs-list::-webkit-scrollbar {
    display: none; /* Safari / Chrome */
}

.songs-list .song-card {
    margin-bottom: 0.5rem !important;
    padding: 0.6rem 0.8rem !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border-left: 3px solid var(--primary-color) !important;
    border-radius: 6px !important;
    cursor: pointer;
    box-shadow: none !important;
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex: none !important;
}

.songs-list .song-card.category-paghjella {
    border-left-color: #C0392B !important;
}

.songs-list .song-card.category-terzettu {
    border-left-color: #3498db !important;
}

.songs-list .song-card.category-madricalu {
    border-left-color: #27ae60 !important;
}

.songs-list .song-card.category-messa {
    border-left-color: #8e44ad !important;
}

.songs-list .song-card h3 {
    font-size: 0.85rem;
    margin: 0 0 0.2rem 0;
    line-height: 1.3;
    color: rgba(255, 255, 255, 0.92);
}

.songs-list .song-card p {
    font-size: 0.72rem;
    color: rgba(220, 200, 165, 0.55);
    margin: 0 0 0.15rem 0;
    line-height: 1.3;
}

.songs-list .song-card .meta {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0.15rem 0 0 0;
}

.card-locu-link {
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.2);
    text-underline-offset: 2px;
}

.card-locu-link:hover {
    color: var(--primary-color);
    text-decoration-color: rgba(255, 140, 0, 0.4);
}

.songs-list .category-badge {
    font-size: 0.6rem;
    padding: 0.1rem 0.4rem;
    margin-bottom: 0.2rem;
}

/* Player Section */
.player-section {
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow-y: auto;
}

.player-empty-state {
    text-align: center;
    color: #999;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.player-empty-state h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.player-empty-state p {
    color: #999;
}

.player-active {
    width: 100%;
    background: rgba(18, 18, 22, 0.88);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* ===== TOP BAR : info morceau + transport ===== */

.player-top-bar {
    display: flex;
    align-items: flex-start;
    gap: 2.5rem;
    padding: 1.8rem 2rem 1.75rem;
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Ligne fine colorée en haut */
.player-top-bar::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent 70%);
}

/* Halo décoratif */
.player-top-bar::after {
    content: '';
    position: absolute;
    top: -80px; right: -80px;
    width: 260px; height: 260px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,140,0,0.08), transparent 65%);
    pointer-events: none;
}

/* Couleurs catégorie */
.player-active.category-paghjella .player-top-bar::before { background: linear-gradient(90deg, #C0392B, transparent 70%); }
.player-active.category-paghjella .player-top-bar::after  { background: radial-gradient(circle, rgba(192,57,43,0.12), transparent 65%); }
.player-active.category-terzettu  .player-top-bar::before { background: linear-gradient(90deg, #3498db, transparent 70%); }
.player-active.category-terzettu  .player-top-bar::after  { background: radial-gradient(circle, rgba(52,152,219,0.12), transparent 65%); }
.player-active.category-madricalu .player-top-bar::before { background: linear-gradient(90deg, #27ae60, transparent 70%); }
.player-active.category-madricalu .player-top-bar::after  { background: radial-gradient(circle, rgba(39,174,96,0.12), transparent 65%); }
.player-active.category-messa     .player-top-bar::before { background: linear-gradient(90deg, #8e44ad, transparent 70%); }
.player-active.category-messa     .player-top-bar::after  { background: radial-gradient(circle, rgba(142,68,173,0.12), transparent 65%); }

/* Info morceau — côté gauche */
.player-song-meta {
    flex: 1;
    min-width: 0;
}

.player-meta-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Transport — côté droit */
.player-transport {
    flex: 0 0 340px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.category-badge-player {
    display: inline-block;
    padding: 0.35rem 0.9rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: opacity 0.15s;
}

.category-badge-player:hover {
    opacity: 0.8;
}

.category-badge-player.category-paghjella {
    background-color: rgba(192, 57, 43, 0.2);
    color: #C0392B;
    border: 1px solid #C0392B;
}

.category-badge-player.category-terzettu {
    background-color: rgba(52, 152, 219, 0.2);
    color: #3498db;
    border: 1px solid #3498db;
}

.category-badge-player.category-madricalu {
    background-color: rgba(39, 174, 96, 0.2);
    color: #27ae60;
    border: 1px solid #27ae60;
}

.category-badge-player.category-messa {
    background-color: rgba(142, 68, 173, 0.2);
    color: #8e44ad;
    border: 1px solid #8e44ad;
}

#current-song-title {
    font-size: 2.4rem;
    font-weight: 900;
    letter-spacing: -1px;
    margin: 0 0 0.3rem;
    line-height: 1.3;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.player-active.category-paghjella #current-song-title {
    background: linear-gradient(135deg, #C0392B, #E74C3C);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.player-active.category-terzettu #current-song-title {
    background: linear-gradient(135deg, #3498db, #5dade2);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.player-active.category-madricalu #current-song-title {
    background: linear-gradient(135deg, #27ae60, #52c882);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.player-active.category-messa #current-song-title {
    background: linear-gradient(135deg, #8e44ad, #bb8fce);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

.song-locu {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.78);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 0.2rem 0.65rem;
    margin-bottom: 0.6rem;
    letter-spacing: 0.4px;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.song-locu::before {
    content: '◉';
    font-size: 0.6rem;
    color: rgba(255, 140, 0, 0.85);
}

.song-locu:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
}

.song-description {
    display: none;
}

/* .player-controls-compact removed — replaced by .player-transport inside .player-top-bar */

.playback-main {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-play-compact, .btn-stop-compact {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-play-compact:hover, .btn-stop-compact:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

.btn-stop-compact {
    width: 42px;
    height: 42px;
    font-size: 0.85rem;
}

/* Category-specific button colors */
.btn-play-compact.category-paghjella { border-color: rgba(192,57,43,0.5); color: #e05548; }
.btn-play-compact.category-terzettu  { border-color: rgba(52,152,219,0.5); color: #5dade2; }
.btn-play-compact.category-madricalu { border-color: rgba(39,174,96,0.5);  color: #52c882; }
.btn-play-compact.category-messa     { border-color: rgba(142,68,173,0.5); color: #bb8fce; }

/* État actif (lecture en cours) */
.btn-play-compact.is-playing.category-paghjella { background: rgba(192,57,43,0.25); border-color: rgba(192,57,43,0.8); color: #e05548; box-shadow: 0 0 10px rgba(192,57,43,0.3); }
.btn-play-compact.is-playing.category-terzettu  { background: rgba(52,152,219,0.25); border-color: rgba(52,152,219,0.8); color: #5dade2; box-shadow: 0 0 10px rgba(52,152,219,0.3); }
.btn-play-compact.is-playing.category-madricalu { background: rgba(39,174,96,0.25);  border-color: rgba(39,174,96,0.8);  color: #52c882; box-shadow: 0 0 10px rgba(39,174,96,0.3); }
.btn-play-compact.is-playing.category-messa     { background: rgba(142,68,173,0.25); border-color: rgba(142,68,173,0.8); color: #bb8fce; box-shadow: 0 0 10px rgba(142,68,173,0.3); }

/* Stop : visible seulement quand quelque chose est chargé, atténué à l'arrêt */
.btn-stop-compact.category-paghjella { border-color: rgba(192,57,43,0.25); color: rgba(224,85,72,0.35); }
.btn-stop-compact.category-terzettu  { border-color: rgba(52,152,219,0.25); color: rgba(93,173,226,0.35); }
.btn-stop-compact.category-madricalu { border-color: rgba(39,174,96,0.25);  color: rgba(82,200,130,0.35); }
.btn-stop-compact.category-messa     { border-color: rgba(142,68,173,0.25); color: rgba(187,143,206,0.35); }

/* Stop : actif quand la lecture est en cours (via .is-playing sur le play bouton → frère) */
.btn-play-compact.is-playing ~ .btn-stop-compact.category-paghjella,
:has(+ .btn-stop-compact) .btn-play-compact.is-playing ~ .btn-stop-compact { opacity: 1; }

.playback-main:has(.is-playing) .btn-stop-compact.category-paghjella { border-color: rgba(192,57,43,0.55); color: rgba(224,85,72,0.75); }
.playback-main:has(.is-playing) .btn-stop-compact.category-terzettu  { border-color: rgba(52,152,219,0.55); color: rgba(93,173,226,0.75); }
.playback-main:has(.is-playing) .btn-stop-compact.category-madricalu { border-color: rgba(39,174,96,0.55);  color: rgba(82,200,130,0.75); }
.playback-main:has(.is-playing) .btn-stop-compact.category-messa     { border-color: rgba(142,68,173,0.55); color: rgba(187,143,206,0.75); }

.progress-area {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.time-current, .time-total {
    font-size: 0.82rem;
    color: rgba(220, 200, 165, 0.45);
    font-weight: 600;
    min-width: 40px;
    font-variant-numeric: tabular-nums;
}

.progress-bar-compact {
    position: relative;
    flex: 1;
    height: 8px;
    background: rgba(255, 140, 0, 0.1);
    border-radius: 10px;
    cursor: pointer;
}

.progress-fill-compact {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 10px;
    width: 0%;
    transition: width 0.1s linear;
}

.progress-handle-compact {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    cursor: pointer;
    left: 0%;
    transition: left 0.1s linear;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.4);
    border: 3px solid white;
}


/* Category-specific progress bar colors */
.player-active.category-paghjella .progress-fill-compact {
    background: linear-gradient(90deg, #C0392B, #E74C3C);
}

.player-active.category-paghjella .progress-handle-compact {
    background: linear-gradient(135deg, #C0392B, #E74C3C);
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.4);
}

.player-active.category-terzettu .progress-fill-compact {
    background: linear-gradient(90deg, #3498db, #5dade2);
}

.player-active.category-terzettu .progress-handle-compact {
    background: linear-gradient(135deg, #3498db, #5dade2);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.player-active.category-madricalu .progress-fill-compact {
    background: linear-gradient(90deg, #27ae60, #52c882);
}

.player-active.category-madricalu .progress-handle-compact {
    background: linear-gradient(135deg, #27ae60, #52c882);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.player-active.category-messa .progress-fill-compact {
    background: linear-gradient(90deg, #8e44ad, #bb8fce);
}

.player-active.category-messa .progress-handle-compact {
    background: linear-gradient(135deg, #8e44ad, #bb8fce);
    box-shadow: 0 2px 8px rgba(142, 68, 173, 0.4);
}

/* ===== COLONNES DE VOIX (inspiré page d'accueil) ===== */

.voice-controls-compact {
    padding: 0;
}

/* Grille de voix — colonnes horizontales */
.voice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

/* ===== LAYOUT PLAYER : vertical (player + paroles empilés) ===== */

.player-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem 2rem 2rem;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Couleurs catégorie sur les colonnes de voix */
.player-active.category-paghjella .voice-section::before { background: linear-gradient(90deg, rgba(192,57,43,0.6), transparent 80%); }
.player-active.category-terzettu  .voice-section::before { background: linear-gradient(90deg, rgba(52,152,219,0.6), transparent 80%); }
.player-active.category-madricalu .voice-section::before { background: linear-gradient(90deg, rgba(39,174,96,0.6), transparent 80%); }
.player-active.category-messa     .voice-section::before { background: linear-gradient(90deg, rgba(142,68,173,0.6), transparent 80%); }

/* Ligne du bas : 3 cadres en ligne */
.player-bottom-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.lyrics-panel,
.bottom-panel {
    flex: 1;
    min-width: 0;
}

/* ===== FICHE DU MORCEAU ===== */

.side-fiche {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.side-section-label {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.25);
}

.side-section-label.category-paghjella { color: rgba(192, 57, 43, 0.7); }
.side-section-label.category-terzettu  { color: rgba(52, 152, 219, 0.7); }
.side-section-label.category-madricalu { color: rgba(39, 174, 96, 0.7); }
.side-section-label.category-messa     { color: rgba(142, 68, 173, 0.7); }

.side-fiche-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.side-description {
    font-size: 0.8rem;
    color: rgba(220, 200, 165, 0.65);
    line-height: 1.7;
    margin: 0;
}

.side-meta-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.side-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(220, 200, 165, 0.6);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 0.15rem 0.55rem;
}

.side-tag-cat {
    cursor: pointer;
    transition: opacity 0.15s;
}
.side-tag-cat:hover { opacity: 0.8; }

.side-tag-cat.category-paghjella { color: #e05548; background: rgba(192,57,43,0.12); border-color: rgba(192,57,43,0.3); }
.side-tag-cat.category-terzettu  { color: #5dade2; background: rgba(52,152,219,0.12); border-color: rgba(52,152,219,0.3); }
.side-tag-cat.category-madricalu { color: #52c882; background: rgba(39,174,96,0.12); border-color: rgba(39,174,96,0.3); }
.side-tag-cat.category-messa     { color: #bb8fce; background: rgba(142,68,173,0.12); border-color: rgba(142,68,173,0.3); }

/* Locu pill dans la cartula — même style que sur le site */
.side-tag-locu {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.62rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 0.1rem 0.45rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
}

.side-tag-locu:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.95);
}

.side-locu-dot {
    color: rgba(255, 140, 0, 0.85);
}

/* ===== MORCEAUX VOISINS ===== */

.side-voisins {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.side-voisins-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.side-song-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
}

.side-song-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.side-song-play {
    font-size: 0.75rem;
    flex-shrink: 0;
    opacity: 0.85;
    transition: opacity 0.15s;
}

.side-song-card:hover .side-song-play { opacity: 1; }

.side-song-play.category-paghjella { color: #e05548; }
.side-song-play.category-terzettu  { color: #5dade2; }
.side-song-play.category-madricalu { color: #52c882; }
.side-song-play.category-messa     { color: #bb8fce; }

.side-song-info { min-width: 0; }

.side-song-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(232, 220, 200, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.side-song-meta {
    font-size: 0.63rem;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 0.08rem;
}

/* Paroles */
.lyrics-panel {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: rgba(0, 0, 0, 0.52);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
    padding: 1.5rem 2rem;
}

.lyrics-heading {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.lyrics-heading.category-paghjella { color: rgba(192,57,43,0.7); }
.lyrics-heading.category-terzettu  { color: rgba(52,152,219,0.7); }
.lyrics-heading.category-madricalu { color: rgba(39,174,96,0.7); }
.lyrics-heading.category-messa     { color: rgba(142,68,173,0.7); }

.lyrics-content {
    color: rgba(232, 220, 200, 0.85);
    font-size: 0.88rem;
    line-height: 1.9;
    white-space: pre-wrap;
    scrollbar-width: thin;
}

.lyrics-content::-webkit-scrollbar {
    display: none;
}

.player-footer {
    padding: 0.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    text-align: center;
}

/* Liste des chansons */
#song-list h2 {
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
}

#songs-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.song-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid var(--primary-color);
}


.song-card h3 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.song-card p {
    color: #666;
    font-size: 0.9rem;
}

.song-card .meta {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: #999;
}

/* Category-specific colors */
.song-card.category-paghjella {
    border-left-color: #C0392B;
}

.song-card.category-paghjella h3 {
    color: #C0392B;
}

.song-card.category-terzettu {
    border-left-color: #3498db;
}

.song-card.category-terzettu h3 {
    color: #3498db;
}

.song-card.category-madricalu {
    border-left-color: #27ae60;
}

.song-card.category-madricalu h3 {
    color: #27ae60;
}

.song-card.category-messa {
    border-left-color: #8e44ad;
}

.song-card.category-messa h3 {
    color: #8e44ad;
}

.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.category-badge.category-paghjella {
    background-color: rgba(192, 57, 43, 0.1);
    color: #C0392B;
}

.category-badge.category-terzettu {
    background-color: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.category-badge.category-madricalu {
    background-color: rgba(39, 174, 96, 0.1);
    color: #27ae60;
}

.category-badge.category-messa {
    background-color: rgba(142, 68, 173, 0.1);
    color: #8e44ad;
}

/* Messages */
.loading {
    text-align: center;
    padding: 2rem;
    color: #999;
}

.error-message {
    background-color: #ffe6e6;
    color: var(--error-color);
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--error-color);
}

.success-message {
    background-color: #e6ffe6;
    color: var(--success-color);
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid var(--success-color);
}

/* Auth pages */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
}

.auth-box {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 450px;
}

.auth-box h2 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.auth-box .subtitle {
    color: #666;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 0.3rem;
    color: #999;
    font-size: 0.85rem;
}

.auth-links {
    margin-top: 1.5rem;
    text-align: center;
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.demo-credentials {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 5px;
    font-size: 0.85rem;
}

.demo-credentials code {
    background-color: #e0e0e0;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* Footer */
footer {
    background-color: rgba(6, 3, 1, 0.6);
    color: rgba(220, 200, 165, 0.35);
    text-align: center;
    padding: 1.2rem 0;
    margin-top: 0;
    border-top: 1px solid rgba(255, 140, 0, 0.15);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
}

footer a {
    color: rgba(220, 200, 165, 0.45);
    text-decoration: none;
    transition: color 0.2s;
}

footer a:hover {
    color: var(--primary-color);
}

/* ===== BACK TO TOP ===== */

#back-to-top {
    position: fixed;
    bottom: 1.8rem;
    right: 1.8rem;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    background: rgba(10, 6, 2, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(220, 200, 165, 0.6);
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.22s ease, transform 0.22s ease, border-color 0.2s ease, color 0.2s ease;
    pointer-events: none;
    z-index: 500;
}

#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#back-to-top:hover {
    border-color: rgba(255, 140, 0, 0.4);
    color: var(--primary-color);
}

/* ===== THÈME SOMBRE ===== */

html {
    background-color: #0d0e14;
}

body {
    /* Voile sombre global + image de fond — s'applique à toutes les pages */
    background-image:
        linear-gradient(rgba(5, 2, 0, 0.74), rgba(5, 2, 0, 0.74)),
        var(--bg-image, none);
    background-size: cover, 100% auto;
    background-repeat: no-repeat, no-repeat;
    background-position: center, center top;
    background-attachment: fixed, fixed;
    background-color: #0d0e14;
    color: #e8dcc8;
}

/* ===== SIDEBAR — dark theme overrides ===== */

.filter-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(220, 200, 165, 0.75);
}

/* Cartes de morceaux */
.songs-list .song-card {
    background: rgba(10, 6, 2, 0.45) !important;
}

.songs-list .song-card p {
    color: rgba(220, 200, 165, 0.55) !important;
}

.songs-list .song-card .meta {
    color: rgba(255, 255, 255, 0.6) !important;
}

.player-section {
    background: transparent;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 0;
    overflow-y: auto;
}

.player-empty-state h3 { color: rgba(255,255,255,0.35); }
.player-empty-state p  { color: rgba(255,255,255,0.2); }
.empty-icon { opacity: 0.15; }

.player-active {
    background: rgba(18, 18, 22, 0.92);
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
}

.player-controls-compact {
    background: transparent;
    padding: 1.5rem 2rem;
}

.time-current, .time-total {
    color: rgba(255,255,255,0.5);
}

.progress-bar-compact {
    background: rgba(255,255,255,0.08);
}

.progress-handle-compact {
    border-color: #1c1108;
    box-shadow: 0 0 12px rgba(255,140,0,0.8), 0 0 4px rgba(255,140,0,0.5);
}

.player-active.category-paghjella .progress-handle-compact {
    box-shadow: 0 0 12px rgba(192,57,43,0.8), 0 0 4px rgba(192,57,43,0.5);
    border-color: #1c1108;
}

.player-active.category-terzettu .progress-handle-compact {
    box-shadow: 0 0 12px rgba(52,152,219,0.8), 0 0 4px rgba(52,152,219,0.5);
    border-color: #1c1108;
}

.player-active.category-madricalu .progress-handle-compact {
    box-shadow: 0 0 12px rgba(39,174,96,0.8), 0 0 4px rgba(39,174,96,0.5);
    border-color: #1c1108;
}

.player-active.category-messa .progress-handle-compact {
    box-shadow: 0 0 12px rgba(142,68,173,0.8), 0 0 4px rgba(142,68,173,0.5);
    border-color: #1c1108;
}

.voice-controls-compact {
    border-top: 1px solid rgba(255,255,255,0.07);
    padding: 1rem 2rem 0.75rem;
}

.voice-controls-compact h3 {
    color: rgba(255,255,255,0.3);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.6rem;
}

.player-active.category-paghjella .voice-controls-compact h3 { color: rgba(192,57,43,0.5); }
.player-active.category-terzettu  .voice-controls-compact h3 { color: rgba(52,152,219,0.5); }
.player-active.category-madricalu .voice-controls-compact h3 { color: rgba(39,174,96,0.5); }
.player-active.category-messa     .voice-controls-compact h3 { color: rgba(142,68,173,0.5); }

.player-footer {
    background: transparent;
    border-top: 1px solid rgba(255,255,255,0.07);
}

.settings-status {
    font-size: 0.58rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: rgba(255, 255, 255, 0.22);
}

/* Song cards hover in dark sidebar */
.songs-list .song-card:hover {
    background: rgba(10, 6, 2, 0.80) !important;
}

/* Auth pages — dark theme */
.auth-box {
    background: rgba(10, 6, 2, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e8dcc8;
}

.auth-box h2 {
    color: #f0e8d8;
}

.auth-box .subtitle {
    color: rgba(220, 200, 165, 0.55);
}

.auth-box .form-group label {
    color: rgba(220, 200, 165, 0.7);
}

.auth-box .form-group input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e8dcc8;
}

.auth-box .form-group input:focus {
    border-color: var(--primary-color);
    background: rgba(255, 255, 255, 0.09);
}

.auth-box .form-group small {
    color: rgba(220, 200, 165, 0.4);
}

.auth-box .auth-links {
    color: rgba(220, 200, 165, 0.6);
}

.auth-box .demo-credentials {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: rgba(220, 200, 165, 0.55);
}

.auth-box .demo-credentials code {
    background: rgba(255, 255, 255, 0.08);
    color: #e8dcc8;
}

/* Error/success messages — dark theme global */
.error-message {
    background: rgba(231, 76, 60, 0.12);
    color: rgba(240, 120, 100, 0.95);
    border-left-color: rgba(231, 76, 60, 0.45);
}

.success-message {
    background: rgba(39, 174, 96, 0.1);
    color: rgba(100, 210, 140, 0.95);
    border-left-color: rgba(39, 174, 96, 0.4);
}

/* ===== LAYOUT HOME (sans sidebar) ===== */

.player-main.layout-home {
    grid-template-columns: 1fr;
}

.player-main.layout-home .sidebar-navigation {
    display: none;
}

/* ===== HOME PAGE ===== */

.repertoriu-view {
    width: 100%;
    overflow-y: auto;
    min-height: calc(100vh - 60px);
}

/* Hero */
.home-hero {
    padding: 4rem 5rem 3.5rem;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.07);
}

.home-hero-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    color: var(--primary-color);
    border: 1px solid rgba(255,140,0,0.4);
    padding: 0.3rem 1.1rem;
    border-radius: 20px;
    margin-bottom: 1.25rem;
    background: rgba(255,140,0,0.08);
}

.home-hero-title {
    font-size: 4rem;
    font-weight: 900;
    letter-spacing: -2px;
    color: #f0e8d8;
    line-height: 1;
    margin-bottom: 1rem;
}

.home-hero-year {
    color: var(--primary-color);
}

.home-hero-subtitle {
    font-size: 1rem;
    color: rgba(220,200,165,0.7);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Catégories — une par ligne, info à gauche / songs à droite */
.home-categories {
    display: flex;
    flex-direction: column;
}

.home-cat {
    display: grid;
    grid-template-columns: 340px 1fr;
    grid-template-rows: auto 1fr;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: relative;
    min-height: 220px;
}

.home-cat:last-child {
    border-bottom: none;
}

/* Barre colorée à gauche */
.home-cat::before {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 3px;
}

.home-cat.category-paghjella::before { background: linear-gradient(180deg, #C0392B, rgba(192,57,43,0.1)); }
.home-cat.category-terzettu::before  { background: linear-gradient(180deg, #3498db, rgba(52,152,219,0.1)); }
.home-cat.category-madricalu::before { background: linear-gradient(180deg, #27ae60, rgba(39,174,96,0.1)); }
.home-cat.category-messa::before     { background: linear-gradient(180deg, #8e44ad, rgba(142,68,173,0.1)); }

/* Colonne gauche : infos catégorie */
.home-cat-header {
    grid-column: 1;
    grid-row: 1 / 3;
    padding: 2.5rem 2.5rem 2.5rem 3rem;
    border-right: 1px solid rgba(255,255,255,0.06);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.75rem;
}

.home-cat-icon {
    font-size: 2rem;
    line-height: 1;
}

.category-paghjella .home-cat-icon { color: #C0392B; }
.category-terzettu  .home-cat-icon { color: #3498db; }
.category-madricalu .home-cat-icon { color: #27ae60; }
.category-messa     .home-cat-icon { color: #8e44ad; }

.home-cat-title {
    font-size: 1.8rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    line-height: 1;
}

.category-paghjella .home-cat-title { color: #C0392B; }
.category-terzettu  .home-cat-title { color: #3498db; }
.category-madricalu .home-cat-title { color: #27ae60; }
.category-messa     .home-cat-title { color: #8e44ad; }

.home-cat-count {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(220,200,165,0.45);
}

.home-cat-desc {
    font-size: 0.875rem;
    color: rgba(220,200,165,0.6);
    line-height: 1.7;
    margin-top: 0.25rem;
}

/* Colonne droite : liste des morceaux */
.home-cat-songs {
    grid-column: 2;
    grid-row: 1 / 3;
    padding: 2rem 2.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
    align-content: start;
}

/* Song cards */
.home-song-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.05);
    transition: background 0.15s, border-color 0.15s;
    height: fit-content;
}

.home-song-card:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.1);
}

.home-song-play {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.home-song-card:hover .home-song-play { transform: scale(1.15); }

.category-paghjella .home-song-play { background: rgba(192,57,43,0.3); color: #e05548; border: 1px solid rgba(192,57,43,0.45); }
.category-terzettu  .home-song-play { background: rgba(52,152,219,0.3); color: #5dade2; border: 1px solid rgba(52,152,219,0.45); }
.category-madricalu .home-song-play { background: rgba(39,174,96,0.3);  color: #52c882; border: 1px solid rgba(39,174,96,0.45); }
.category-messa     .home-song-play { background: rgba(142,68,173,0.3); color: #bb8fce; border: 1px solid rgba(142,68,173,0.45); }

.home-song-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(232,220,200,0.9);
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.home-song-meta {
    font-size: 0.72rem;
    color: rgba(200,180,150,0.55);
}

.home-cat-empty {
    color: rgba(255,255,255,0.2);
    font-style: italic;
    font-size: 0.85rem;
    grid-column: 1 / -1;
}

@media (max-width: 900px) {
    .home-hero { padding: 2.5rem 2rem; }
    .home-hero-title { font-size: 2.8rem; }
    .home-cat { grid-template-columns: 1fr; }
    .home-cat-header {
        grid-row: 1;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        padding: 2rem 2rem 1.5rem 2.5rem;
    }
    .home-cat-songs { grid-column: 1; grid-row: 2; padding: 1.5rem 2rem; }
}

/* ===== FIN THÈME SOMBRE ===== */

/* Responsive */
@media (max-width: 768px) {
    body {
        background-attachment: scroll, scroll; /* fixed pose problème sur iOS Safari */
    }

    header {
        padding: 0;
    }

    header .container {
        flex-wrap: nowrap;
        gap: 0.5rem;
        height: 58px;
    }

    .logo {
        font-size: 1.2rem;
    }

    .header-nav {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        gap: 0.5rem;
    }

    .nav-link {
        padding: 0 0.6rem;
        font-size: 0.62rem;
        letter-spacing: 1.5px;
    }

    .header-right {
        gap: 0.4rem;
        flex-shrink: 0;
    }

    #user-info, #guest-info {
        gap: 0.4rem;
    }

    .username {
        display: none;
    }

    /* Boutons généraux (formulaires, pages) */
    .btn {
        padding: 0.6rem 1.1rem;
        font-size: 0.9rem;
    }

    /* Boutons du header : restent compacts comme sur desktop */
    .header-right .btn {
        padding: 0.3rem 0.7rem;
        font-size: 0.66rem;
        letter-spacing: 1.5px;
    }

    #songs-container {
        grid-template-columns: 1fr;
    }

    .auth-box {
        padding: 1.5rem;
    }

    /* Player Layout Mobile */
    .player-main {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
    }

    .sidebar-navigation {
        display: none;
    }

    .sidebar-header {
        padding: 1.5rem 1rem 0.75rem;
    }

    .sidebar-header h2 {
        font-size: 1.3rem;
    }

    .category-filters {
        padding: 0.75rem 1rem;
    }

    .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .songs-list {
        max-height: 40vh;
    }

    /* Player mobile : plein écran, aucun padding */
    .player-section {
        padding: 0;
        align-items: stretch;
        justify-content: flex-start;
    }

    .player-layout {
        padding: 0;
        gap: 0;
        max-width: 100%;
    }

    .player-active {
        max-width: 100%;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    /* Top bar : empilé verticalement */
    .player-top-bar {
        flex-direction: column;
        gap: 0.85rem;
        padding: 1.25rem 1.2rem 1rem;
        align-items: stretch;
    }

    .player-song-meta {
        min-width: 0;
    }

    #current-song-title {
        font-size: 1.75rem;
        letter-spacing: -0.5px;
    }

    /* Transport pleine largeur */
    .player-transport {
        flex: none;
        width: 100%;
    }

    /* Ligne play/stop/barre en une seule rangée */
    .playback-main {
        flex-wrap: nowrap;
        gap: 0.75rem;
        align-items: center;
    }

    .btn-play-compact {
        width: 50px;
        height: 50px;
        font-size: 1.15rem;
        flex-shrink: 0;
    }

    .btn-stop-compact {
        width: 42px;
        height: 42px;
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    /* Barre de progression : reset des overrides qui cassaient le layout */
    .progress-area {
        flex: 1;
        width: auto;
        order: 0;
        gap: 0.5rem;
    }

    .time-current, .time-total {
        font-size: 0.72rem;
        min-width: 34px;
    }

    /* Voix : une colonne pleine largeur */
    .voice-grid {
        grid-template-columns: 1fr;
    }

    .voice-section {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.04);
        padding: 0.85rem 1.2rem 0.65rem;
    }

    .voice-card {
        min-height: 50px;
    }

    /* Panneaux du bas : empilés verticalement sur mobile */
    .player-bottom-row {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 0;
    }

    .lyrics-panel,
    .bottom-panel {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
    }

    .side-fiche,
    .side-voisins {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .lyrics-panel {
        border-radius: 0;
        border-left: none;
        border-right: none;
        border-top: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        padding: 1.2rem 1.2rem;
    }
}

/* ===== PWA STANDALONE — safe areas & footer ===== */

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