/* Container da cifra */
.cifra-container {
    font-family: 'Courier New', Courier, monospace;
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
    tab-size: 4;
    overflow-x: auto;
}

/* Conteúdo da cifra */
.cifra-content {
    white-space: pre;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile: permite scroll horizontal */
@media (max-width: 768px) {
    .cifra-container {
        padding: 15px;
        font-size: 14px;
        overflow-x: auto;
    }
    
    .cifra-content {
        white-space: pre;
        min-width: 100%;
    }
}

/* Texto introdutório (antes da cifra) */
.cifra-intro {
    font-family: Arial, sans-serif;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    line-height: 1.6;
    border-left: 4px solid #0066cc;
}

.cifra-intro p {
    margin-bottom: 15px;
}

/* Container automático (categoria cifras) */
.cifra-container.cifra-auto {
    border-left: 4px solid #0066cc;
}

.cifra-container.cifra-auto::before {
    content: "🪕 Cifra Interativa para Viola Caipira - Clique nos acordes para ver o diagrama";
    display: block;
    font-weight: bold;
    color: #0066cc;
    margin-bottom: 10px;
    font-family: Arial, sans-serif;
    font-size: 14px;
}

/* Para REMOVER o texto completamente, descomente as linhas abaixo: */
/*
.cifra-container.cifra-auto::before {
    display: none !important;
}
*/

/* OU personalize o texto editando a propriedade 'content' acima */

/* Acordes clicáveis */
.cifra-acorde {
    color: #0066cc;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    position: relative;
    padding: 2px 4px;
    margin: 0;
    border-radius: 4px;
    transition: all 0.2s ease;
    background: rgba(0, 102, 204, 0.1);
    border: 1px solid transparent;
    display: inline;
    white-space: nowrap;
}

.cifra-acorde:hover {
    background: rgba(0, 102, 204, 0.2);
    border: 1px solid #0066cc;
}

/* Acorde ATIVO (clicado) */
.cifra-acorde.active {
    background: #0066cc;
    color: white;
    border: 1px solid #0066cc;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.4);
}

/* Pop-up do diagrama */
.chord-popup {
    position: absolute;
    background: white;
    border: 3px solid #0066cc;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    min-width: 250px;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.chord-popup.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Header do pop-up */
.chord-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
}

.chord-popup-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.chord-popup-difficulty {
    font-size: 14px;
    color: #f39c12;
}

/* Diagrama do acorde */
.chord-diagram {
    margin: 10px 0;
}

.chord-diagram-grid {
    display: grid;
    grid-template-columns: repeat(5, 40px);
    grid-template-rows: repeat(6, 40px);
    gap: 0;
    border: 2px solid #333;
    background: #fff;
}

.chord-diagram-cell {
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    position: relative;
}

/* Corda pressionada */
.chord-diagram-cell.pressed {
    background: #333;
    color: white;
}

/* Corda solta */
.chord-diagram-cell.open {
    background: #4CAF50;
    color: white;
}

/* Corda abafada */
.chord-diagram-cell.muted {
    background: #f44336;
    color: white;
}

/* Casa inicial */
.chord-diagram-fret-marker {
    position: absolute;
    left: -30px;
    font-size: 12px;
    color: #666;
}

/* Informações adicionais */
.chord-popup-info {
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    font-size: 12px;
    color: #666;
}

.chord-popup-region {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.chord-popup-region.grave {
    background: #3498db;
    color: white;
}

.chord-popup-region.media {
    background: #f39c12;
    color: white;
}

.chord-popup-region.aguda {
    background: #e74c3c;
    color: white;
}

/* Loading */
.chord-popup-loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* Erro */
.chord-popup-error {
    color: #e74c3c;
    padding: 10px;
    text-align: center;
}

/* Tom da música */
.cifra-tom {
    display: inline-block;
    background: #2c3e50;
    color: white;
    padding: 5px 12px;
    border-radius: 5px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Responsivo */
@media (max-width: 768px) {
    .chord-popup {
        position: fixed !important;
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%);
        max-width: 90vw;
    }
    
    .chord-popup.show {
        transform: translate(-50%, -50%);
    }
    
    .chord-diagram-grid {
        grid-template-columns: repeat(5, 35px);
        grid-template-rows: repeat(6, 35px);
    }
}

/* Animação de entrada */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.chord-popup.show {
    animation: slideIn 0.3s ease;
}
