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

body {
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    background: #000;
    color: #00ffff;
    min-height: 100vh;
    background-image: linear-gradient(to bottom, #000000, #001119, #001829, #001d32, #092137);
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 50, 80, 0.15),
        rgba(0, 50, 80, 0.15) 2px,
        transparent 2px,
        transparent 4px
    );
    pointer-events: none;
    z-index: 1;
}

.container {
    display: flex;
    min-height: 100vh;
}

header {
    overflow: hidden;  /* This will hide the scrollbar */
}

.sidebar {
    width: 250px; /* Đặt width cho sidebar */
    height: 630px; /* Đảm bảo thanh sidebar chiếm hết chiều cao */
    position: fixed; /* Sidebar cố định trên màn hình */
    border: 1px solid #4d4b4b; /* Đường kẻ viền dưới của thanh header */
    left: 2; /* Sidebar sẽ nằm ở bên phải */
    box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1); /* Thêm bóng cho thanh sidebar */
    padding: 10px;
    
    z-index: 10;
    border-radius: 30px;
}

.main-content {
    flex: 1;
    margin-left: 250px;
    padding: 2rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    z-index: 2;
}

.metronome-container {
    background: rgba(0, 20, 40, 0.5);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2);
    width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    position: relative;
    border: 1px solid rgba(0, 255, 255, 0.3);
    backdrop-filter: blur(5px);
    transition: box-shadow 0.15s ease;
}

.metronome-container:hover {
    box-shadow: 0 0 40px rgba(0, 255, 255, 0.4);
}

.tempo-display {
    font-size: 7rem;
    font-weight: 500;
    color: #00ffff;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 160px;
    position: relative;
    text-shadow: 0 0 10px #00ffff, 0 0 20px #00ffff;
}

/* Make the BPM text a fixed size and position */
.tempo-display span {
    font-size: 2rem;
    color: #00ffff;
    position: absolute;
    right: 40px;
    bottom: 35px;
    width: 60px;
    text-align: left;
    text-shadow: 0 0 5px #00ffff;
}

.tempo-controls {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 30, 60, 0.5);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.tempo-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 255, 255, 0.2);
    color: #00ffff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    transition: all 0.2s ease;
}

.tempo-slider {
    flex: 1;
    height: 4px;
    background: rgba(0, 255, 255, 0.2);
    appearance: none;
    border-radius: 2px;
}

.tempo-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

.beats-container {
    display: flex;
    gap: 1rem;
}

.beat {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(0, 255, 255, 0.3);
    color: #00ffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: rgba(0, 30, 60, 0.5);
    text-shadow: 0 0 5px #00ffff;
}

.beat:hover {
    background-color: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.beat.active {
    background: rgba(0, 255, 255, 0.3);
    color: #ffffff;
    border-color: #00ffff;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.beat.current {
    background-color: rgba(0, 255, 170, 0.4);
    color: #ffffff;
    border-color: #00ffaa;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 170, 0.6);
}

.beat.active.current {
    background: rgba(0, 255, 170, 0.5);
    border-color: #00ffaa;
    color: #ffffff;
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.7);
}

.time-signature {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(0, 30, 60, 0.5);
    padding: 1rem;
    border-radius: 8px;
    width: 100%;
    border: 1px solid rgba(0, 255, 255, 0.3);
}

.time-signature select {
    padding: 0.5rem;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 4px;
    font-size: 1rem;
    background: rgba(0, 20, 40, 0.8);
    color: #00ffff;
    font-family: 'Rajdhani', sans-serif;
}

.time-signature label {
    color: #00ffff;
    text-shadow: 0 0 5px #00ffff;
    letter-spacing: 1px;
}

.controls {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.btn {
    flex: 1;
    padding: 1rem;
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(0, 255, 255, 0.1);
    color: #00ffff;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.2);
    transition: all 0.2s ease;
    font-family: 'Rajdhani', sans-serif;
    font-weight: bold;
    letter-spacing: 1px;
}

.btn:hover, .tempo-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
}

