* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #e6f0f8;
    border-style: solid;
    border-color: #4683ac;
    border-width: 30px 8px 8px 8px;
    border-radius: 2px;
    box-shadow: inset 0 0 18px rgba(0, 0, 0, 0.55), inset 0 0 0 1px #000000;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0;
    overflow: hidden;
}

.frame-title {
    position: fixed;
    top: 6px;
    left: 12px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 0 rgba(39, 39, 39, 0.45);
    pointer-events: none;
    z-index: 9999;
}

.container {
    background: linear-gradient(180deg, #ffffff 0%, #f5f5f5 100%);
    border-radius: 0;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.8);
    width: 100%;
    height: 100%;
    overflow: hidden;
    border: none;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(180deg, #e8f4ff 0%, #d4e8f7 100%);
    color: #003d7a;
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #c0d9e8;
    font-weight: bold;
    font-size: 0.9em;
    letter-spacing: 1px;
}

.header h1 {
    font-size: 1.1em;
    margin: 0;
    color: #003d7a;
}

.header p {
    font-size: 0.75em;
    opacity: 0.8;
    margin-top: 5px;
    color: #336699;
}

.main-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 450px;
}

.player-section {
    flex: 0 0 auto;
    padding: 2px 25px 2px 25px;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    display: flex;
    flex-direction: column;
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.now-playing {
    margin-bottom: 20px;
    text-align: center;
}

.now-playing .label {
    font-size: 0.7em;
    color: #336699;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: bold;
}

.now-playing .track {
    font-size: 1em;
    font-weight: 300;
    color: #0065ca;
    word-break: break-word;
    min-height: auto;
    margin-bottom: 40px;
}

.progress-container {
    margin-bottom: 2px;
    margin-top: 0;
    padding-top: 0;
}

.progress-bar {
    width: 98%;
    height: 3px;
    background: linear-gradient(180deg, rgba(232, 232, 232, 0.5) 0%, rgba(240, 240, 240, 0.5) 100%);
    border-radius: 2px;
    cursor: pointer;
    overflow: visible;
    border: 1px solid rgba(192, 192, 192, 0.6);
    box-shadow: 0 0 12px rgba(0, 120, 215, 0.3), inset 0 1px 2px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    margin: 0 auto;
}

.progress {
    height: 100%;
    background: linear-gradient(180deg, #0078d7 0%, #0063b1 100%);
    width: 0%;
    transition: width 0.1s linear;
    box-shadow: 0 0 10px rgba(0, 120, 215, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    position: relative;
}

.progress-pill {
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 10px;
    background: linear-gradient(180deg, #0078d7 0%, #0063b1 100%);
    border-radius: 6px;
    box-shadow: 0 0 8px rgba(0, 120, 215, 0.6), 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: grab;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-bar:hover .progress-pill,
.progress-pill:hover {
    opacity: 1;
}

.progress-pill:active {
    cursor: grabbing;
}

.time-display {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #666;
    margin-top: 8px;
    font-family: 'Segoe UI', sans-serif;
    font-weight: 500;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
    margin-bottom: 25px;
}

.volume-control label {
    font-size: 0.85em;
    color: #336699;
    font-weight: bold;
}

.volume-control input {
    width: 64%;
    padding-left: 20px;
    max-width: 120px;
    height: 2px;
    cursor: pointer;
    accent-color: #0078d7;
    border-radius: 6px;
    box-shadow: 0 0 12px rgba(0, 120, 215, 0.3);
    filter: drop-shadow(0 0 8px rgba(0, 120, 215, 0.2));
}

.volume-control input::-webkit-slider-runnable-track {
    height: 2px;
}

.volume-control input::-moz-range-track {
    height: 2px;
}

.volume-control input:hover {
    box-shadow: 0 0 16px rgba(0, 120, 215, 0.5);
    filter: drop-shadow(0 0 12px rgba(0, 120, 215, 0.4));
}

.volume-control input::-webkit-slider-thumb {
    box-shadow: 0 0 8px rgba(0, 120, 215, 0.4);
}

.volume-control input::-moz-range-thumb {
    box-shadow: 0 0 8px rgba(0, 120, 215, 0.4);
}

.audio-player {
    display: none;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

#current-track {
    color: #1b82e8;
    font-style: normal;
}

#current-track.track-empty {
    color: #7a7a7a;
    font-style: italic;
}

button {
    padding: 10px 20px;
    border: 1px solid #a0a0a0;
    border-radius: 4px;
    font-size: 0.85em;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

button:hover {
    background: linear-gradient(180deg, #e8f4ff 0%, #d4e8f7 100%);
    color: #003d7a;
    border-color: #0078d7;
    box-shadow: 0 1px 3px rgba(0, 120, 215, 0.3);
}

button:active {
    background: linear-gradient(180deg, #b8d8f0 0%, #a8c8e1 100%);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    color: #999;
    border-color: #c0c0c0;
}

button:disabled:hover {
    background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #999;
    border-color: #a0a0a0;
    box-shadow: none;
}

#play-pause-btn {
    transition: filter 0.2s ease;
}

#play-pause-btn:hover {
    filter: drop-shadow(0 0 8px rgba(0, 120, 215, 0.6));
}

#prev-btn,
#next-btn {
    transition: filter 0.2s ease;
}

#prev-btn:hover,
#next-btn:hover {
    filter: drop-shadow(0 0 6px rgba(0, 120, 215, 0.45));
}

.search-box {
    padding: 0;
    background: none;
}

.playlist-header .search-box {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.search-box input {
    width: 180px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 120, 215, 0.4);
    border-radius: 4px;
    font-size: 0.8em;
    outline: none;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.search-box input::placeholder {
    color: #999;
}

.search-box input:focus {
    border-color: #0078d7;
    box-shadow: 0 0 4px rgba(0, 120, 215, 0.3), inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.playlist-side {
    width: 100%;
    background: linear-gradient(180deg, #f8f9fa 0%, #f0f0f0 100%);
    border-bottom: 1px solid #d0d0d0;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.playlist-header {
    padding: 2px 15px;
    background: linear-gradient(180deg, #ffffff 0%, #e8e8e8 100%);
    border-bottom: 1px solid #b0b0b0;
    font-weight: bold;
    color: #333;
    font-size: 0.8em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.playlist-section {
    flex: 1;
    overflow-y: scroll;
    scrollbar-width: thin;
    scrollbar-color: #d0d0d0 #f0f0f0;
}

.playlist {
    list-style: none;
}

.playlist-item {
    padding: 6px 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75em;
    color: #333;
    background: white;
    margin: 0px 4px;
    border-radius: 4px;
}

.playlist-item:hover {
    background: #f5f5f5;
    color: #003d7a;
    border-radius: 4px;
    box-shadow: inset 0 0 8px rgba(0, 120, 215, 0.2);
}

.playlist-item.active {
    background: white;
    color: #333;
    border: 1px solid #0078d7;
    padding: 4px 6px;
    font-weight: 600;
    box-shadow: inset 0 0 5px rgba(0, 120, 215, 0.4);
}

.playlist-item .index {
    font-size: 0.8em;
    color: #999;
    min-width: 20px;
}

.playlist-item.active .index {
    color: #0078d7;
    font-weight: bold;
}

.playlist-item .name {
    flex: 1;
    word-break: break-word;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-item .duration {
    font-size: 0.75em;
    color: #999;
    min-width: 35px;
    text-align: right;
    margin-left: auto;
    padding-left: 8px;
}

.no-results {
    padding: 40px 20px;
    text-align: center;
    color: #999;
    font-size: 0.85em;
}

.playlist-section::-webkit-scrollbar {
    width: 12px;
}

.playlist-section::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-left: 1px solid #d0d0d0;
}

.playlist-section::-webkit-scrollbar-thumb {
    background: #8a8a8a;
    border-radius: 6px;
}

.playlist-section::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #0078d7 0%, #0063b1 100%);
}

@media (max-width: 900px) {
    .main-content {
        flex-direction: column;
        min-height: auto;
    }

    .player-section {
        padding: 12px;
        flex: 0 0 auto;
    }

    .now-playing {
        margin-bottom: 2px;
    }

    .progress-container {
        margin-bottom: 8px;
    }

    .volume-control {
        margin-bottom: 8px;
        gap: 8px;
    }

    .controls {
        gap: 8px;
        margin-bottom: 0;
    }

    button {
        padding: 8px 12px;
        font-size: 0.75em;
    }

    .playlist-side {
        width: 100%;
        border-bottom: 1px solid #d0d0d0;
        flex: 1;
    }

    .container {
        min-height: auto;
    }
}
