/* ==================== TUTORYTHME STYLES ==================== */

/* ==================== ICÔNES HEADER ==================== */
.header-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 20px;
}

.header-icon-btn:hover {
    border-color: #2196f3;
    background: #e3f2fd;
}

.header-icon-btn.active {
    border-color: #2196f3;
    background: #e3f2fd;
}

.icon-exercise {
    color: #2196f3;
}

.icon-style {
    color: #e91e63;
}

#styleToggle {
    border-color: #f8bbd0;
}

#styleToggle:hover,
#styleToggle.active {
    border-color: #e91e63;
    background: #fce4ec;
}

.header-icon-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ==================== DRAWER GAUCHE ==================== */
.drawer-left {
    left: -320px;
    right: auto;
    transition: left 0.3s ease;
}

.drawer-left.active {
    left: 0;
}

/* ==================== SELECTOR LIST ==================== */
.selector-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.selector-group {
    margin-bottom: 12px;
}

.selector-group-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    padding: 8px 12px 4px;
    border-bottom: 1px solid #eee;
}

.selector-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: #fff;
    text-align: left;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 4px;
}

.selector-item:hover {
    background: #f5f5f5;
}

.selector-item.active {
    background: #e3f2fd;
    color: #1976d2;
    font-weight: 500;
}

#styleList .selector-item.active {
    background: #fce4ec;
    color: #c2185b;
}

/* État désactivé pour les contrôles quand un style est sélectionné */
.tempo-control.disabled,
.time-sig-control.disabled,
.exercise-select.disabled,
.header-option.disabled {
    opacity: 0.5;
    pointer-events: none;
}

.tempo-control.disabled input[type="range"] {
    cursor: not-allowed;
}

.time-sig-control.disabled select,
.exercise-select.disabled select {
    cursor: not-allowed;
    background: #f5f5f5;
}

/* Contrôle BPM dans le header */
.tempo-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bpm-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.bpm-btn:hover {
    background: #f0f0f0;
}

.bpm-value {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    min-width: 32px;
    text-align: right;
}

.tempo-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Slider desktop - caché sur mobile */
.bpm-slider-desktop {
    width: 80px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #2196f3 0%, #2196f3 var(--value-percent, 25%), #ddd var(--value-percent, 25%), #ddd 100%);
    border-radius: 3px;
    cursor: pointer;
}

.bpm-slider-desktop::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #2196f3;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s;
}

.bpm-slider-desktop::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

.bpm-slider-desktop::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #2196f3;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ==================== POPUP BPM (MOBILE) ==================== */
.bpm-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.bpm-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.bpm-popup {
    background: #fff;
    border-radius: 20px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    transform: scale(0.9);
    transition: transform 0.2s ease;
}

.bpm-popup-overlay.active .bpm-popup {
    transform: scale(1);
}

.bpm-popup-value {
    font-size: 72px;
    font-weight: 700;
    color: #2196f3;
    line-height: 1;
    margin-bottom: 5px;
}

.bpm-popup-label {
    font-size: 18px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 25px;
}

.bpm-popup-slider {
    width: 100%;
    height: 12px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(to right, #2196f3 0%, #2196f3 var(--value-percent, 25%), #e0e0e0 var(--value-percent, 25%), #e0e0e0 100%);
    border-radius: 6px;
    cursor: pointer;
    margin-bottom: 10px;
}

.bpm-popup-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 36px;
    height: 36px;
    background: #2196f3;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.4);
}

.bpm-popup-slider::-moz-range-thumb {
    width: 36px;
    height: 36px;
    background: #2196f3;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(33, 150, 243, 0.4);
}

.bpm-popup-range {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

.demo-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Contrôle mesure dans le header */
.time-sig-control select {
    padding: 6px 10px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.time-sig-control select:hover {
    border-color: #2196f3;
}

.time-sig-control select:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.2);
}

/* Zone principale */
.rhythm-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    gap: 30px;
    overflow: hidden;
}

/* ==================== TIMELINE ==================== */
.timeline-container {
    width: 100%;
    max-width: 1000px;
    padding: 20px 0;
}

