:root {
    --primary-color: #4a9dff;
    --secondary-color: #5eacff;
    --accent-color: #ff9d00;
    --background-color: #000000;
    --text-color: #ffffff;
    --light-gray: #444;
    --dark-gray: #aaa;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

@font-face {
    font-family: 'Metropolis-Regular';
    src: url('/Assets/fonts/Metropolis-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Metropolis-Black';
    src: url('/Assets/fonts/Metropolis-Black.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

body {
    font-family: 'Metropolis-Regular', sans-serif;
    /* display: flex; */
    /* justify-content: center; */
    /* align-items: center; */
    min-height: 100vh;
    background-color: var(--background-color);
    color: var(--text-color);
}

.tuner-container {
    width: 17cm;
    height: 17.5cm;
    background-color: #000000;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    padding: 1cm;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    margin-left: auto;
    margin-right: auto;
}

.title {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 0.2cm;
    color: var(--text-color);
}

.accuracy-meter {
    width: 100%;
    margin-bottom: 0.5cm;
    margin-top: 1.5cm;
}

.meter-scale {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5cm;
    color: var(--text-color);
    position: relative;
}

.flat-indicator,
.sharp-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #333;
    position: absolute;
    top: -12mm;
    transition: background-color 0.3s ease;
}

.flat-indicator {
    left: 7%;
}

.sharp-indicator {
    right: 7%;
}

.flat-indicator.red,
.sharp-indicator.red {
    background-color: #ff0000;
    box-shadow: 0 0 5px #ff0000;
}

.flat-indicator.green,
.sharp-indicator.green {
    background-color: #00ff00;
    box-shadow: 0 0 5px #00ff00;
}

.meter-scale::before {
    content: "♭";
    position: absolute;
    left: 10%;
    top: -12.5mm;
    font-size: 1.2rem;
    color: var(--text-color);
}

.meter-scale::after {
    content: "♯";
    position: absolute;
    right: 10%;
    top: -12.5mm;
    font-size: 1.2rem;
    color: var(--text-color);
}

.meter-scale .left-label {
    position: absolute;
    left: 10%;
    bottom: -12.5mm;
    font-size: 0.9rem;
    color: var(--text-color);
    content: "-50";
}

.meter-scale .right-label {
    position: absolute;
    right: 10%;
    bottom: -12.5mm;
    font-size: 0.9rem;
    color: var(--text-color);
    content: "+50";
}

.meter-scale .left-cents {
    position: absolute;
    left: 10%;
    bottom: -18mm;
    font-size: 0.8rem;
    color: var(--text-color);
}

.meter-scale .right-cents {
    position: absolute;
    right: 10%;
    bottom: -18mm;
    font-size: 0.8rem;
    color: var(--text-color);
}

.meter-bar {
    height: 0.50cm;
    width: 80%;
    background-color: transparent;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    border-right: 1px solid rgba(255, 255, 255, 0.5);
}

.meter-lines {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: repeating-linear-gradient(
        to right,
        transparent,
        transparent calc(1.5mm - 1px),
        rgba(255, 255, 255, 0.5) 1.5mm,
        rgba(255, 255, 255, 0.5) calc(1.5mm + 1px)
    );
    z-index: 1;
}

#meter-needle {
    position: absolute;
    height: 1.5cm;
    width: 8px;
    background-color: #ECD887;
    top: -0.5cm;
    left: 50%;
    transform: translateX(-50%);
    transition: left 0.2s ease-out;
    z-index: 2;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(32, 103, 33, 0.7);
    border: 1px solid #206721;
}

.note-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 0.5cm;
}

.detected-note {
    font-size: 3rem;
    font-weight: bold;
    color: var(--text-color);
}

.detected-frequency {
    font-size: 1.2rem;
    color: var(--dark-gray);
}

.staff-container {
    width: 10cm;
    height: 7cm;
    margin-bottom: 0.5cm;
    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    border-radius: 5px;
    overflow: hidden;
    background-color: #000000;
    position: relative;
    padding: 0.2cm;
}

#staff {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(1.2);
}

.controls {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5cm;
}

.tuning-control,
.display-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.3cm;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #222;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #ECD887;
}

input:checked + .slider:before {
    transform: translateX(36px);
}

.slider.round {
    border-radius: 30px;
}

.slider.round:before {
    border-radius: 50%;
}

.switch-label {
    font-size: 0.9rem;
    color: var(--dark-gray);
}

label {
    font-size: 0.9rem;
    color: var(--dark-gray);
}

select {
    padding: 5px 10px;
    border: 1px solid var(--light-gray);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: #222;
    color: var(--text-color);
}

.start-btn {
    padding: 0;
    width: 3cm;
    height: 1cm;
    background-color: white;
    color: #5F1A57;
    border: 2px solid #5F1A57;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Metropolis', sans-serif;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.start-btn:hover {
    background-color: #f0f0f0;
}

.start-btn.active {
    background-color: #5F1A57;
    color: white;
    box-shadow: 0 0 8px rgba(95, 26, 87, 0.6);
}

.permission-message {
    width: 100%;
    background-color: #222;
    border-left: 4px solid var(--accent-color);
    padding: 0.5cm;
    border-radius: 4px;
    text-align: center;
    color: var(--text-color);
}

#grant-permission {
    padding: 5px 10px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    margin-top: 10px;
    cursor: pointer;
    font-family: 'Metropolis', sans-serif;
}

.hidden {
    display: none;
}