:root {
    --bg: #080808;
    --panel: #111111;
    --panel-2: #181818;
    --border: #292929;
    --text: #ffffff;
    --muted: #9a9a9a;
    --accent: #e50914;
    --accent-hover: #ff1a25;
    --input: #202020;
    --shadow: 0 20px 60px rgba(0, 0, 0, .45);
}

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

html,
body {
    width: 100%;
    min-height: 100%;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family:
        Inter,
        Arial,
        Helvetica,
        sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    border: 0;
}

.app {
    min-height: 100vh;
}


/* =========================
   HEADER
========================= */

.topbar {
    height: 72px;
    padding: 0 24px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: rgba(10, 10, 10, .96);
    border-bottom: 1px solid var(--border);

    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 42px;
    height: 42px;

    border-radius: 10px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--accent);

    font-size: 15px;
    font-weight: 900;
}

.brand h1 {
    font-size: 19px;
    line-height: 1;
}

.brand span {
    display: block;
    margin-top: 5px;

    color: var(--muted);
    font-size: 11px;
}

.header-actions {
    display: flex;
    gap: 8px;
}


/* =========================
   BUTTONS
========================= */

.icon-btn,
.control-btn,
.small-btn,
.close-btn {
    color: var(--text);
    background: transparent;
    cursor: pointer;

    transition:
        background .2s,
        transform .2s;
}

.icon-btn {
    width: 42px;
    height: 42px;

    border: 1px solid var(--border);
    border-radius: 9px;

    font-size: 17px;
}

.icon-btn:hover,
.control-btn:hover,
.small-btn:hover {
    background: rgba(255,255,255,.08);
}

button:active {
    transform: scale(.95);
}

.primary-btn {
    border: 0;
    border-radius: 8px;

    padding: 11px 18px;

    color: #fff;
    background: var(--accent);

    font-weight: 700;

    cursor: pointer;

    transition:
        background .2s,
        transform .2s;
}

.primary-btn:hover {
    background: var(--accent-hover);
}

.small-btn {
    padding: 7px 10px;

    border: 1px solid var(--border);
    border-radius: 7px;

    font-size: 12px;
}


/* =========================
   MAIN
========================= */

.main {
    width: min(1500px, 100%);
    margin: auto;

    padding: 22px;

    display: grid;
    grid-template-columns: minmax(0, 1fr) 350px;
    gap: 22px;
}


/* =========================
   PLAYER
========================= */

.player-section {
    min-width: 0;
}

.player-wrapper {
    position: relative;

    width: 100%;
    aspect-ratio: 16 / 9;

    overflow: hidden;

    background: #000;

    border-radius: 12px;

    box-shadow: var(--shadow);
}

video {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: contain;

    background: #000;
}

.audio-screen {
    position: absolute;
    inset: 0;

    display: none;

    flex-direction: column;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle at center,
            #272727,
            #080808 70%
        );

    text-align: center;
}

.audio-disc {
    width: 190px;
    height: 190px;

    margin-bottom: 25px;

    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(
            circle,
            #111 0 12%,
            #333 13% 15%,
            #111 16% 20%,
            #333 21% 23%,
            #111 24% 100%
        );

    box-shadow:
        0 15px 50px rgba(0,0,0,.7);

    animation: rotateDisc 8s linear infinite;
    animation-play-state: paused;
}

.audio-disc span {
    font-size: 45px;
}

.audio-title {
    max-width: 80%;

    font-size: 20px;
    font-weight: 700;
}

.audio-artist {
    margin-top: 7px;

    color: var(--muted);
}

@keyframes rotateDisc {
    to {
        transform: rotate(360deg);
    }
}


/* =========================
   CENTER PLAY
========================= */

.center-play {
    position: absolute;

    left: 50%;
    top: 50%;

    transform: translate(-50%, -50%);

    width: 74px;
    height: 74px;

    border-radius: 50%;

    color: #fff;
    background: rgba(0,0,0,.65);

    border: 1px solid rgba(255,255,255,.15);

    cursor: pointer;

    font-size: 28px;

    backdrop-filter: blur(10px);

    transition:
        opacity .2s,
        transform .2s;
}

.center-play:hover {
    transform:
        translate(-50%, -50%)
        scale(1.08);
}


/* =========================
   LOADING
========================= */

.loading {
    position: absolute;
    inset: 0;

    display: none;
    align-items: center;
    justify-content: center;

    background: rgba(0,0,0,.2);

    pointer-events: none;
}