.timeline {
    position: relative;
    height: 80px;
    background: linear-gradient(to right, #f5f5f5, #fff, #f5f5f5);
    border-radius: 12px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    /* Padding pour décaler le premier temps */
    margin-left: 20px;
    margin-right: 20px;
}

.beat-markers {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
}

.beat-marker {
    flex: 1;
    border-left: 2px solid #ddd;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 8px;
    font-size: 12px;
    color: #999;
    position: relative;
}

.beat-marker:first-child {
    border-left: none;
}

.beat-marker.strong {
    border-left-width: 3px;
    border-left-color: #333;
    background: rgba(0, 0, 0, 0.03);
}

.beat-marker.strong::after {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    width: 4px;
    height: 100%;
    background: #333;
}

/* Temps réguliers (downbeats non-premier) */
.beat-marker.downbeat {
    border-left-width: 2px;
    border-left-color: #666;
}

/* Positions cibles à taper */
.beat-marker.target {
    background: rgba(76, 175, 80, 0.15);
}

.beat-marker.target::before {
    content: '';
    position: absolute;
    bottom: 30px;
    left: 0;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #4CAF50;
    border-radius: 50%;
}

/* Curseur qui avance */
.cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #2196f3;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
    z-index: 10;
    transform: translateX(-50%);
    left: 0;
    transition: none;
}

.cursor::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #2196f3;
}

/* Markers de taps */
.taps-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

/* Indicateur DEMO discret */
.demo-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 4px;
    color: rgba(255, 152, 0, 0.35);
    text-transform: uppercase;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.demo-indicator.visible {
    opacity: 1;
}

.tap-marker {
    position: absolute;
    top: 10px;
    bottom: 10px;
    width: 6px;
    border-radius: 3px;
    transform: translateX(-50%);
    z-index: 5;
}

.tap-marker.perfect {
    background: #4caf50;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.6);
}

.tap-marker.good {
    background: #ff9800;
    box-shadow: 0 0 8px rgba(255, 152, 0, 0.6);
}

.tap-marker.early {
    background: #f44336;
    box-shadow: 0 0 8px rgba(244, 67, 54, 0.6);
}

.tap-marker.late {
    background: #9c27b0;
    box-shadow: 0 0 8px rgba(156, 39, 176, 0.6);
}

.tap-marker.demo {
    background: #2196f3;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.6);
}

.tap-marker.wrong_pad {
    background: #795548;
    box-shadow: 0 0 8px rgba(121, 85, 72, 0.6);
}

.tap-marker.miss {
    background: #e91e63;
    box-shadow: 0 0 8px rgba(233, 30, 99, 0.6);
    opacity: 0.7;
}

.tap-marker.extra {
    background: #607d8b;
    box-shadow: 0 0 8px rgba(96, 125, 139, 0.6);
    opacity: 0.5;
}

/* Polyrythmie : markers sur deux lignes */
.tap-marker.pad-left {
    top: 8px;
    bottom: auto;
    height: 40%;
}

.tap-marker.pad-right {
    top: auto;
    bottom: 8px;
    height: 40%;
}

/* ==================== TITRE SELECTION (dans footer) ==================== */
.current-selection {
    display: flex;
    align-items: center;
    margin-left: auto;
    padding-left: 15px;
}

.selection-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

/* Footer TutoRythme - override styles de style2.css */
#flex-container {
    left: 0;
    padding: 0 40px;
    box-sizing: border-box;
    justify-content: flex-start;
}

#flex-container .temps,
#flex-container .score {
    flex-shrink: 0;
}

/* ==================== INDICATEUR DE MESURE ==================== */
.measure-indicator {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-family: 'Arial', sans-serif;
}

.beat-number {
    font-size: 72px;
    font-weight: 700;
    color: #333;
    line-height: 1;
    min-width: 80px;
    text-align: center;
}

.beat-total {
    font-size: 24px;
    color: #999;
}

.beat-number.accent {
    color: #2196f3;
    transform: scale(1.1);
}

