/* =============================================
   MRGame - Main Stylesheet
   ============================================= */

/* === CSS Variables === */
:root {
    --gradient-neon: linear-gradient(90deg, #00f5d4, #00bbf9, #9b5de5, #f15bb5, #fee440);
    --bg-dark: #0a0a12;
    --accent-cyan: #00f5ff;
    --accent-pink: #ff6b9d;
    --accent-purple: #9d4edd;
    --accent-gold: #ffd700;
    --accent-green: #43cea2;
    --glass-bg: rgba(15, 15, 35, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* === Reset & Base === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background: var(--bg-dark);
    color: #fff;
    overflow: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* === Three.js Background === */
#three-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* === Game Container === */
#game-container {
    position: relative;
    z-index: 10;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 
        0 0 0 2px rgba(0, 245, 255, 0.3),
        0 0 40px rgba(0, 245, 255, 0.2),
        0 0 80px rgba(157, 78, 221, 0.15),
        0 25px 50px rgba(0, 0, 0, 0.5);
    background: linear-gradient(145deg, rgba(20, 20, 50, 0.95), rgba(10, 10, 30, 0.98));
}

#game-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: var(--gradient-neon);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.5;
    filter: blur(4px);
    animation: borderGlow 4s ease-in-out infinite;
}

#overlay-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* === Animations === */
@keyframes borderGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.7; }
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* === Song Selection Overlay === */
.file-upload-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 18, 0.98);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.file-upload-overlay.hidden {
    display: none;
}

.upload-box {
    width: 500px;
    padding: 40px;
    background: linear-gradient(145deg, rgba(30, 30, 60, 0.9), rgba(20, 20, 40, 0.95));
    border: 2px solid rgba(0, 245, 255, 0.3);
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.upload-box:hover {
    border-color: var(--accent-gold);
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.3);
}

.upload-icon {
    font-size: 60px;
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.upload-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 24px;
    color: var(--accent-cyan);
    margin-bottom: 10px;
}

.upload-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
}

/* === Song List === */
.song-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 5px;
}

.song-list::-webkit-scrollbar {
    width: 6px;
}

.song-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.song-list::-webkit-scrollbar-thumb {
    background: var(--accent-purple);
    border-radius: 3px;
}

.song-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.15), rgba(0, 245, 255, 0.1));
    border: 1px solid rgba(0, 245, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.song-item:hover {
    background: linear-gradient(135deg, rgba(157, 78, 221, 0.3), rgba(0, 245, 255, 0.2));
    border-color: var(--accent-cyan);
    transform: translateX(5px);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.2);
}

.song-item.selected {
    background: linear-gradient(135deg, rgba(0, 245, 255, 0.3), rgba(157, 78, 221, 0.25));
    border-color: var(--accent-gold);
}

.song-icon {
    font-size: 28px;
}

.song-info {
    flex: 1;
    text-align: left;
}

.song-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    color: #fff;
    margin-bottom: 3px;
}

.song-artist {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
}

/* === Buttons === */
.upload-btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    border: none;
    border-radius: 25px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 245, 255, 0.4);
}

.or-text {
    margin: 20px 0;
    color: rgba(255, 255, 255, 0.3);
}

.demo-btn {
    padding: 12px 30px;
    background: transparent;
    border: 2px solid var(--accent-purple);
    border-radius: 25px;
    color: var(--accent-purple);
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.demo-btn:hover {
    background: var(--accent-purple);
    color: #fff;
    box-shadow: 0 0 20px rgba(157, 78, 221, 0.4);
}

/* === Loading Overlay === */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1500;
}

.loading-overlay.hidden {
    display: none;
}

.loading-logo {
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    font-weight: 900;
    background: var(--gradient-neon);
    background-size: 400% 400%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradientShift 3s ease infinite;
    margin-bottom: 40px;
}

.loading-bar-container {
    width: 300px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: var(--gradient-neon);
    background-size: 200% 100%;
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.loading-text {
    font-family: 'Exo 2', sans-serif;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 20px;
    letter-spacing: 3px;
}

/* === Hidden Elements === */
#file-input {
    display: none;
}