.spinner {
    width: 42px;
    height: 42px;

    border: 4px solid rgba(255,255,255,.2);
    border-top-color: #fff;

    border-radius: 50%;

    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================
   ERROR
========================= */

.player-error {
    position: absolute;
    inset: 0;

    display: none;

    align-items: center;
    justify-content: center;

    flex-direction: column;

    text-align: center;

    background:
        rgba(0,0,0,.92);

    padding: 25px;
}

.error-icon {
    font-size: 35px;
    margin-bottom: 12px;
}

.player-error h3 {
    margin-bottom: 8px;
}

.player-error p {
    max-width: 450px;

    color: var(--muted);

    margin-bottom: 18px;
}


/* =========================
   CONTROLS
========================= */

.controls {
    position: absolute;

    left: 0;
    right: 0;
    bottom: 0;

    padding: 12px 14px 10px;

    background:
        linear-gradient(
            transparent,
            rgba(0,0,0,.92)
        );

    opacity: 1;

    transition: opacity .25s;
}

.progress-area {
    width: 100%;

    margin-bottom: 7px;
}

#progress {
    width: 100%;
}

.control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 10px;
}

.control-left,
.control-right {
    display: flex;
    align-items: center;

    gap: 4px;
}

.control-btn {
    min-width: 34px;
    height: 34px;

    padding: 0 7px;

    border-radius: 7px;

    font-size: 14px;
}

.volume {
    width: 75px;
}

.time {
    color: #ddd;

    margin-left: 5px;

    font-size: 12px;

    white-space: nowrap;
}

.control-select {
    height: 32px;

    border: 1px solid var(--border);
    border-radius: 7px;

    padding: 0 7px;

    color: #fff;
    background: rgba(0,0,0,.6);

    outline: none;
}


/* RANGE */

input[type="range"] {
    appearance: none;

    height: 4px;

    border-radius: 5px;

    background: #444;

    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;

    width: 13px;
    height: 13px;

    border-radius: 50%;

    background: #fff;
}

input[type="range"]::-moz-range-thumb {
    width: 13px;
    height: 13px;

    border: 0;
    border-radius: 50%;

    background: #fff;
}


/* =========================
   URL BOX
========================= */

.url-box {
    display: flex;

    gap: 9px;

    margin-top: 14px;
}

.url-box input {
    flex: 1;

    min-width: 0;

    height: 44px;

    padding: 0 14px;

    border: 1px solid var(--border);
    border-radius: 8px;

    color: #fff;
    background: var(--input);

    outline: none;
}

.url-box input:focus {
    border-color: #555;
}


/* =========================
   MEDIA INFO
========================= */

.media-info {
    margin-top: 14px;

    padding: 14px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    background: var(--panel);

    border: 1px solid var(--border);
    border-radius: 10px;
}

.media-title {
    min-width: 0;
}