@media (max-width: 768px) {
    .main-content { 
        margin-left: 60px;
    }

    .metronome-container {
        width: 100%;
        max-width: 400px;
    }

    .tempo-display {
        font-size: 5rem;
        min-height: 120px;
    }

    .tempo-display span {
        font-size: 1.5rem;
        right: 30px;
        bottom: 25px;
        width: 50px;
    }

    .fireball {
        bottom: 15px; /* Adjusted to center on the 3rd staff line for mobile (25px - 20px/2) */
        left: 30px;
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 1200px) {
    .tempo-controls {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;  /* Better spacing on mobile */
        gap: 0.5rem;
        background: rgba(0, 30, 60, 0.5); /* Maintains the cyber tech theme instead of white */
        padding: 1rem;
        border-radius: 8px;
        border: 1px solid rgba(0, 255, 255, 0.3); /* Added border for consistency */
    }

    .tempo-btn {
        width: 48px;  /* Keep same size on mobile */
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }
    .sidebar {
        display: none;  /* Hide sidebar on mobile */
    }
 /* Sidebar */
    .sidebar {
        display: none;
        position: fixed;
       
        left: 0;
        width: 70%;
        height: 100%;
        background-color: #fff;
        box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
        z-index: 9999;
        overflow-y: auto;
        padding-top: 60px;
        transition: transform 0.3s ease;
        transform: translateX(-100%);
    }

    .sidebar ul {
        list-style: none;
        padding: 0;
        text-align: center;
    }

    .sidebar ul li {
        margin: 10px 0;
    }

    .sidebar ul li a {
        text-decoration: none;
        font-size: 18px;
        color: #333;
        display: block;
        padding: 10px 0;
    }

    .sidebar .list {
        color: #000000;
        border: none;
        margin-top: 10px;
        width: 150px;
        cursor: pointer;
        border-radius: 20px;
        margin-bottom: 5px;
        font-family: 'Montserrat', sans-serif;
        border: 0.5px solid #877f7f;
        height: 50px;
    }

    .sidebar .list a {
        display: block;
        text-align: center;
        line-height: 30px;
        border-radius: 30px;
        transition: all 0.3s ease;
        width: 150px;
        height: 50px;
        text-decoration: none;
        color: #000;
        margin-top: -10px;
    }
    @media (max-width: 1200px) {
        .main-content {
            margin-left: 0;
            padding: 1rem;
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: flex-start;  /* Changed from center to flex-start */
            padding-top: 80px;  /* Adjust this value to move container up/down */
        }
    
        .metronome-container {
            width: 90%;
            max-width: 400px;
            margin: 0 auto;
            padding: 1.5rem;
            margin-top: -20px;  /* Added negative margin to move up */
        }
    }

    .beats-container {
        gap: 0.75rem;  /* Slightly reduce gap for mobile */
    }

    .beat {
        width: 40px;  /* Slightly smaller beats for mobile */
        height: 40px;
        font-size: 1rem;
    }

    .controls {
        flex-direction: column;  /* Stack buttons on mobile */
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        padding: 0.875rem;
    }
}

/* Additional adjustments for very small screens */
@media (max-width: 360px) {
    .tempo-display {
        font-size: 4rem;
    }

    .beat {
        width: 36px;
        height: 36px;
    }
}

/* Music Visualization Styles */
.music-visualization {
    width: 100%;
    margin-top: 1rem;
    background: rgba(0, 20, 40, 0.5);
    border-radius: 15px;
    padding: 1.5rem;
    position: relative;
    border: 1px solid rgba(0, 255, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.staff-container {
    height: 150px;
    position: relative;
    margin-bottom: 0;
    overflow: hidden;
    border: 1px solid rgba(0, 255, 255, 0.3);
    background: rgba(0, 10, 20, 0.7);
    border-radius: 8px;
}

.staff-line {
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: rgba(0, 255, 255, 0.4);
    box-shadow: 0 0 5px rgba(0, 255, 255, 0.5);
}

/* Move staff lines to the bottom of the container, keeping the spacing between them */
.staff-line:nth-child(1) { bottom: 0px; }
.staff-line:nth-child(2) { bottom: 15px; }
.staff-line:nth-child(3) { bottom: 30px; }
.staff-line:nth-child(4) { bottom: 45px; }
.staff-line:nth-child(5) { bottom: 60px; }

.fireball {
    --jump-duration: 300ms;
    width: 48px;
    height: 48px;
    background: radial-gradient(circle, #ffcc00, #ff6600, #ff3300);
    border-radius: 50%;
    position: absolute;
    bottom: 18px;
    left: 40px;
    transform: translateY(0);
    z-index: 2;
    box-shadow: 0 0 12px #ff6600, 0 0 20px #ff3300;
    transition: transform 0.1s ease-out;
    filter: blur(0.8px);
}

/* Animation for the fireball jump (T-Rex style) */
@keyframes fireballJump {
    0% { transform: translateY(0); }
    50% { 
        transform: translateY(-90px); /* Jump height maintained */
        box-shadow: 0 0 12px #ff6600, 0 0 20px #ff3300;
    }
    100% { transform: translateY(0); }
}

.fireball.jump {
    animation: fireballJump var(--jump-duration, 300ms) ease-out;
}

/* Responsive styles for the visualization */
@media (max-width: 768px) {
    .music-visualization {
        padding: 1rem;
    }
    
    .staff-container {
        height: 120px; /* Changed from 50px to 120px to provide enough room */
    }
    
    /* Keep proper spacing between staff lines in mobile view */
    .staff-line:nth-child(1) { bottom: 0px; }
    .staff-line:nth-child(2) { bottom: 15px; }
    .staff-line:nth-child(3) { bottom: 30px; }
    .staff-line:nth-child(4) { bottom: 45px; }
    .staff-line:nth-child(5) { bottom: 60px; }
    
    .fireball {
        bottom: 18px; /* Center on the 3rd staff line, same as desktop */
        left: 30px;
        width: 40px;
        height: 40px;
    }
    
    @keyframes fireballJump {
        0% { transform: translateY(0); }
        50% { 
            transform: translateY(-75px); /* Maintain 1.5x height for jump */
            box-shadow: 0 0 10px #ff6600, 0 0 15px #ff3300; 
        }
        100% { transform: translateY(0); }
    }
}

/* Musical Note Obstacle Styles */
.obstacle {
    position: absolute;
    width: 24px;
    height: 24px;
    right: -30px;
    z-index: 5;
    background-color: #00ffff;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.7);
}

@keyframes moveLeft {
    from {
        right: -30px;
    }
    to {
        right: calc(100% + 30px);
    }
}

/* Responsive styles for obstacles */
@media (max-width: 768px) {
    .obstacle {
        width: 20px;
        height: 20px; /* Made same as width for a perfect circle */
    }
}

/* Shockwave effect for fireball landing */
.shockwave {
    position: absolute;
    border-radius: 50%;
    border: 2px solid rgba(255, 102, 0, 0.8);
    width: 10px;
    height: 5px; /* Elliptical shape */
    bottom: 15px; /* Will position at fireball's bottom */
    left: 50%; /* Center horizontally */
    transform: translateX(-50%);
    opacity: 0;
    z-index: 1;
    animation: shockwaveExpand 0.5s ease-out forwards;
    box-shadow: 0 0 12px rgba(255, 102, 0, 0.7), 0 0 20px rgba(255, 255, 0, 0.5);
}

/* Secondary shockwave rings */
.shockwave::before, .shockwave::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.shockwave::before {
    border: 2px solid rgba(255, 200, 0, 0.8);
    animation: shockwaveExpand 0.6s ease-out 0.1s forwards;
    box-shadow: 0 0 15px rgba(255, 200, 0, 0.6);
}

.shockwave::after {
    border: 2px solid rgba(255, 255, 0, 0.6);
    animation: shockwaveExpand 0.7s ease-out 0.2s forwards;
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.5);
}

@keyframes shockwaveExpand {
    0% {
        width: 10px;
        height: 5px;
        opacity: 0.8;
        border-width: 2px;
    }
    100% {
        width: 150px;
        height: 60px;
        opacity: 0;
        border-width: 1px;
    }
}

/* Mobile adjustments for shockwave */
@media (max-width: 768px) {
    .shockwave {
        bottom: 12px;
    }
    
    @keyframes shockwaveExpand {
        0% {
            width: 10px;
            height: 4px;
            opacity: 0.8;
            border-width: 2px;
        }
        100% {
            width: 120px;
            height: 45px;
            opacity: 0;
            border-width: 1px;
        }
    }
}