/* ==================== PADS ==================== */
.pads-container {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.tap-pad {
    width: 200px;
    height: 200px;
    border-radius: 20px;
    background: linear-gradient(145deg, #f0f0f0, #cacaca);
    box-shadow: 8px 8px 16px #bebebe, -8px -8px 16px #ffffff;
    cursor: pointer;
    transition: all 0.1s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.tap-pad:hover {
    background: linear-gradient(145deg, #e8e8e8, #c2c2c2);
}

.tap-pad:active,
.tap-pad.active {
    box-shadow: inset 4px 4px 8px #bebebe, inset -4px -4px 8px #ffffff;
    background: linear-gradient(145deg, #d8d8d8, #b8b8b8);
}

.tap-pad.flash-perfect {
    background: linear-gradient(145deg, #81c784, #4caf50) !important;
}

.tap-pad.flash-good {
    background: linear-gradient(145deg, #ffb74d, #ff9800) !important;
}

.tap-pad.flash-miss {
    background: linear-gradient(145deg, #e57373, #f44336) !important;
}

.pad-inner {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.pad-label {
    font-size: 32px;
    font-weight: 700;
    color: #555;
    text-transform: uppercase;
}

.pad-key {
    font-size: 14px;
    color: #888;
    background: rgba(0, 0, 0, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
}

/* Mode polyrythmie - 2 pads */
.pads-container.poly .tap-pad {
    width: 160px;
    height: 160px;
}

.tap-pad[data-pad="1"],
.pads-container.poly .tap-pad[data-pad="1"] {
    background: linear-gradient(145deg, #e3f2fd, #90caf9);
}

.tap-pad[data-pad="2"],
.tap-pad-right,
.pads-container.poly .tap-pad[data-pad="2"] {
    background: linear-gradient(145deg, #fce4ec, #f48fb1);
}

/* Desktop polyrythmie - layout horizontal avec pads côte à côte */
.interaction-zone.poly {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 40px;
}

.interaction-zone.poly .tap-pad-right {
    width: 160px;
    height: 160px;
}

/* Wrapper central : compteur au-dessus du feedback */
.poly-center-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.poly-center-group .measure-indicator {
    justify-content: center;
}

.poly-center-group .feedback-container {
    flex-direction: row;
    gap: 30px;
}

/* ==================== FEEDBACK ==================== */
.feedback-container {
    display: flex;
    gap: 40px;
    align-items: center;
}

.feedback-timing,
.feedback-score {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.timing-label,
.score-label {
    font-size: 12px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
}

.timing-value,
.score-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.timing-value.perfect {
    color: #4caf50;
}

.timing-value.good {
    color: #ff9800;
}

.timing-value.early {
    color: #f44336;
}

.timing-value.late {
    color: #9c27b0;
}

.timing-value.miss {
    color: #e91e63;
}

/* ==================== ZONE D'INTERACTION ==================== */
.interaction-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    flex: 1;
}

/* ==================== RESPONSIVE ==================== */

/* Mobile paysage : hauteur limitée */
@media (max-height: 500px) {
    /* Cacher le slider desktop, garder seulement le bouton */
    .bpm-slider-desktop {
        display: none;
    }

    .rhythm-main {
        padding: 5px 10px;
        gap: 5px;
    }

    .timeline {
        height: 50px;
    }

    .timeline-container {
        padding: 3px 0;
    }

    /* Zone d'interaction horizontale */
    .interaction-zone {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 30px;
        width: 100%;
        flex: 1;
    }

    /* Compteur à gauche */
    .measure-indicator {
        gap: 4px;
        flex-shrink: 0;
    }

    .beat-number {
        font-size: 48px;
        min-width: 50px;
    }

    .beat-total {
        font-size: 18px;
    }

    /* Pad au centre - taille tactile confortable */
    .pads-container {
        flex-shrink: 0;
    }

    .tap-pad {
        width: 160px;
        height: 90px;
        border-radius: 16px;
    }

    .pad-inner {
        gap: 4px;
    }

    .pad-label {
        font-size: 22px;
    }

    .pad-key {
        display: none;
    }

    /* Feedback à droite */
    .feedback-container {
        flex-direction: column;
        gap: 10px;
        flex-shrink: 0;
    }

    .feedback-timing,
    .feedback-score {
        flex-direction: row;
        gap: 8px;
    }

    .timing-value,
    .score-value {
        font-size: 20px;
        min-width: 50px;
    }

    .timing-label,
    .score-label {
        font-size: 11px;
    }

    /* Mode polyrythmie : pad1 gauche - centre (compteur+feedback) - pad2 droite */
    .interaction-zone.poly {
        justify-content: space-between;
        padding: 0 40px;
    }

    /* Wrapper central en mode mobile : horizontal */
    .poly-center-group {
        flex-direction: row;
        gap: 20px;
        order: 1;
    }

    /* Pad 1 (KICK) à gauche */
    .interaction-zone.poly .pads-container {
        order: 0;
    }

    /* Pad 2 (SNARE) à droite */
    .interaction-zone.poly .tap-pad-right {
        order: 2;
    }

    /* Taille réduite des pads en polyrythmie */
    .interaction-zone.poly .tap-pad {
        width: 120px;
        height: 80px;
    }

    /* Compteur plus petit en mobile poly */
    .poly-center-group .beat-number {
        font-size: 36px;
        min-width: 40px;
    }

    .poly-center-group .beat-total {
        font-size: 14px;
    }

    /* Footer stats - meilleur espacement */
    .flex-container2 {
        padding: 8px 20px;
        gap: 30px;
    }

    .flex-container2 .temps,
    .flex-container2 .score {
        font-size: 14px;
    }

    .flex-container2 .temps label,
    .flex-container2 .score label {
        font-size: 12px;
    }

    .selection-title {
        font-size: 13px;
    }
}

/* Mobile portrait */
@media (max-width: 768px) {
    /* Cacher le slider desktop, garder seulement le bouton */
    .bpm-slider-desktop {
        display: none;
    }

    .rhythm-main {
        padding: 10px;
        gap: 15px;
    }

    .timeline {
        height: 60px;
    }

    /* Réduire le compteur */
    .beat-number {
        font-size: 48px;
        min-width: 50px;
    }

    .beat-total {
        font-size: 18px;
    }

    /* Réduire le pad */
    .tap-pad {
        width: 120px;
        height: 120px;
    }

    .pad-label {
        font-size: 22px;
    }

    .pad-key {
        display: none;
    }

    .pads-container.poly .tap-pad {
        width: 100px;
        height: 100px;
    }

    .feedback-container {
        gap: 20px;
    }

    .timing-value,
    .score-value {
        font-size: 20px;
    }
}

@media (max-width: 500px) {
    .rhythm-main {
        gap: 10px;
    }

    .selection-title {
        font-size: 10px;
    }

    /* Compteur encore plus petit */
    .beat-number {
        font-size: 40px;
        min-width: 40px;
    }

    .beat-total {
        font-size: 16px;
    }

    /* Pad plus petit */
    .tap-pad {
        width: 100px;
        height: 100px;
        border-radius: 14px;
    }

    .pad-label {
        font-size: 18px;
    }

    .pads-container.poly .tap-pad {
        width: 80px;
        height: 80px;
    }

    /* Feedback plus compact */
    .timing-value,
    .score-value {
        font-size: 18px;
    }

    .timing-label,
    .score-label {
        font-size: 10px;
    }
}

/* ==================== NOTIFICATION FIN DE SESSION ==================== */
.session-end-notification {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    cursor: pointer;
}

.session-end-notification.visible {
    opacity: 1;
}

.session-end-content {
    text-align: center;
    color: white;
    padding: 40px;
    animation: sessionEndPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes sessionEndPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.session-end-icon {
    font-size: 72px;
    margin-bottom: 16px;
}

.session-end-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #f97316;
}

.session-end-message {
    font-size: 20px;
    margin-bottom: 24px;
    opacity: 0.9;
}

.session-end-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.session-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    min-width: 80px;
}

.session-stat .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #fbbf24;
}

.session-stat .stat-label {
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.7;
    margin-top: 4px;
}

.session-stat.miss .stat-value {
    color: #e91e63;
}

.session-stat.extra .stat-value {
    color: #607d8b;
}

@media (max-width: 480px) {
    .session-end-stats {
        gap: 12px;
    }

    .session-stat {
        padding: 12px 16px;
        min-width: 70px;
    }

    .session-stat .stat-value {
        font-size: 22px;
    }
}

/* ==================== MODE PARTITION VEXFLOW ==================== */

.vexflow-container {
    display: none;
    width: 100%;
    max-width: 850px;
    margin: 0 auto 10px;
    padding: 15px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.vexflow-container.active {
    display: block;
}

.vexflow-score {
    width: 100%;
    overflow-x: auto;
}

.vexflow-score {
    position: relative;
}

.vexflow-score svg {
    display: block;
    margin: 0 auto;
}

/* Curseur sur la partition VexFlow */
.vexflow-cursor {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #2196f3;
    box-shadow: 0 0 8px rgba(33, 150, 243, 0.6);
    z-index: 10;
    pointer-events: none;
    transition: none;
}

.vexflow-cursor::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #2196f3;
}

/* Cacher la timeline quand VexFlow est actif */
.timeline-container.hidden {
    display: none !important;
}

/* Mode VexFlow : cacher le pattern textuel */
body.vexflow-mode .reading-pattern-display {
    display: none !important;
}

/* Responsive VexFlow */
@media (max-width: 900px) {
    .vexflow-container {
        padding: 10px;
        border-radius: 8px;
    }
}

@media (max-height: 500px) {
    .vexflow-container {
        padding: 8px;
        margin-bottom: 5px;
    }
}

/* ==================== MODE LECTURE ==================== */

.reading-pattern-display {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    margin-bottom: 10px;
}

.reading-pattern-display.active {
    display: flex;
}

.reading-pattern-notation {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
}

.beat-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    font-size: 20px;
    font-weight: 700;
    border-radius: 8px;
    transition: all 0.15s ease;
}

/* Note à jouer */
.beat-slot.active {
    background: #fff;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Silence (position non jouée) */
.beat-slot.rest {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.4);
}

/* Subdivisions (& e a) plus petites */
.beat-slot.sub {
    min-width: 24px;
    height: 28px;
    font-size: 14px;
    font-weight: 600;
}

.beat-slot.sub.active {
    background: rgba(255, 255, 255, 0.9);
}

.beat-slot.sub.rest {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.25);
}

/* Indicateur mode lecture dans le body */
body.reading-mode .timeline-container {
    border: 2px solid rgba(102, 126, 234, 0.5);
    border-radius: 16px;
    padding: 5px;
}

/* Responsive mode lecture */
@media (max-height: 500px) {
    .reading-pattern-display {
        padding: 8px 20px;
        margin-bottom: 5px;
    }

    .beat-slot {
        min-width: 28px;
        height: 28px;
        font-size: 16px;
    }

    .beat-slot.sub {
        min-width: 20px;
        height: 22px;
        font-size: 12px;
    }
}

@media (max-width: 500px) {
    .reading-pattern-display {
        padding: 10px 15px;
    }

    .beat-slot {
        min-width: 30px;
        height: 30px;
        font-size: 16px;
    }

    .beat-slot.sub {
        min-width: 20px;
        height: 24px;
        font-size: 12px;
    }
}

/* ==================== COUNTDOWN SESSION ==================== */

/* Countdown dans l'overlay de fin de session */
.session-end-countdown {
    margin-top: 15px;
    font-size: 1.2rem;
    color: #999;
    font-weight: 500;
}

/* Overlay de countdown avant démarrage - semi-transparent pour voir le pattern */
.start-countdown-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.start-countdown-overlay.visible {
    opacity: 1;
}

.start-countdown-circle {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.5);
    animation: countdownPulse 1s ease-in-out infinite;
}

.start-countdown-number {
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.start-countdown-number.pulse {
    animation: numberPop 0.2s ease-out;
}

@keyframes countdownPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes numberPop {
    0% {
        transform: scale(1.3);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive countdown */
@media (max-height: 500px) {
    .start-countdown-circle {
        width: 80px;
        height: 80px;
    }

    .start-countdown-number {
        font-size: 2.5rem;
    }
}
