/**
 * CSS pour le cercle des quintes interactif - ChordMate
 * Compatible thème clair et sombre
 */

/* ========================================
   CERCLE DES QUINTES
======================================== */

#circle-container {
    width: 400px;
    height: 400px;
    max-width: 100%;
    margin: 0 auto;
}

.circle-svg {
    width: 100%;
    height: 100%;
    cursor: pointer;
}

/* Notes du cercle */
.circle-note {
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Arial', sans-serif;
    font-weight: normal;
    transform-origin: center;
}

.circle-note:hover {
    transform: scale(1.08);
}

.circle-note.selected {
    transform: scale(1.12);
}

/* Couleurs des notes - maintenant gérées dynamiquement par JS
.circle-note {
}
*/

.circle-note:hover circle {
    stroke-width: 2.5 !important;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.8)) brightness(1.1);
}

.circle-note.selected circle {
    stroke-width: 3 !important;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.9)) brightness(1.2);
}

.circle-note.selected:hover circle {
    stroke-width: 3.5 !important;
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 1)) brightness(1.3);
}

/* Texte des notes - couleur gérée dynamiquement par JS pour le contraste */
.note-text {
    font-size: 14px;
    text-anchor: middle;
    dominant-baseline: central;
    pointer-events: none;
    font-weight: normal;
}

/* ========================================
   FAMILLE D'ACCORDS
======================================== */

.chord-family-info {
    background: var(--bs-light);
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
}

[data-bs-theme="dark"] .chord-family-info {
    background: var(--bs-dark);
    border-color: var(--bs-secondary);
}

/* Caractéristiques de tonalité */
.key-characteristics {
    background: var(--bs-light) !important;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .key-characteristics {
    background: var(--bs-dark) !important;
    color: var(--bs-light);
}

.key-color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.chord-family-table {
    margin-top: 0;
}

.chord-family-table th {
    text-align: center;
    font-weight: 600;
    border-bottom: 2px solid var(--bs-border-color);
}

.chord-family-table td {
    vertical-align: middle;
    border-color: var(--bs-border-color-translucent);
}

.chord-family-table td:last-child {
    font-size: 0.8rem;
    line-height: 1.3;
    max-width: 200px;
}

.chord-name-cell {
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.chord-name-cell:hover {
    background: var(--bs-primary) !important;
    color: white !important;
    border-radius: 4px;
}

.chord-diagram-small {
    width: 60px;
    height: auto;
    transition: all 0.3s ease;
    border-radius: 4px;
    /* Le fond transparent du SVG permet au diagramme de s'intégrer aux couleurs des lignes */
}

.chord-diagram-small:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    /* Fond légèrement visible au survol pour améliorer la visibilité */
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

/* Lignes colorées selon l'importance */
.table-primary td {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.table-info td {
    background-color: rgba(13, 202, 240, 0.1) !important;
}

/* Thème sombre */
[data-bs-theme="dark"] .chord-family-table {
    --bs-table-bg: var(--bs-dark);
    --bs-table-color: var(--bs-light);
}

[data-bs-theme="dark"] .table-primary td {
    background-color: rgba(13, 110, 253, 0.2) !important;
}

[data-bs-theme="dark"] .table-info td {
    background-color: rgba(13, 202, 240, 0.2) !important;
}

/* Animation des lignes du tableau */
.chord-family-table tbody tr {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   PROGRESSIONS POPULAIRES
======================================== */

.progression-card {
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.progression-card:hover {
    background: var(--bs-light) !important;
    border-color: var(--bs-primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.progression-card h6 {
    color: var(--bs-primary);
}

/* En-tête de progression */
.progression-header {
    text-align: center;
    border-bottom: 1px solid var(--bs-border-color-translucent);
    padding-bottom: 0.75rem;
}

.progression-style {
    font-size: 0.75rem;
    color: var(--bs-success);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.progression-description {
    font-size: 0.8rem;
    color: var(--bs-text-muted);
    margin-bottom: 0;
}

/* Étapes de progression verticales */
.progression-steps {
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0;
}

.progression-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
}

.function-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--bs-primary);
    background: rgba(var(--bs-primary-rgb), 0.1);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    min-width: 2rem;
    text-align: center;
}

.chord-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--bs-body-color);
    margin: 0.1rem 0;
}

.progression-diagram {
    width: 45px;
    height: auto;
    border-radius: 4px;
    transition: all 0.2s ease;
    border: 1px solid rgba(0,0,0,0.1);
}

.progression-diagram:hover {
    transform: scale(1.15);
    z-index: 10;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Pied de progression */
.progression-footer {
    text-align: center;
    border-top: 1px solid var(--bs-border-color-translucent);
    padding-top: 0.75rem;
    margin-top: auto;
}

.progression-footer .small {
    font-weight: 500;
}

[data-bs-theme="dark"] .progression-card {
    background: var(--bs-dark);
    border-color: var(--bs-secondary) !important;
}

[data-bs-theme="dark"] .progression-header {
    border-bottom-color: var(--bs-secondary);
}

[data-bs-theme="dark"] .progression-footer {
    border-top-color: var(--bs-secondary);
}

[data-bs-theme="dark"] .function-label {
    background: rgba(var(--bs-primary-rgb), 0.2);
}

[data-bs-theme="dark"] .progression-diagram {
    border-color: var(--bs-secondary);
}

[data-bs-theme="dark"] .progression-card:hover {
    background: var(--bs-secondary) !important;
    border-color: var(--bs-primary) !important;
}

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

@media (max-width: 768px) {
    #circle-container {
        width: 300px;
        height: 300px;
    }
    
    .note-text {
        font-size: 12px;
    }
    
    .chord-family-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 0.5rem;
    }
    
    .chord-item {
        padding: 0.75rem 0.5rem;
    }
    
    .chord-name {
        font-size: 1rem;
    }
    
    .chord-function {
        font-size: 0.75rem;
    }
}

@media (max-width: 576px) {
    #circle-container {
        width: 250px;
        height: 250px;
    }
    
    .note-text {
        font-size: 10px;
    }
    
    .chord-family-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================================
   ANIMATIONS
======================================== */

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chord-item.animate {
    animation: chordPop 0.3s ease-out;
}

@keyframes chordPop {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
