* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --dark: #1f2937;
    --light: #f3f4f6;
    --border: #e5e7eb;
    --text: #374151;
    --text-light: #6b7280;
    --shadow: rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    background: white;
    padding: 40px;
    border-radius: var(--radius);
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px var(--shadow);
}

.header h1 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    color: var(--text-light);
    font-size: 1.1rem;
}

.card {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 6px var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 15px var(--shadow);
}

.card h2 {
    font-size: 1.75rem;
    color: var(--dark);
    margin-bottom: 20px;
    font-weight: 600;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark);
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.radio-group {
    display: flex;
    gap: 20px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 20px;
    border: 2px solid var(--border);
    border-radius: 8px;
    transition: all 0.3s;
}

.radio-label:hover {
    border-color: var(--primary);
    background: var(--light);
}

.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.btn {
    padding: 14px 32px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background: var(--primary);
    color: white;
    width: 100%;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.info-item {
    background: var(--light);
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.info-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

.info-value {
    display: block;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
}

.notes-container {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.note-box {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    min-width: 80px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s;
}

.note-box:hover {
    transform: scale(1.1);
}

.note-degree {
    font-size: 0.875rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.note-name {
    font-size: 1.5rem;
    font-weight: 700;
}

.scale-formula {
    background: var(--light);
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    text-align: center;
}

.formula-legend {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 5px;
}

.chords-table-wrapper {
    overflow-x: auto;
}

.chords-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.chords-table th {
    background: var(--primary);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.chords-table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

.chord-row:hover {
    background: var(--light);
}

.chord-name {
    font-weight: 600;
    color: var(--primary);
    font-size: 1.1rem;
}

.roman {
    font-family: Georgia, serif;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary);
}

.chord-notes {
    font-family: 'Courier New', monospace;
    color: var(--text-light);
}

.function {
    font-style: italic;
    color: var(--text-light);
}

.explanation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.explanation-card {
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.explanation-card h3 {
    color: var(--primary);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.progressions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.progression-card {
    background: var(--light);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--border);
    transition: all 0.3s;
}

.progression-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--shadow);
}

.progression-card h3 {
    color: var(--dark);
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.progression-degrees {
    background: white;
    padding: 10px;
    border-radius: 6px;
    font-family: Georgia, serif;
    font-weight: 600;
    color: var(--primary);
    text-align: center;
    margin: 10px 0;
    font-size: 1.1rem;
}

.section-intro {
    color: var(--text-light);
    margin-bottom: 15px;
}

.alert {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--danger);
}

.footer {
    background: white;
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    margin-top: 30px;
    color: var(--text-light);
    box-shadow: 0 4px 6px var(--shadow);
}

/* ============================================ */
/* ESTILOS DO BRAÇO DO VIOLÃO */
/* ============================================ */

.fretboard-section {
    background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
    color: white;
    padding: 40px;
}

.fretboard-section h2 {
    color: white;
    border-bottom-color: #3b82f6;
}

.fretboard-section .section-intro {
    color: #d1d5db;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.fretboard-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn-control {
    background: #3b82f6;
    color: white;
    border: 2px solid transparent;
}

.btn-control:hover {
    background: #2563eb;
    transform: translateY(-2px);
}

.btn-control.active {
    background: #10b981;
    border-color: #059669;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.fretboard-container {
    background: #8b4513;
    padding: 30px;
    border-radius: 12px;
    overflow-x: auto;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.3);
}

.fretboard-wrapper {
    display: flex;
    min-width: 1200px;
}

.string-names {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    margin-right: 15px;
    padding: 40px 0;
}

.string-name {
    font-weight: bold;
    color: #fbbf24;
    font-size: 1.1rem;
    text-align: right;
    padding-right: 10px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.fretboard {
    flex: 1;
    background: linear-gradient(to right, #654321 0%, #8b6914 100%);
    border-radius: 8px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.guitar-string {
    display: flex;
    height: 50px;
    border-bottom: 3px solid #2d1810;
    position: relative;
    background: linear-gradient(to bottom, rgba(255,255,255,0.05) 0%, rgba(0,0,0,0.1) 100%);
}

.guitar-string:last-child {
    border-bottom: none;
}

.fret {
    flex: 1;
    border-right: 3px solid #1a0f08;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
}

.fret:first-child {
    background: rgba(0, 0, 0, 0.2);
    border-left: 4px solid #1a0f08;
}

.fret.open-string {
    background: rgba(255, 215, 0, 0.1);
}

.fret:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: scale(1.05);
}

.note-label {
    display: none;
    font-size: 0.875rem;
    font-weight: bold;
    padding: 6px 10px;
    border-radius: 50%;
    background: rgba(107, 114, 128, 0.7);
    color: white;
    min-width: 40px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

.fret.in-scale .note-label {
    display: inline-block;
    background: #3b82f6;
    color: white;
}

.fret.tonic .note-label {
    display: inline-block;
    background: #dc2626;
    color: white;
    font-size: 1rem;
    font-weight: 900;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 4px 15px rgba(220, 38, 38, 0.6);
    }
}

.fret-number {
    position: absolute;
    font-size: 0.65rem;
    color: rgba(255, 255, 255, 0.4);
    bottom: 2px;
    text-align: center;
    line-height: 1.1;
}

.fret-numbers {
    display: flex;
    margin-top: 10px;
    padding-left: 80px;
}

.fret-num {
    flex: 1;
    text-align: center;
    font-size: 0.875rem;
    font-weight: bold;
    color: #fbbf24;
    min-width: 70px;
}

.fret-markers {
    display: flex;
    margin-top: 15px;
    padding-left: 80px;
    height: 30px;
}

.marker-position {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    gap: 3px;
    min-width: 70px;
}

.marker {
    width: 12px;
    height: 12px;
    color: #fbbf24;
    font-size: 1.5rem;
    opacity: 0.7;
}

.marker.double {
    font-size: 1.2rem;
}

.fretboard-legend {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin-top: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.legend-color {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.tonic-color {
    background: #dc2626;
}

.scale-color {
    background: #3b82f6;
}

.other-color {
    background: rgba(107, 114, 128, 0.7);
}

.study-tips {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    border-left: 4px solid #fbbf24;
}

.study-tips h3 {
    color: #fbbf24;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.study-tips ul {
    list-style: none;
    padding: 0;
}

.study-tips li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    line-height: 1.6;
}

.study-tips li:last-child {
    border-bottom: none;
}

.study-tips strong {
    color: #fbbf24;
}

/* ============================================ */
/* RESPONSIVO */
/* ============================================ */

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.75rem;
    }
    
    .card {
        padding: 20px;
    }
    
    .notes-container {
        justify-content: center;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    .fretboard-container {
        padding: 15px;
    }
    
    .fretboard-wrapper {
        min-width: 900px;
    }
    
    .fret {
        min-width: 50px;
    }
    
    .fretboard-legend {
        flex-direction: column;
        gap: 15px;
    }
    
    .fretboard-section {
        padding: 20px;
    }
}