@font-face {
    font-family: "Tahoma";
    src: url("/assets/tahoma.ttf");
}

@font-face {
    font-family: "Tahoma Bold";
    src: url("/assets/tahomabd.ttf");
}

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

body {
    font-family: "Tahoma", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.2;
    color: #333;
    background: #3a6ea5;
    padding: 1em;
    overflow-x: hidden;
    max-width: 100%;
}

.win2k-windowframe {
    border-style: solid;
    border-width: 3px;
    border-image-source: url('/assets/win2k-border.png');
    border-image-slice: 3;
    border-image-repeat: repeat;
    border-image-width: 3px;
    background: #d4d0c8;
    padding: 0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.win2k-listheader-border, .win2k-button-border, .control-btn {
    border-style: solid;
    border-width: 2px 3px 3px 2px;
    border-image-source: url('/assets/win2k-listheader-border.png');
    border-image-slice: 2 3 3 2;
    border-image-repeat: repeat;
    border-image-width: 2px 3px 3px 2px;
    background: #d4d0c8;
    padding: 2px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.win2k-inset {
    border-style: solid;
    border-width: 3px;
    border-image-source: url('/assets/win2k-inset-border.png');
    border-image-slice: 3;
    border-image-repeat: repeat;
    border-image-width: 3px;
    background: white;
    padding: 0;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

h1.win2k-titlebar {
    margin: 0;
    padding: 4px 4px;
    font-family: "Tahoma Bold", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: bold;
    color: white;
    font-size: 12pt;
    background: linear-gradient(to right, #0a246a, #a5c9ef);
}

.container {
    margin: 0 auto;
    margin-bottom: 120px;
    max-width: 100vw;
    box-sizing: border-box;
}

.audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #d4d0c8;
    color: black;
    padding: 15px 20px;
    display: none;
    z-index: 1000;
    border-top: 3px solid;
    border-image-source: url('/assets/win2k-taskbar-top.png');
    border-image-slice: 3 0 0 0;
    border-image-repeat: stretch;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    max-width: 100vw;
    box-sizing: border-box;
}

.audio-player.active {
    display: block;
}

.audio-player audio {
    display: none;
}

.player-content {
    /* max-width: 1200px; */
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap-reverse;
    justify-content: center;
    container-type: inline-size;
}

.player-info {
    flex: 1 1 0;
    min-width: 200px;
    order: 1;
    overflow: hidden;
}

.player-title {
    font-family: "Tahoma Bold", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-artist {
    font-size: 12px;
    color: #555555;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    order: 2;
    flex-shrink: 0;
    flex-grow: 0;
}

.control-btn {
    padding: 2px;
    transition: color 0.2s;
    line-height: 1;
    width: 30px;
    height: 30px;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

.control-btn#prev-btn {
    background-image: url('/assets/win2k-mediabtn-prev.png');
}

.control-btn#prev-btn:disabled {
    background-image: url('/assets/win2k-mediabtn-prev-disabled.png');
}

.control-btn#play-pause-btn.playing {
    background-image: url('/assets/win2k-mediabtn-pause.png');
}

.control-btn#play-pause-btn.paused {
    background-image: url('/assets/win2k-mediabtn-play.png');
}

.control-btn#next-btn {
    background-image: url('/assets/win2k-mediabtn-next.png');
}

.control-btn#next-btn:disabled {
    background-image: url('/assets/win2k-mediabtn-next-disabled.png');
}

.control-btn:active, .win2k-listheader-border:active {
    border-style: solid;
    border-width: 2px 2px 2px 2px;
    border-image-source: url('/assets/win2k-button-pressed.png');
    border-image-slice: 2 2 2 2;
    border-image-repeat: repeat;
    border-image-width: 2px 2px 2px 2px;
    padding-top: 3px;
    padding-left: 3px;
}

.control-btn:disabled {
    color: #838383;
    cursor: not-allowed;
}

.player-progress {
    flex: 0 0 400px;
    display: flex;
    align-items: center;
    gap: 10px;
    order: 3;
    min-width: 0;
}

@container (max-width: 500px) {
    .player-progress {
        flex: 1 1 100%;
    }
}

.time-display {
    font-size: 12px;
    color: #555555;
    min-width: 45px;
    text-align: center;
}

.seek-bar {
    flex: 1;
    height: 10px;
    background: white;

    border-style: solid;
    border-width: 3px;
    border-image-source: url('/assets/win2k-inset-border.png');
    border-image-slice: 3;
    border-image-repeat: repeat;
    border-image-width: 3px;

    cursor: pointer;
}

