/* ------------------------------------------- */
/* 1. Base Body and WebGL Canvas Setup */
/* ------------------------------------------- */
body {
    margin: 0;
    overflow: hidden; 
    font-family: Arial, sans-serif;
}

/* ------------------------------------------- */
/* 2. Controls Panel Styling (#animations-panel) */
/* ------------------------------------------- */
#animations-panel {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(30, 30, 30, 0.9);
    padding: 10px;
    border-radius: 8px;
    z-index: 50;
    display: flex;
    flex-direction: column; 
    gap: 8px; 
    width: 200px;
    box-sizing: border-box; 
}

#animations-panel h3 {
    margin: 0 0 5px 0;
    color: white;
    font-size: 1.1em;
}

#animations-panel p {
    margin: 0 0 10px 0;
    color: #ccc;
    font-size: 0.85em;
    line-height: 1.2;
}

#animations-panel button {
    background-color: rgba(90, 90, 90, 1);
    color: white;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.15s;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box; 
    margin: 0;
}

#animations-panel button:hover {
    background-color: rgba(120, 120, 120, 1);
}

#animations-panel button.active {
    background-color: #4CAF50;
    color: white;
    box-shadow: 0 0 5px #4CAF50;
}

#close-panel-btn {
    background-color: #ff4d4d !important;
    margin-bottom: 8px;
}

#close-panel-btn:hover {
    background-color: #cc0000 !important;
}

/* ------------------------------------------- */
/* 3. Mobile Joystick Styling */
/* ------------------------------------------- */
#joystick-region {
    display: none; /* Hidden by default for desktop */
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background-color: rgba(100, 100, 100, 0.4);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    touch-action: none;
}

#joystick-pad {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(200, 200, 200, 0.8);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    touch-action: none;
}

#mobile-action-buttons {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

#mobile-action-buttons button {
    background-color: rgba(200, 200, 200, 0.8);
    border: none;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    font-size: 16px;
    font-weight: bold;
    color: #333;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    touch-action: none;
}

/* Media query to show joystick only on touch devices */
@media (pointer: coarse) and (hover: none) {
  #joystick-region {
    display: flex;
  }
  #mobile-action-buttons {
    display: flex;
  }
}

/* ------------------------------------------- */
/* 4. Error Banner Styling */
/* ------------------------------------------- */
#error-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 10px;
    background-color: #cc0000;
    color: white;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    display: none;
    z-index: 2000;
}

/* ------------------------------------------- */
/* 5. Music Player Styling */
/* ------------------------------------------- */
#music-player-container {
    position: fixed;
    /* --- DESKTOP STYLES (Default) --- */
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    
    /* --- Glassmorphism Effect --- */
    background-color: rgba(255, 255, 255, 0.1); /* Lighter, more transparent background */
    backdrop-filter: blur(10px);               /* The blur effect */
    border: 1px solid rgba(255, 255, 255, 0.2); /* Subtle border to define the edge */

    /* --- Other styles --- */
    color: white;
    padding: 10px;
    border-radius: 12px; /* Slightly more rounded for the glass feel */
    z-index: 100;
    width: 300px;
    box-sizing: border-box;
}

/* --- MOBILE STYLES (Screen smaller than 768px) --- */
@media (max-width: 768px) {
  #music-player-container {
    top: 15px;      /* On mobile, position from the top */
    bottom: auto;   /* And remove the bottom positioning */
  }
}

#player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#song-name {
    font-size: 14px;
    font-family: sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#toggle-music-btn {
    background: #444;
    border: 1px solid #666;
    color: white;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

#music-controls.hidden {
    display: none;
}

#timeline-container {
    display: flex;
    align-items: center;
    color: white;
    margin-bottom: 5px;
}

#timeline-container span {
    margin: 0 10px;
    font-size: 14px;
}

#timeline {
    width: 100%;
    cursor: pointer;
}

#button-container {
    display: flex;
    justify-content: center;
    gap: 5px;
}

#button-container button {
    background-color: rgba(255, 255, 255, 0.15); /* Semi-transparent white */
    border: 1px solid rgba(255, 255, 255, 0.3); /* Lighter border for glass effect */
    color: #fff;
    border-radius: 8px; /* More rounded to match container */
    padding: 8px 12px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease; /* Smooth transition */
}

#button-container button:hover {
    background-color: rgba(255, 255, 255, 0.25); /* Light up on hover */
}

#button-container button:active {
    background-color: rgba(255, 255, 255, 0.35); /* Darken slightly on click */
}

