/* Tuner Styles */

.tuner {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Tuner Display */
.tuner-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 16px;
    padding: 40px 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.3);
    text-align: center;
}

/* Frequency Display */
.frequency-display {
    margin-bottom: 30px;
}

.detected-note {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 15px;
}

.note-name {
    font-size: 72px;
    font-weight: 300;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    min-width: 80px;
    display: inline-block;
}

.octave {
    font-size: 36px;
    font-weight: 400;
    opacity: 0.8;
    margin-left: -8px;
}

.frequency-value {
    font-size: 24px;
    font-weight: 300;
    opacity: 0.9;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
}

/* Tuning Meter */
.tuning-meter {
    position: relative;
    height: 80px;
    margin: 30px 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 40px;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.meter-background {
    display: flex;
    height: 100%;
    border-radius: 40px;
    overflow: hidden;
}

.meter-zone {
    flex: 1;
    transition: all 0.3s ease;
}

.meter-zone.flat {
    background: linear-gradient(90deg, #ff6b6b, #ff8e8e);
}

.meter-zone.in-tune {
    background: linear-gradient(90deg, #51cf66, #69db7c);
    flex: 0.6;
}

.meter-zone.sharp {
    background: linear-gradient(90deg, #ff8e8e, #ff6b6b);
}

.meter-scale {
    position: absolute;
    top: -25px;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 2;
}

.scale-mark {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.8;
    position: relative;
}

.scale-mark.center {
    font-weight: 700;
    font-size: 14px;
    opacity: 1;
}

.scale-mark::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 10px;
    background: rgba(255, 255, 255, 0.6);
}

.scale-mark.center::after {
    height: 15px;
    width: 3px;
    background: white;
}

.meter-needle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 60px;
    background: white;
    border-radius: 2px;
    transition: transform 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 3;
}

/* Tuning Status */
.tuning-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.status-text {
    font-size: 18px;
    font-weight: 500;
}

.status-text.flat {
    color: #ff6b6b;
}

.status-text.in-tune {
    color: #51cf66;
    font-weight: 600;
}

.status-text.sharp {
    color: #ff6b6b;
}

.cents-display {
    font-size: 16px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    opacity: 0.9;
}

/* Controls Section */
.controls-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
}

.main-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.start-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.start-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}

.start-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
    transform: translateY(-1px);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.mic-icon,
.stop-icon {
    font-size: 18px;
}

/* Tuning Options */
.tuning-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.option-group input,
.option-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.option-group input:focus,
.option-group select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Note Reference */
.note-reference {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    margin-bottom: 30px;
}

.note-reference h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 18px;
    text-align: center;
}

.notes-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.note-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 12px 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.note-card:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.note-card.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.note-card .note {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.note-card .freq {
    font-size: 11px;
    opacity: 0.8;
    font-family: monospace;
}

/* Octave Selector */
.octave-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.octave-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.octave-btn:hover {
    background: #f8f9fa;
    border-color: #007bff;
}

.octave-btn.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

/* Status Indicators */
.status-indicators {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.status-indicator.listening {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-indicator.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-indicator.inactive {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #e9ecef;
}

.indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Info Section */
.info-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    border: 1px solid #e9ecef;
}

.info-section h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 18px;
}

.info-section p {
    margin: 0 0 10px 0;
    color: #666;
    line-height: 1.6;
}

.info-section ul {
    margin: 10px 0;
    padding-left: 20px;
    color: #666;
}

.info-section li {
    margin-bottom: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tuner {
        padding: 15px;
    }
    
    .tuner-display {
        padding: 30px 20px;
    }
    
    .note-name {
        font-size: 56px;
    }
    
    .octave {
        font-size: 28px;
    }
    
    .frequency-value {
        font-size: 20px;
    }
    
    .tuning-meter {
        height: 60px;
        margin: 20px 0;
    }
    
    .meter-needle {
        height: 45px;
    }
    
    .main-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .start-btn,
    .btn-secondary {
        width: 100%;
        max-width: 200px;
    }
    
    .tuning-options {
        grid-template-columns: 1fr;
    }
    
    .notes-grid {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .tuning-status {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .note-name {
        font-size: 48px;
    }
    
    .octave {
        font-size: 24px;
    }
    
    .frequency-value {
        font-size: 18px;
    }
    
    .tuning-meter {
        height: 50px;
    }
    
    .meter-needle {
        height: 35px;
        width: 3px;
    }
    
    .notes-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .status-indicators {
        flex-direction: column;
        align-items: center;
    }
    
    .controls-section,
    .note-reference,
    .info-section {
        padding: 20px;
    }
}