/* --- CSS Variables for Riffuge Palette --- */
:root {
    --color-dark-bg: #1A1A3A;         /* Deep Space Blue/Purple */
    --color-container-bg: #27274E;    /* Slightly lighter container */
    --color-primary-neon: #00FFFF;    /* Bright Cyan/Aqua */
    --color-secondary-neon: #9400D3;  /* Vivid Violet/Purple */
    --color-text-light: #E0E0FF;      /* Off-White text for contrast */
    --color-text-dim: #A0A0C0;        /* Dimmed text/artist name */
}

/* Basic Reset & Body Background */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-dark-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    color: var(--color-text-light);
}

#player-container {
    background-color: var(--color-container-bg);
    border: 1px solid var(--color-secondary-neon); /* Subtle neon border */
    padding: 25px;
    border-radius: 12px;
    width: 350px;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.2); /* Neon glow effect */
    text-align: center;
}

#player-title {
    color: var(--color-primary-neon);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-secondary-neon);
    text-shadow: 0 0 5px var(--color-primary-neon); /* Title glow */
}

/* Media Info */
#album-art {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    margin-bottom: 15px;
    object-fit: cover;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

#track-title {
    font-size: 1.4em;
    font-weight: bold;
    color: var(--color-text-light);
}

#track-artist {
    color: var(--color-text-dim);
    margin-bottom: 10px;
}

#buy-link {
    color: var(--color-primary-neon);
    text-decoration: none;
    font-size: 0.9em;
    display: inline-block;
    margin-top: 5px;
    transition: color 0.2s;
}

#buy-link:hover {
    color: var(--color-text-light);
}

/* Controls */
#controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 15px 0;
}

#controls button {
    background: transparent;
    border: 1px solid var(--color-text-dim);
    color: var(--color-text-dim);
    padding: 10px 15px;
    margin: 0 4px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    transition: all 0.2s, color 0.2s;
}

#controls button:hover {
    background: rgba(148, 0, 211, 0.3); /* Purple hover tint */
    color: var(--color-primary-neon);
    border-color: var(--color-primary-neon);
}

#play-pause-btn {
    font-size: 1.8em;
    border-radius: 50%;
    background-color: var(--color-primary-neon);
    color: var(--color-dark-bg); /* Dark text on bright button */
    border: none;
    box-shadow: 0 0 10px var(--color-primary-neon);
    padding: 12px 18px;
    margin: 0 10px;
}

#play-pause-btn:hover {
    background-color: var(--color-text-light);
    color: var(--color-dark-bg);
    box-shadow: 0 0 15px var(--color-text-light);
}

/* Progress */
#progress-area {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 15px 0;
    font-size: 0.9em;
}

#current-time, #total-time {
    color: var(--color-text-dim);
}

/* Customizing the range slider for a neon look */
#seek-slider {
    flex-grow: 1;
    height: 6px;
    background: var(--color-secondary-neon);
    border-radius: 3px;
    -webkit-appearance: none;
    appearance: none;
}

#seek-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--color-primary-neon);
    cursor: pointer;
    box-shadow: 0 0 8px var(--color-primary-neon);
}

/* Menu & Playlist (Action Button Alignment Fix) */
#menu-area {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--color-secondary-neon);
    /* Use flexbox to center and stack buttons for consistent spacing */
    display: flex; 
    flex-direction: column;
    align-items: center; 
}

#file-uploader {
    display: none;
}

/* Consolidated style for both the label (Load Music) and button (Stream) */
#menu-area .action-button {
    display: block; 
    width: 90%; /* Fixed width for consistent visual size and centering */
    padding: 12px; 
    margin-bottom: 8px;
    
    border: 1px solid var(--color-primary-neon);
    background-color: transparent;
    color: var(--color-primary-neon);
    cursor: pointer;
    border-radius: 4px;
    text-align: center;
    transition: background-color 0.2s, color 0.2s;
    text-transform: uppercase;
    font-weight: 600; 
}

#menu-area .action-button:hover {
    background-color: rgba(0, 255, 255, 0.1);
    color: var(--color-text-light);
}

.external-links {
    margin-top: 10px;
}

.external-links a {
    color: var(--color-text-dim);
    text-decoration: none;
    font-size: 0.8em;
}

.external-links a:hover {
    color: var(--color-primary-neon);
}


/* Playlist View */
#playlist-view {
    text-align: left;
    margin-top: 25px;
    max-height: 180px;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.3); /* Transparent dark backing */
    border-radius: 4px;
}

#playlist-view h2 {
    font-size: 1.1em;
    color: var(--color-primary-neon);
    padding: 10px;
    margin: 0;
    border-bottom: 1px solid var(--color-secondary-neon);
}

#playlist {
    padding: 0;
    margin: 0;
}

#playlist li {
    list-style: none;
    padding: 8px 10px;
    border-bottom: 1px dotted rgba(255, 255, 255, 0.1);
    cursor: pointer;
    font-size: 0.9em;
    transition: background-color 0.1s;
}

#playlist li:hover {
    background-color: rgba(148, 0, 211, 0.2); /* Light purple highlight */
}

.playing {
    font-weight: bold;
    color: var(--color-primary-neon);
    background-color: rgba(0, 255, 255, 0.1);
}

/* Styling for the new server URL input */
#menu-area .server-input {
    width: 90%;
    padding: 8px;
    margin-bottom: 5px;
    border: 1px solid var(--color-secondary-neon);
    background-color: var(--color-container-bg);
    color: var(--color-text-light);
    border-radius: 4px;
    text-align: center;
    box-sizing: border-box; /* Include padding/border in the element's total width */
}

#menu-area .server-load-btn {
    /* Ensures server buttons use the same styling as action-button */
    margin-top: 5px;
    margin-bottom: 15px; 
}

/* Update the existing menu area to better handle the new elements */
#menu-area {
    /* ... existing styles ... */
    display: flex; 
    flex-direction: column;
    align-items: center; 
}

/* Ensure the action button padding is consistent */
#menu-area .action-button {
    /* ... existing styles ... */
    width: 90%; 
    padding: 12px; 
    margin-bottom: 8px; /* Standardize vertical spacing */
    /* ... existing styles ... */
}