/* ===========================================
   STYLES SPECIFIQUES TUTOCHORDS
   Ce fichier surcharge style2.css uniquement pour TutoChords
   =========================================== */

/* --- DESKTOP : wrapper en flex column --- */
#chord-display-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    padding-top: 10px;
}

/* Zone d'affichage de l'accord - DESKTOP SANS PARTITION */
#chord-display-wrapper #chord {
    position: static;
    margin: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    flex: 0 0 auto;
    font-size: 6rem;
    font-weight: bold;
    text-align: center;
    padding: 10px 0;
}

/* Partition - DESKTOP (cachée par défaut) */
#chord-display-wrapper #sheet-container {
    position: static;
    margin: 0;
    top: 0;
    display: none;
    justify-content: center;
    align-items: flex-start;
    flex: 0 0 auto;
    max-height: 180px;
    overflow: hidden;
    padding-top: 0;
}

/* Partition visible - DESKTOP */
#chord-display-wrapper #sheet-container.visible {
    display: flex;
}

/* DESKTOP AVEC PARTITION : accord plus petit */
#chord-display-wrapper:has(#sheet-container.visible) #chord {
    flex: 0 0 auto;
    font-size: 3.5rem;
    padding: 5px 0 0 0;
}

/* SVG de la partition - couper le blanc du haut */
#chord-display-wrapper #sheet {
    margin-top: -30px;
}

/* Desktop large: partition légèrement plus grande */
@media (min-width: 1024px) {
    #chord-display-wrapper #sheet-container {
        max-height: 200px;
    }
}

/* --- MOBILE LANDSCAPE : accord et partition côte à côte --- */
@media screen and (max-height: 500px) and (orientation: landscape) {

    /* Masquer éléments non essentiels */
    #chord-display-wrapper ~ .erreurs,
    .erreurs {
        display: none;
    }

    /* Barre de progression fine */
    #progressContainer2 {
        flex: 0 0 4px;
        margin: 0 auto;
    }

    /* Wrapper en flex row - centré et remonté */
    #chord-display-wrapper {
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 20px;
        padding: 0;
        margin-top: -60px;
        flex: 1 1 auto;
    }

    /* Accord - MOBILE - aligné au centre de la partition */
    #chord-display-wrapper #chord {
        flex: 0 0 auto;
        font-size: 4rem;
        min-width: 80px;
        padding: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    /* Accord - MOBILE AVEC PARTITION */
    #chord-display-wrapper:has(#sheet-container.visible) #chord {
        font-size: 3rem;
        padding: 0;
    }

    /* Partition - MOBILE */
    #chord-display-wrapper #sheet-container {
        max-height: none;
        overflow: visible;
        display: none;
    }

    /* Partition visible - MOBILE */
    #chord-display-wrapper #sheet-container.visible {
        display: flex;
        align-items: center;
    }

    /* Partition scale - MOBILE */
    #chord-display-wrapper #sheet {
        transform: scale(0.85);
        transform-origin: center center;
        margin-top: 0;
    }

    /* Footer masqué en mobile */
    .flex-container2 {
        display: none;
    }
}

/* ===========================================
   INDICATEUR DE RENVERSEMENT (Phase 3.1)
   =========================================== */

.inversion-indicator {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    padding: 4px 12px;
    border-radius: 20px;
    margin: 8px 0;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
    animation: fadeInScale 0.3s ease-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ===========================================
   LÉGENDE DES COULEURS (degrés de l'accord)
   =========================================== */

.color-legend {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 6px 0;
}

.color-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
}

/* ===========================================
   LIGNE D'INFO (intervalles, légende, notes)
   =========================================== */

.chord-info-line {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.chord-intervals {
    font-size: 1rem;
    color: #666;
}

.chord-notes {
    font-size: 0.9rem;
    color: #888;
}

/* Mobile landscape - tout sur une ligne */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .inversion-indicator {
        font-size: 0.7rem;
        padding: 2px 8px;
        margin: 2px 0;
    }

    .chord-info-line {
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        margin-top: 2px;
    }

    .chord-intervals {
        font-size: 0.75rem;
    }

    .chord-notes {
        font-size: 0.75rem;
    }

    .color-legend {
        gap: 3px;
        margin: 0;
    }

    .color-dot {
        width: 12px;
        height: 12px;
        font-size: 0.5rem;
    }
}

/* ===========================================
   MODE GUIDÉ - Indicateur et contrôles verrouillés
   =========================================== */

/* Indicateur de mode guidé dans le header */
.guided-mode-indicator {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 4px 12px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-radius: 8px;
    margin-left: 12px;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.guided-mode-indicator .guided-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.guided-mode-indicator .guided-context {
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
}

/* Contrôles verrouillés */
body.guided-mode .setting-row input.locked,
body.guided-mode .setting-row select.locked {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f0f0f0;
    border-color: #ccc;
}

body.guided-mode .setting-row input.locked:disabled,
body.guided-mode .setting-row select.locked:disabled {
    pointer-events: none;
}

/* Icône de verrouillage sur les contrôles */
body.guided-mode .setting-row:has(.locked)::after {
    content: "🔒";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    opacity: 0.6;
}

body.guided-mode .setting-row {
    position: relative;
}

/* ===========================================
   NOTIFICATION DE DÉBLOCAGE (style TutoNotes)
   =========================================== */

.unlock-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;
}

.unlock-notification.visible {
    opacity: 1;
}

.unlock-notification .unlock-content {
    text-align: center;
    color: white;
    animation: unlockPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.unlock-notification .unlock-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: unlockBounce 0.6s ease-in-out infinite alternate;
}

@keyframes unlockBounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.unlock-notification .unlock-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.unlock-notification .unlock-subtitle {
    font-size: 18px;
    opacity: 0.8;
}

.unlock-notification .unlock-rules {
    margin-top: 16px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 14px;
    opacity: 0.9;
}

/* Mobile landscape */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .guided-mode-indicator {
        padding: 2px 8px;
        margin-left: 8px;
    }

    .guided-mode-indicator .guided-label {
        font-size: 0.55rem;
    }

    .guided-mode-indicator .guided-context {
        font-size: 0.7rem;
    }

    .unlock-notification .unlock-icon {
        font-size: 48px;
    }

    .unlock-notification .unlock-title {
        font-size: 22px;
    }

    .unlock-notification .unlock-subtitle {
        font-size: 14px;
    }
}