.media-title h2 {
    overflow: hidden;

    font-size: 16px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-title span {
    display: block;

    margin-top: 4px;

    color: var(--muted);

    font-size: 12px;
}


/* =========================
   SIDEBAR
========================= */

.sidebar {
    min-height: 500px;

    overflow: hidden;

    display: flex;
    flex-direction: column;

    background: var(--panel);

    border: 1px solid var(--border);
    border-radius: 12px;
}

.sidebar-header {
    padding: 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 17px;
}

.sidebar-header span {
    display: block;

    margin-top: 3px;

    color: var(--muted);

    font-size: 11px;
}


/* =========================
   DROP ZONE
========================= */

.drop-zone {
    margin: 14px;

    padding: 22px;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;

    border: 1px dashed #444;
    border-radius: 9px;

    color: var(--muted);

    cursor: pointer;

    transition:
        background .2s,
        border .2s;
}

.drop-zone:hover,
.drop-zone.dragging {
    background: rgba(255,255,255,.05);

    border-color: #777;
}

.drop-icon {
    margin-bottom: 8px;

    font-size: 26px;
}

.drop-zone strong {
    color: #fff;

    font-size: 13px;
}

.drop-zone span {
    margin-top: 4px;

    font-size: 11px;
}


/* =========================
   PLAYLIST
========================= */

.playlist {
    flex: 1;

    overflow-y: auto;

    padding: 0 10px 10px;
}

.playlist-item {
    padding: 10px;

    margin-bottom: 5px;

    display: flex;
    align-items: center;

    gap: 10px;

    border-radius: 8px;

    cursor: pointer;

    transition: background .2s;
}

.playlist-item:hover {
    background: rgba(255,255,255,.06);
}

.playlist-item.active {
    background: rgba(229,9,20,.18);
}

.playlist-icon {
    width: 36px;
    height: 36px;

    flex: 0 0 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 7px;

    background: #222;
}

.playlist-details {
    min-width: 0;

    flex: 1;
}

.playlist-name {
    overflow: hidden;

    color: #fff;

    font-size: 12px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-type {
    margin-top: 4px;

    color: var(--muted);

    font-size: 10px;
}

.playlist-delete {
    width: 27px;
    height: 27px;

    color: #aaa;
    background: transparent;

    border-radius: 5px;

    cursor: pointer;
}

.playlist-delete:hover {
    color: #fff;
    background: rgba(255,255,255,.1);
}

.empty-playlist {
    padding: 50px 20px;

    text-align: center;

    color: var(--muted);
}

.empty-playlist div {
    margin-bottom: 10px;

    font-size: 30px;
}

.empty-playlist p {
    color: #ddd;

    font-size: 13px;
}

.empty-playlist span {
    display: block;

    margin-top: 5px;

    font-size: 11px;
}


/* =========================
   MODAL
========================= */

.modal {
    position: fixed;
    inset: 0;

    z-index: 500;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(0,0,0,.75);

    backdrop-filter: blur(8px);
}

.modal-box {
    width: min(550px, 100%);

    max-height: 80vh;

    overflow-y: auto;

    background: var(--panel);

    border: 1px solid var(--border);

    border-radius: 12px;

    box-shadow: var(--shadow);
}

.modal-header {
    padding: 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}

.modal-header h2 {
    font-size: 17px;
}

.close-btn {
    width: 32px;
    height: 32px;

    border-radius: 6px;

    font-size: 24px;
}

.info-content {
    padding: 18px;
}

.info-row {
    padding: 10px 0;

    display: flex;
    justify-content: space-between;

    gap: 15px;

    border-bottom: 1px solid var(--border);
}

.info-label {
    color: var(--muted);
}

.info-value {
    text-align: right;

    word-break: break-word;
}


/* =========================
   TOAST
========================= */

.toast {
    position: fixed;

    left: 50%;
    bottom: 25px;

    z-index: 1000;

    transform:
        translate(-50%, 20px);

    padding: 11px 17px;

    border-radius: 8px;

    color: #fff;
    background: #222;

    border: 1px solid #333;

    opacity: 0;

    pointer-events: none;

    transition:
        opacity .25s,
        transform .25s;
}

.toast.show {
    opacity: 1;

    transform:
        translate(-50%, 0);
}


/* =========================
   LIGHT MODE
========================= */

body.light {
    --bg: #f4f4f4;
    --panel: #fff;
    --panel-2: #f7f7f7;
    --border: #ddd;
    --text: #111;
    --muted: #666;
    --input: #f2f2f2;
}

body.light .topbar {
    background: rgba(255,255,255,.95);
}

body.light .control-btn,
body.light .icon-btn {
    color: #111;
}

body.light .control-select {
    color: #111;
    background: #fff;
}

body.light .playlist-name {
    color: #111;
}

body.light .drop-zone strong {
    color: #111;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1050px) {

    .main {
        grid-template-columns: 1fr;
    }

    .sidebar {
        min-height: 350px;
    }

}


@media (max-width: 700px) {

    .topbar {
        height: 62px;

        padding: 0 13px;
    }

    .brand h1 {
        font-size: 16px;
    }

    .brand span {
        font-size: 9px;
    }

    .brand-logo {
        width: 36px;
        height: 36px;
    }

    .main {
        padding: 10px;

        gap: 12px;
    }

    .player-wrapper {
        border-radius: 8px;
    }

    .control-row {
        flex-wrap: wrap;
    }

    .control-left,
    .control-right {
        gap: 2px;
    }

    .volume {
        width: 50px;
    }

    .time {
        font-size: 10px;
    }

    .control-btn {
        min-width: 30px;

        padding: 0 5px;

        font-size: 12px;
    }

    .control-select {
        font-size: 11px;
    }

    .url-box {
        flex-direction: column;
    }

    .url-box input {
        height: 42px;
    }

    .media-info {
        align-items: flex-start;
    }

    .audio-disc {
        width: 130px;
        height: 130px;
    }

}


@media (max-width: 450px) {

    .center-play {
        width: 58px;
        height: 58px;

        font-size: 22px;
    }

    .control-left .control-btn:nth-child(4),
    .control-left .control-btn:nth-child(5) {
        display: none;
    }

    .volume {
        display: none;
    }

}
