:root { --bg: #2b1d1a; --panel: #3e2723; --accent: #d2b48c; --text: #a1887f; }
body { background: var(--bg); color: var(--accent); font-family: sans-serif; margin: 0; }

/* Responsive Container */
.container { width: 60%; margin: 0 auto; background: var(--panel); min-height: 100vh; display: flex; flex-direction: column; }
@media (max-width: 1024px) { .container { width: 100%; } }

/* Sticky Header with Custom Player */
.header-sticky { position: sticky; top: 0; background: var(--panel); padding: 20px; border-bottom: 4px solid #5d4037; z-index: 1000; }
#now-playing { 
    font-weight: bold; 
    font-size: 1.2em; 
    color: #fff;
    height: 1.4em; 
    line-height: 1.4em;
    margin-bottom: 15px; 
    display: block; 
    overflow: hidden; /* Hide the parts that stick out */
    position: relative;
    white-space: nowrap;
}

#now-playing span {
    display: inline-block;
    padding-right: 50px; /* Space between loops */
    will-change: transform;
}
.scroll-active span {
    animation: marquee-smart 10s linear infinite;
}
@keyframes marquee-smart {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}

/* Pause the scroll when you hover over it with a mouse */
#now-playing:hover span {
    animation-play-state: paused;
}
.now-playing-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

#now-playing { 
    flex: 1;
    font-weight: bold; 
    font-size: 1.2em; 
    color: #fff;
    height: 1.4em; 
    line-height: 1.4em;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

#time-display {
    font-family: 'Courier New', monospace; /* Monospaced keeps numbers from jumping */
    font-size: 1.1em;
    color: var(--accent);
    min-width: 60px; /* Prevents layout shift when numbers change */
    text-align: right;
    cursor: pointer;
}

/* Custom Progress Bar */
.progress-container { width: 100%; height: 20px; background: #2b1d1a; border-radius: 10px; cursor: pointer; margin-bottom: 20px; position: relative; }
#progress-bar { height: 100%; background: var(--accent); width: 0%; border-radius: 10px; transition: width 0.1s linear; }

/* Big Custom Controls */
.main-controls { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 10px; margin-bottom: 15px; }
.btn { background: #5d4037; color: var(--accent); border: 2px solid #8d6e63; padding: 20px; font-size: 1.2em; font-weight: bold; cursor: pointer; border-radius: 8px; text-align: center; }
.btn.active { background: var(--accent); color: var(--bg); border-color: #fff; box-shadow: 0 0 15px var(--accent); }
#play-pause { font-size: 1.5em; background: #6d4c41; color: white; }

/* File List */
#file-list { flex: 1; display: block; }
#file-list a { color: var(--text); text-decoration: none; display: block; padding: 25px 20px; border-bottom: 1px solid #4e342e; font-size: 1.2em; }
.folder { font-weight: bold; color: #fff !important; background: rgba(0,0,0,0.1); }
.playing { background: #5d4037 !important; color: #fff !important; border-left: 12px solid var(--accent) !important; }

/* Hide Native Player */
audio { display: none; }

/* Ensure the wrapper doesn't shrink the slider */
.volume-row {
    width: 100% !important;
    display: block !important;
    margin: 15px 0;
    box-sizing: border-box;
}

.volume-header {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Force the icon to be colorless */
.vol-icon {
    filter: grayscale(100%) contrast(100%) brightness(1.2) !important;
    display: inline-block;
    font-size: 1.2rem;
}

/* The actual slider bar */
#volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 12px;
    /* This gradient will be updated by JavaScript */
    background: linear-gradient(to right, var(--accent) 0%, #1a110f 0%);
    border-radius: 6px;
    outline: none;
    border: 1px solid #5d4037;
    display: block;
}

/* Chrome/Safari Thumb */
#volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid #5d4037;
    cursor: pointer;
    margin-top: -1px; /* Fine-tune vertical centering if needed */
}

/* Firefox Thumb */
#volume-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid #5d4037;
    cursor: pointer;
}







.item-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; /* Important: takes full width of file-list */
    box-sizing: border-box;
    padding: 5px;
}

.item-container a {
    flex-grow: 1; /* Pushes everything else to the right */
    text-decoration: none;
}

/* Ensure the trash can doesn't shrink and stays on the right */
.delete-btn {
    display: inline-block; 
    cursor: pointer;
    margin-left: 10px;
}
.upload-progress-item {
    padding: 10px;
    background: #2a1a17; /* Slightly lighter than your bg */
    border: 1px solid #634731;
    margin-bottom: 5px;
    font-size: 12px;
}

.progress-bg {
    width: 100%;
    height: 8px;
    background: #1a110f;
    margin-top: 5px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #634731; /* Your brown accent */
    transition: width 0.1s linear;
}

.fade-out {
    opacity: 0;
    transition: opacity 1s ease;
}

.abort-btn {
    color: #888;
    font-size: 10px;
    cursor: pointer;
    font-weight: bold;
    padding: 0 5px;
}

.abort-btn:hover {
    color: #ff4444;
}

/* Ensure the container stays neat */
.upload-progress-item {
    transition: opacity 0.5s ease;
    border-left: 3px solid #634731; /* Accent stripe */
}
/* The glow effect */
#file-list.drag-over {
    background-color: rgba(99, 71, 49, 0.1) !important; /* Subtle brown tint */
    outline: 2px dashed #634731; /* Dashed border looks like a 'drop zone' */
    outline-offset: -10px; /* Moves the border inside the container */
    box-shadow: inset 0 0 50px rgba(99, 71, 49, 0.4); /* The glow */
    transition: all 0.2s ease;
}

/* Optional: Make the text slightly dim to make the glow pop */
#file-list.drag-over a {
    opacity: 0.5;
}
#create-folder-btn {
    background: #2a1a17;
    color: #634731;
    border: 1px solid #634731;
    padding: 5px 15px;
    cursor: pointer;
    margin-bottom: 10px;
    font-family: inherit;
    transition: all 0.2s;
}

#create-folder-btn:hover {
    background: #634731;
    color: #f0f0f0;
}