.seek-bar-fill {
    height: 100%;
    background: #0a246a;
    width: 0%;
    transition: width 0.1s linear;
}

table {
    width: 100%;
    margin: 0;
    table-layout: auto;
}

thead {
    background: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 400;
    color: black;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

th.sortable::after {
    content: "";
    width: 8px;
    height: 7px;
    margin-left: 12px;
    vertical-align: middle;
    display: inline-block;
    line-height: 0;
}

th.sorted-asc::after {
    content: url('/assets/win2k-sort-asc.png');
}

th.sorted-desc::after {
    content: url('/assets/win2k-sort-desc.png');
}

th.play {
    width: 50px;
    text-align: center;
}

th.rank {
    width: 60px;
    text-align: center;
}

th.tags {
    width: 180px;
}

th.date {
    width: 120px;
}

th.length {
    width: 80px;
}

tbody tr {
    border-bottom: 1px solid #e9ecef;
}

tbody tr:hover {
    background: #f8f9fa;
}

tbody tr.now-playing {
    background: #0a246a;
    color: white;
}

td {
    padding: 6px 4px;
}

td.play {
    text-align: center;
}

td.rank {
    font-family: "Tahoma Bold", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-align: center;
    font-weight: bold;
    color: #6c757d;
}

tr.now-playing td.rank {
    color: white;
}

td.tags {
    max-width: 180px;
}

.tag {
    display: inline-block;
    padding: 3px 8px;
    background: #007bff;
    color: white;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 4px;
    margin-bottom: 2px;
    white-space: nowrap;
}

td.title {
    font-weight: 500;
    max-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

td.title {
    color: #2c3e50;
}

tr.now-playing td.title {
    color: white;
}

td.title a {
    color: #007bff;
    text-decoration: none;
    font-size: 12px;
    margin-left: 10px;
}

td.title a:hover {
    text-decoration: underline;
}

td.date {
    white-space: nowrap;
}

td.track-info-mobile {
    display: none;
}

.play-button {
    display: none;
    cursor: pointer;
    padding: 2px;
    line-height: 1;
    width: 30px;
    height: 30px;
    background-repeat: no-repeat;
    background-position: center;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    border-style: solid;
    border-width: 2px 3px 3px 2px;
    border-image-source: url('/assets/win2k-listheader-border.png');
    border-image-slice: 2 3 3 2;
    border-image-repeat: repeat;
    border-image-width: 2px 3px 3px 2px;
    background-color: #d4d0c8;
    background-image: url('/assets/win2k-mediabtn-play.png');
    vertical-align: middle;
}

.play-button.playing {
    background-image: url('/assets/win2k-mediabtn-pause.png');
}

.play-button:active {
    border-style: solid;
    border-width: 2px 2px 2px 2px;
    border-image-source: url('/assets/win2k-button-pressed.png');
    border-image-slice: 2 2 2 2;
    border-image-repeat: repeat;
    border-image-width: 2px 2px 2px 2px;
    padding-top: 3px;
    padding-left: 3px;
}

.js-enabled .play-button {
    display: inline-flex;
}

/* Compact track list layout for narrow screens */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .win2k-windowframe {
        border: none;
    }

    .container {
        padding: 0;
    }

    table {
        table-layout: fixed;
    }

    thead {
        display: none;
    }

    tbody tr {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 4px;
    }

    td.play {
        padding: 0;
    }

    td.rank {
        padding: 0;
        font-size: 20px;
    }

    td.title {
        display: none;
    }

    td.title a {
        display: none;
    }

    td.date {
        display: none;
    }

    td.tags {
        display: none;
    }

    td.track-info-mobile {
        display: grid;
        grid-template-rows: 1fr auto 1fr;
        flex: 1 1 0;
        min-width: 0;
        padding: 0;
        overflow: hidden;
        gap: 2px;
    }

    .track-title-mobile {
        font-size: 20px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
        align-self: end;
    }

    .track-meta-mobile {
        font-size: 10px;
        color: #6c757d;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    .tag {
        display: inline-block;
        padding: 2px 4px;
        border-radius: 3px;
        margin-bottom: 0;
        white-space: nowrap;
        font-size: 10px;
    }

    tr.now-playing .track-meta-mobile {
        color: #a5c9ef;
    }

    td.length {
        padding: 0;
        text-align: right;
        font-size: 12px;
    }

    .play-button {
        width: 48px;
        height: 48px;
        padding: 2px;
    }
}
