/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Main Container */
.metronome-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

/* BPM Display */
.bpm-display {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.bpm-value {
    font-size: 4rem;
    font-weight: bold;
    line-height: 1;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.bpm-value:hover {
    transform: scale(1.05);
}

.bpm-label {
    font-size: 1.2rem;
    opacity: 0.8;
    letter-spacing: 2px;
}

/* BPM Controls */
.bpm-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 400px;
}

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

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

.bpm-btn:active {
    transform: scale(0.95);
}

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

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

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

/* Time Signature */
.time-signature {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.time-select {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    cursor: pointer;
}

.time-select option {
    background: #667eea;
    color: #fff;
}

/* Beat Indicator */
.beat-indicator {
    margin: 20px 0;
}

.beat-dots {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.dot.active {
    background: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.8);
    transform: scale(1.3);
}

.dot.accent {
    background: #ff6b6b;
    box-shadow: 0 0 20px rgba(255, 107, 107, 0.8);
}

/* Controls */
.controls {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.control-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.start-stop {
    background: rgba(46, 204, 113, 0.8);
    color: #fff;
    min-width: 120px;
}

.start-stop:hover {
    background: rgba(46, 204, 113, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.start-stop.stop {
    background: rgba(231, 76, 60, 0.8);
}

.start-stop.stop:hover {
    background: rgba(231, 76, 60, 1);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

.control-btn:active {
    transform: translateY(0);
}

/* Volume Control */
.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 15px 25px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 300px;
}

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

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Settings */
.settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 300px;
}

.setting-item {
    display: flex;
    align-items: center;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.95rem;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #46d894;
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
    min-width: 300px;
    backdrop-filter: blur(10px);
}

.modal-content h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 300;
}

.modal-content input {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 1.2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    margin-bottom: 20px;
    outline: none;
}

.modal-content input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.modal-btn {
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.modal-btn.cancel {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.modal-btn.cancel:hover {
    background: rgba(255, 255, 255, 0.3);
}

.modal-btn.confirm {
    background: rgba(46, 204, 113, 0.8);
    color: #fff;
}

.modal-btn.confirm:hover {
    background: rgba(46, 204, 113, 1);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 204, 113, 0.4);
}

.modal-btn:active {
    transform: translateY(0);
}

/* Footer */
footer {
    text-align: center;
    margin-top: auto;
    padding-top: 30px;
    opacity: 0.7;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 480px) {
    .app {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .bpm-value {
        font-size: 3rem;
    }
    
    .controls {
        flex-direction: column;
        width: 100%;
    }
    
    .control-btn {
        width: 100%;
    }
    
    .bpm-controls {
        max-width: 100%;
    }
}

/* Animation for beat pulse */
@keyframes beatPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.beat-pulse {
    animation: beatPulse 0.1s ease-out;
}

/* Visual feedback for active state */
.app.playing {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.app.playing .bpm-display {
    border: 2px solid rgba(255, 255, 255, 0.3);
}