:root {
    --bg-color: #121212;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-main: #e0e0e0;
    --text-secondary: #aaaaaa;
    --accent: #bb86fc;
    --accent-hover: #9965f4;
    --danger: #cf6679;
    --glass-border: rgba(255, 255, 255, 0.1);
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    min-height: 100dvh;
    /* For modern mobile browsers */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

.player-container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 30px;
    width: 100%;
    width: 500px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    /* Flex layout for scrolling */
    display: flex;
    flex-direction: column;
    max-height: 95vh;
    /* Leave some breathing room on desktop */
}

header {
    text-align: center;
    margin-bottom: 25px;
}

header h1 {
    font-weight: 300;
    letter-spacing: 2px;
    margin-bottom: 5px;
    color: var(--accent);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.title-icon {
    height: 1.2em;
    width: auto;
    border-radius: 20%;
    /* Slight rounding if it's square, or keep it square */
}

header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Track List */
.track-list-section {
    margin-bottom: 30px;
    flex: 1;
    /* Take available space */
    min-height: 0;
    /* Allow shrinking below content size to trigger scroll */
    overflow-y: auto;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.track-list {
    list-style: none;
}

.track-list li {
    padding: 15px;
    border-bottom: 1px solid var(--glass-border);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    position: relative;
    /* For absolute markers */
}

.track-list li:last-child {
    border-bottom: none;
}

.track-list li:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.track-list li.active {
    background: rgba(187, 134, 252, 0.2);
    color: var(--accent);
    border-left: 3px solid var(--accent);
    font-weight: 600;
}

.track-list li .icon {
    margin-right: 10px;
    font-size: 1.2rem;
}

/* Controls Section */
.controls-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex-shrink: 0;
    /* Never shrink controls */
}

/* Transport Buttons */
.transport-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.85rem;
}

button:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button.play-btn {
    background: var(--accent);
    color: #000;
    font-weight: bold;
    min-width: 80px;
}

button.play-btn:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(187, 134, 252, 0.4);
}

/* Sliders */
.sliders-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

/* Marker Button UI (Updated) */
.slider-row {
    display: flex;
    align-items: stretch;
    /* Make button full height */
    gap: 10px;
}

.slider-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    /* Take remaining width */
}

.slider-row label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-row label span {
    color: var(--accent);
    font-family: monospace;
}

.marker-btn {
    padding: 0 0 10px 0;
    /* Add bottom padding to visually center considering the tail */
    font-size: 2rem;
    /* Larger plus */
    line-height: 1;
    background: rgba(187, 134, 252, 0.3);
    /* Match default marker tint or just glass */
    background: var(--glass-border);
    color: var(--text-main);

    /* Shape */
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 85%, 0% 100%);
    border-radius: 4px;
    /* Slight rounding on top */

    /* Sizing */
    height: auto;
    width: 40px;
    /* Wider */
    min-height: 50px;
    /* Taller */

    display: flex;
    justify-content: center;
    align-items: center;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.marker-btn:hover {
    background: var(--accent);
    color: #000;
    transform: translateY(-2px);
}

.ticks {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    padding: 0 5px;
}

/* Custom Range Input */
input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]:focus {
    outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

input[type=range]::-webkit-slider-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -5px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Mozilla Firefox */
input[type=range]::-moz-range-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

input[type=range]::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

@media (max-width: 500px) {
    body {
        padding: 0;
        align-items: flex-start;
    }

    .player-container {
        max-width: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        border-radius: 0;
        border: none;
        border-top: none;
        border-bottom: none;
        margin: 0;
        backdrop-filter: none;
        background: radial-gradient(circle at top right, #1e1e24, #121212);
        display: flex;
        flex-direction: column;
        justify-content: center;
        /* Center if content is small */
        max-height: 100vh;
        max-height: 100dvh;
        /* Full viewport height */
    }
}

/* Markers in List */
.track-markers {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 5px;
}

.marker-tag {
    background: var(--glass-border);
    border: none;
    /* remove border for clean shape */
    color: var(--text-main);
    font-size: 0.85rem;
    /* Larger font */
    font-weight: bold;
    padding: 4px 10px 12px 8px;
    /* Extra padding bottom for the tail */
    cursor: pointer;
    transition: all 0.2s;
    z-index: 2;

    /* Bookmark Shape */
    clip-path: polygon(0% 0%, 100% 0%, 100% 100%, 50% 80%, 0% 100%);
    border-radius: 2px;
    /* Slight rounding on top corners if supported or ignored by clip-path */

    /* Ensure sizing */
    min-width: 25px;
    text-align: center;

    /* Visual distinction */
    background: rgba(187, 134, 252, 0.3);
    /* Slight tint default */

    /* Above title */
}

.marker-tag:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    text-align: center;
    max-width: 90%;
    width: 300px;
}

.modal h3 {
    margin-bottom: 15px;
    color: var(--accent);
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.modal-actions button.danger {
    background: var(--danger);
    color: white;
    border: none;
}

.modal-actions button.danger:hover {
    background: #ff4444;
}