/* General Setup */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    background-color: #f7f7f7;
    color: #333;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.metronome-container {
    background-color: #ffffff;
    padding: 30px 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 400px;
}

/* Tool Switching Buttons */
.tool-switcher {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    background: #e9e9e9;
    border-radius: 10px;
    padding: 5px;
}

.tool-switcher button {
    padding: 10px 20px;
    margin: 0;
    border: none;
    border-radius: 8px;
    background-color: transparent;
    color: #555;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
    flex-grow: 1;
}

.tool-switcher button.active {
    background-color: #007bff; /* Primary Blue */
    color: white;
    box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3);
}

h1 {
    color: #007bff; 
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 700;
}

/* Metronome Styles */
.bpm-display {
    font-size: 4.5em;
    font-weight: 800;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.unit {
    font-size: 0.25em;
    vertical-align: top;
    opacity: 0.6;
}

#bpmSlider {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 25px;
}

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

.controls button {
    background-color: #f0f0f0;
    color: #333;
    border: none;
    width: 55px;
    height: 55px;
    margin: 0 15px;
    border-radius: 50%;
    font-size: 2em;
    cursor: pointer;
    transition: background-color 0.2s;
    line-height: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.controls button:hover {
    background-color: #dcdcdc;
}

#startStopBtn {
    width: 100%;
    padding: 18px;
    border: none;
    border-radius: 8px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    letter-spacing: 1px;
}

#startStopBtn.start {
    background-color: #28a745; /* Green */
    color: white;
}

#startStopBtn.stop {
    background-color: #dc3545; /* Red */
    color: white;
}

.beat-light {
    width: 25px;
    height: 25px;
    background-color: #ccc;
    border-radius: 50%;
    margin: 30px auto 0;
    transition: background-color 0.1s, transform 0.1s;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
}

.beat-light.active {
    background-color: #007bff; /* Blue flash */
    box-shadow: 0 0 15px #007bff;
    transform: scale(1.1);
}

/* Tuner Specific Styles */
.tool-section {
    width: 100%;
}

.hidden {
    display: none !important; /* IMPORTANT for hiding */
}

.tuner-note-info {
    font-style: italic;
    color: #6c757d;
    margin-bottom: 30px;
}

.tuner-display {
    font-size: 8em;
    font-weight: 800;
    color: #007bff;
    min-height: 1.2em;
    line-height: 1;
}

#noteName {
    display: inline-block;
    min-width: 120px; 
}

.detune-indicator-container {
    width: 90%;
    height: 25px;
    background-color: #e9ecef;
    border-radius: 12px;
    margin: 25px auto 10px;
    position: relative;
    border: 1px solid #ced4da;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detune-bar {
    width: 8px;
    height: 100%;
    background-color: #333;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    transition: left 0.1s;
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.detune-indicator-container::before, 
.detune-indicator-container::after {
    content: '♭'; /* Flat symbol */
    position: absolute;
    font-size: 1.5em;
    color: #dc3545;
    left: 5%;
}

.detune-indicator-container::after {
    content: '♯'; /* Sharp symbol */
    right: 5%;
    left: auto;
    color: #ffc107;
}

/* Mark the exact center */
.detune-indicator-container::before {
    content: '';
    position: absolute;
    width: 2px;
    height: 100%;
    background: #28a745; /* Green for perfect tune */
    left: 50%;
    transform: translateX(-50%);
    z-index: 1;
}

#tunerStatus {
    font-size: 0.9em;
    color: #6c757d;
    margin-top: 15px;
}
