/* ==========================================
   1. BASE RESETS & ANIMATED BACKGROUND
   ========================================== */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    
    /* Premium Animated Gradient Background for Menu */
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #050505);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    
    overflow: auto; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;             
    justify-content: center;   
    align-items: center;       
}

/* Switches to pitch black when the visualizer is playing */
body.visualizer-active {
    background: #050505 !important;
    animation: none !important;
}

/* Smoothly transitions the gradient positions */
@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ==========================================
   2. TOP NAVIGATION (BACK BUTTON & VOLUME)
   ========================================== */
.top-nav-btn {
    position: fixed;
    top: 20px;
    z-index: 200;
    background: rgba(15, 15, 20, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
    backdrop-filter: blur(10px); /* Frost glass effect */
}

.back-btn {
    left: 20px;
    color: #fff;
    padding: 10px 18px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(255, 0, 127, 0.9);
    border-color: #ff007f;
    box-shadow: 0 0 15px #ff007f;
    transform: scale(1.05);
}

.volume-container {
    right: 20px;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.volume-container i {
    color: #fff;
    cursor: pointer;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.volume-container i:hover {
    color: #ff007f;
}

/* Custom Webkit Slider Styling */
.volume-container input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100px;
    background: transparent;
    outline: none;
}

.volume-container input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.volume-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #00e5ff;
    cursor: pointer;
    margin-top: -5px;
    box-shadow: 0 0 10px #00e5ff;
}

/* ==========================================
   3. MAIN UI CONTAINER & MENU
   ========================================== */
#container {
    position: relative; 
    z-index: 10; 
    text-align: center;
    color: white;
    width: 95%;
    max-width: 650px;
    margin-top: 20px;
    margin-bottom: 50px;
}

/* Optional soft glow behind the entire menu */
#container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(102,192,244,0.1) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

h1 {
    text-shadow: 0 0 15px rgba(0,0,0,0.8);
    margin-bottom: 5px;
    font-size: 2.2rem;
    letter-spacing: 1px;
}

.subtitle {
    margin-top: 0;
    margin-bottom: 20px;
    color: #b0b8c0;
    font-size: 0.95rem;
}

/* Glassmorphism Menu Box */
.instructions {
    background: rgba(15, 15, 20, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    padding: 20px;
    text-align: left;
    backdrop-filter: blur(15px); /* Strong blur for a modern look */
}

/* Individual Method Cards */
.method-card {
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.2s ease;
}

.method-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.method-card:last-child {
    margin-bottom: 0;
}

.method-title {
    font-size: 1.1em;
    display: block;
    margin-bottom: 5px;
}

.method-card:nth-child(2) .method-title { color: #f0c040; } 
.method-card:nth-child(3) .method-title { color: #66c0f4; } 
.method-card:nth-child(4) .method-title { color: #ff007f; } 

.method-desc {
    font-size: 0.85em;
    color: #cccccc;
    margin: 0 0 12px 0;
}

.dropdown-select {
    width: 100%;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #ffffff;
    border: 1px solid #f0c040;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    margin-bottom: 10px;
    outline: none;
    transition: all 0.2s ease;
}

.dropdown-select:focus {
    box-shadow: 0 0 8px rgba(240, 192, 64, 0.5);
}

/* ==========================================
   4. BUTTONS & INTERACTIVE ELEMENTS
   ========================================== */
.btn-wrapper {
    text-align: center;
}

.action-btn {
    display: inline-block;
    padding: 10px 25px;
    font-size: 15px;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.action-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.action-btn:disabled {
    background-color: #555 !important;
    box-shadow: none !important;
    cursor: not-allowed;
    transform: none;
}

.radio-btn { background-color: #f0c040; box-shadow: 0 0 12px rgba(240, 192, 64, 0.6); color: #000; }
.file-btn { background-color: #66c0f4; box-shadow: 0 0 12px rgba(102, 192, 244, 0.6); color: #000; }
.play-file-btn { background-color: #00e5ff; box-shadow: 0 0 12px rgba(0, 229, 255, 0.6); color: #000; }
.desktop-btn { background-color: #ff007f; box-shadow: 0 0 12px rgba(255, 0, 127, 0.6); }

.hidden-section {
    display: none;
    margin-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 15px;
    text-align: center;
}

.file-name {
    color: #fff;
    font-size: 0.85em;
    margin-bottom: 10px;
    word-break: break-all;
}

/* ==========================================
   5. VISUALIZER CANVAS
   ========================================== */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1; 
    display: none; /* Hidden until music actually plays */
}

/* ==========================================
   6. FOOTER
   ========================================== */
#footer { 
    position: fixed; 
    bottom: 15px; 
    width: 100%;        
    text-align: center; 
    z-index: 100; 
    font-size: 14px; 
    color: rgba(255, 255, 255, 0.5); 
}

#footer i { color: #ff3366; margin: 0 4px; animation: heartbeat 1.5s infinite; }
#footer a { color: #66c0f4; text-decoration: none; font-weight: 800; transition: color 0.2s; }
#footer a:hover { color: #fff; }

@keyframes heartbeat { 
    0%, 100% { transform: scale(1); } 
    14%, 42% { transform: scale(1.2); } 
    28%, 70% { transform: scale(1); } 
}

/* Mobile Responsive Overrides */
@media (max-width: 768px) {
    .desktop-only { display: none !important; }
    h1 { font-size: 1.8rem; }
    .volume-container { padding: 8px 10px; }
    .volume-container input[type="range"] { width: 80px; }
}