/* General body styling */
body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #121212;
    color: #fff;
}

body {
    background: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}

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

#visualizer-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

#container {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
    pointer-events: none;
    transition: justify-content 0.4s ease, align-items 0.4s ease;
}

/* Positioning classes */
#container.pos-top-center    { justify-content: flex-start; align-items: center; }
#container.pos-top-left      { justify-content: flex-start; align-items: flex-start; }
#container.pos-top-right     { justify-content: flex-start; align-items: flex-end; }
#container.pos-bottom-center { justify-content: flex-end; align-items: center; }
#container.pos-bottom-left   { justify-content: flex-end; align-items: flex-start; }
#container.pos-bottom-right  { justify-content: flex-end; align-items: flex-end; }

.controls {
    position: relative; /* Needed for absolute positioning of children */
    background: rgba(0, 0, 0, 0.5);
    padding: 20px;
    padding-top: 30px; /* Make space for buttons */
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    width: 450px;
    max-width: 90%;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.controls.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

#position-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

#position-controls button {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 14px;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s;
    line-height: 28px;
}

#position-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
}

#hide-controls-btn {
    font-weight: bold;
    margin-left: 10px;
}

#show-controls-btn {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

#show-controls-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
}

.controls label {
    display: block;
    margin-bottom: 10px;
    font-size: 1em;
    font-weight: 500;
}

#playlist {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #555;
    background-color: #333;
    color: #fff;
    font-size: 0.9em;
    margin-bottom: 20px;
    cursor: pointer;
}

#audio-player {
    width: 100%;
    margin-bottom: 15px;
}

.slider-container {
    margin-top: 10px;
    text-align: left;
}

.slider-container label {
    font-size: 0.9em;
    margin-bottom: 5px;
}

input[type="range"] {
    width: 100%;
    cursor: pointer;
}

.auto-adjust-container {
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auto-adjust-container label {
    margin: 0;
    margin-left: 8px;
    font-size: 0.9em;
    cursor: pointer;
}

