@font-face {
    font-family: 'Allan';
    src: url('./Allan-Regular.ttf') format('truetype');
}

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

body {
    font-family: 'Allan', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.metronome-container {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 500px;
    width: 100%;
    transition: transform 0.3s ease;
}

.metronome-container:hover {
    transform: translateY(-5px);
}

.metronome-header h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 30px;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    letter-spacing: 2px;
}

.pendulum-container {
    position: relative;
    height: 120px;
    margin: 30px 0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.pendulum-arm {
    width: 3px;
    height: 80px;
    background: linear-gradient(to bottom, #fff, #ddd);
    border-radius: 2px;
    transform-origin: top center;
    transition: transform 0.1s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.pendulum-weight {
    position: absolute;
    bottom: 0;
    width: 20px;
    height: 20px;
    background: radial-gradient(circle, #ffd700, #ffa500);
    border-radius: 50%;
    transform: translateX(-50%);
    left: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.pendulum-arm.swing-left {
    transform: rotate(-15deg);
}

.pendulum-arm.swing-right {
    transform: rotate(15deg);
}

.bpm-display {
    margin: 30px 0;
}

.bpm-value {
    font-size: 4rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    display: block;
    transition: transform 0.1s ease;
}

.bpm-value.pulse {
    transform: scale(1.1);
}

.bpm-label {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 3px;
}

.controls {
    margin: 30px 0;
}

.bpm-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    gap: 15px;
}

.bpm-btn {
    width: 50px;
    height: 50px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bpm-btn:hover,
.preset-btn:hover,
.play-btn:hover,
.tap-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.bpm-btn:hover.pulse-with-beat,
.preset-btn:hover.pulse-with-beat,
.play-btn:hover.pulse-with-beat,
.tap-btn:hover.pulse-with-beat {
    transform: scale(1.2);
    transition: transform 0.1s ease;
}

.bpm-slider {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.bpm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.bpm-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.preset-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.preset-btn {
    padding: 8px 16px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

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

.play-btn {
    width: 80px;
    height: 80px;
    border: none;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border-radius: 50%;
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

.play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.4);
}

.play-btn .pause-icon {
    display: none;
}

.play-btn.playing .play-icon {
    display: none;
}

.play-btn.playing .pause-icon {
    display: inline;
}

.tap-btn {
    padding: 15px 25px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.tap-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.tap-btn:active {
    transform: translateY(0);
    background: rgba(255, 255, 255, 0.4);
}

.volume-control {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.volume-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.volume-slider {
    width: 150px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ffd700;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.beat-indicator {
    margin-top: 30px;
}

.beat-light {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    margin: 0 auto;
    transition: all 0.1s ease;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

.beat-light.active {
    background: #ffd700;
    box-shadow: 0 0 20px #ffd700;
    transform: scale(1.2);
}

.bar-controls {
    margin-bottom: 20px;
}

.bar-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 10px;
}

.bar-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.bar-btn {
    width: 35px;
    height: 35px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bar-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.bar-btn.active {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.beat-counter {
    margin-top: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.2rem;
}

.current-beat {
    font-weight: bold;
    color: white;
    transition: all 0.1s ease;
}

.current-beat.highlight {
    color: #ffd700;
    transform: scale(1.2);
}

.beat-separator {
    margin: 0 5px;
}

.tempo-ramp-controls {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.ramp-label {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: bold;
    display: block;
    margin-bottom: 15px;
}

.ramp-inputs {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.ramp-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.ramp-input-group label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

.ramp-input-group input {
    width: 60px;
    padding: 5px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ramp-input-group input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.3);
}

.ramp-btn {
    padding: 10px 20px;
    border: none;
    background: rgba(255, 107, 107, 0.8);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ramp-btn:hover {
    background: rgba(255, 107, 107, 1);
    transform: translateY(-2px);
}

.ramp-btn.active {
    background: rgba(255, 193, 7, 0.8);
}

.ramp-btn.active:hover {
    background: rgba(255, 193, 7, 1);
}

@media (max-width: 600px) {
    .metronome-container {
        padding: 20px;
        margin: 10px;
    }
    
    .metronome-header h1 {
        font-size: 2rem;
    }
    
    .bpm-value {
        font-size: 3rem;
    }
    
    .main-controls {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    
    .preset-buttons {
        gap: 5px;
    }
    
    .preset-btn {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
    
    .ramp-inputs {
        flex-direction: column;
        gap: 10px;
    }
    
    .ramp-input-group input {
        width: 80px;
    }
}