:root {
    --primary-color: #4a6fa5;
    --secondary-color: #166088;
    --accent-color: #4fc3f7;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --transition-speed: 0.3s;
    --correct-color: #28a745;
    --close-color: #ffc107;
    --far-color: #dc3545;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
    padding: 0;
}

.tuner-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
    flex-grow: 1;
}

.tuner-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.tuner-header {
    text-align: center;
    margin-bottom: 2rem;
}

.tuner-header h2 {
    color: var(--secondary-color);
    font-family: 'Montserrat', sans-serif;
    position: relative;
}

.tuner-header h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    margin: 0.5rem auto 0;
    border-radius: 3px;
}

.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    justify-content: center;
    margin-bottom: 2rem;
}

.nav-tabs .nav-link {
    color: var(--primary-color);
    border: none;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.nav-tabs .nav-link:hover {
    border: none;
    transform: translateY(-2px);
}

.nav-tabs .nav-link.active {
    color: var(--accent-color);
    background-color: transparent;
    border-bottom: 3px solid var(--accent-color);
    font-weight: 600;
}

.tuner-content {
    padding: 1rem;
}

.instrument-info {
    text-align: center;
    margin-bottom: 2rem;
}

.instrument-info h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.instrument-info p {
    color: #666;
}

.tuner-display {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    border-left: 4px solid var(--accent-color);
    position: relative;
}

.note-display {
    font-size: 3rem;
    font-weight: bold;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    min-height: 4rem;
}

.frequency-display {
    font-size: 1.2rem;
    color: #666;
}

.tuner-visual {
    height: 80px;
    margin: 1.5rem 0;
    position: relative;
}

.needle {
    width: 2px;
    height: 60px;
    background-color: var(--accent-color);
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    transition: transform 0.1s ease;
    z-index: 2;
}

.needle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -5px;
    width: 12px;
    height: 12px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

.scale {
    width: 100%;
    height: 2px;
    background-color: #ddd;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
}

.scale-markers {
    display: flex;
    justify-content: space-between;
    position: relative;
    height: 20px;
    margin-top: 5px;
}

.scale-marker {
    width: 1px;
    height: 10px;
    background-color: #999;
    position: relative;
}

.scale-marker.center {
    height: 15px;
    background-color: var(--primary-color);
}

.scale-marker::after {
    content: attr(data-value);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: #666;
}

.strings-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.string {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    border: none;
    outline: none;
}

.string:hover, .string:focus {
    background-color: #e9ecef;
    transform: translateX(3px);
}

.string.active {
    background-color: rgba(79, 195, 247, 0.1);
    border-left: 3px solid var(--accent-color);
}

.string-name {
    width: 80px;
    font-weight: bold;
    color: var(--primary-color);
}

.string-note {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0 1rem;
    color: var(--secondary-color);
    min-width: 40px;
    text-align: center;
}

.string-frequency {
    margin-left: auto;
    color: #666;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-tuner {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    border: none;
}

.btn-tuner:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.btn-tuner:active {
    transform: translateY(0);
}

.btn-start {
    background-color: var(--primary-color);
    color: white;
}

.btn-stop {
    background-color: #dc3545;
    color: white;
}

.accuracy-indicator {
    height: 10px;
    width: 100%;
    background: linear-gradient(90deg, var(--far-color), var(--close-color), var(--correct-color));
    border-radius: 5px;
    margin-top: 1rem;
    position: relative;
}

.accuracy-marker {
    position: absolute;
    top: -5px;
    width: 2px;
    height: 20px;
    background-color: var(--dark-color);
    transform: translateX(-50%);
    z-index: 2;
}

.tuner-status {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
}

.tuner-help {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid var(--accent-color);
}

.tuner-help h4 {
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.tuner-help ul {
    padding-left: 1.5rem;
}

.tuner-help li {
    margin-bottom: 0.5rem;
}

/* Indicador de volumen */
.volume-indicator {
    height: 5px;
    background-color: #ddd;
    border-radius: 3px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.volume-level {
    height: 100%;
    width: 0%;
    background-color: var(--accent-color);
    transition: width 0.1s ease;
}

/* Animaciones */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.correct-animation {
    animation: pulse 0.5s ease-in-out;
}

/* Microphone permission styles */
.permission-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 350px;
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .tuner-container {
        padding: 1.5rem;
        margin: 1rem auto;
    }
    .tuner-header h2 {
        font-size: 1.8rem;
    }
    .nav-tabs .nav-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    .note-display {
        font-size: 2.5rem;
    }
}

/* Estilos para el metrónomo */
.metronome-container {
    margin-bottom: 3rem;
}

.metronome-card {
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-top: 4px solid var(--accent-color);
}

.metronome-display {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    position: relative;
    height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.beat-indicator {
    width: 60px;
    height: 60px;
    background-color: var(--accent-color);
    border-radius: 50%;
    margin: 0 auto 1rem;
    transition: transform 0.1s ease, background-color 0.1s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
}

.beat-indicator.active {
    transform: scale(1.2);
    background-color: var(--primary-color);
}

.beat-indicator.accent {
    background-color: var(--far-color);
    transform: scale(1.3);
}

.bpm-display {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.bpm-display span {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.metronome-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.btn-metronome {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--light-color);
    border: 1px solid #ddd;
    color: var(--primary-color);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.btn-metronome:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

#bpm-slider {
    flex-grow: 1;
    max-width: 400px;
    height: 8px;
    -webkit-appearance: none;
    background: #ddd;
    border-radius: 4px;
    outline: none;
}

#bpm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
}

#bpm-slider::-webkit-slider-thumb:hover {
    background: var(--secondary-color);
    transform: scale(1.2);
}

.time-signature {
    text-align: center;
    margin-bottom: 1.5rem;
}

.btn-signature {
    background-color: #f8f9fa;
    color: var(--primary-color);
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease;
}

.btn-signature.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-signature:hover:not(.active) {
    background-color: #e9ecef;
}

.metronome-main-control {
    text-align: center;
    margin-bottom: 1.5rem;
}

.metronome-main-control .btn {
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.sound-options {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Animación de pulso para el metrónomo */
@keyframes metronomePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.metronome-pulse {
    animation: metronomePulse 0.1s ease-out;
}