@font-face {
    font-family: 'DepartureMono';
    src: url('DepartureMono-Regular.otf') format('opentype');
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'DepartureMono', monospace;
    background-image: url('background.png');
    background-color: #000;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.player-container {
    width: 100%;
    max-width: 400px;
    height: 100vh;
    max-height: 800px;
    background: #fff;
    border: 1.5px solid #000;
    border-radius: 2px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.background-slideshow {
    position: fixed;
    inset: 0;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
}

.background-layer {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    will-change: opacity;
}

.background-layer.active {
    opacity: 1;
}

.player-header {
    padding: 15px;
    border-bottom: 1.5px solid #000;
    text-align: center;
    flex-shrink: 0;
}

.now-playing {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background: #fff;
}

.playback-status {
    margin-top: 4px;
    font-size: 0.85em;
    color: #555;
    min-height: 1em;
}

.current-meta {
    margin-top: 4px;
    font-size: 0.75em;
    color: #555;
    opacity: 0.8;
    text-align: center;
    min-height: 0.9em;
}

.controls {
    padding: 15px;
    border-bottom: 1.5px solid #000;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
    flex-shrink: 0;
}

.categories {
    flex: 1;
    overflow-y: auto;
    display: block;
}

.categories::-webkit-scrollbar {
    width: 6px;
}

.categories::-webkit-scrollbar-track {
    background: #fff;
}

.categories::-webkit-scrollbar-thumb {
    background-color: #000;
    border: 1px solid #fff;
}

.station-list {
    flex: 1;
    overflow-y: auto;
    list-style: none;
    display: none;
    scrollbar-width: thin;
    scrollbar-color: #000 #fff;
}

.station-list::-webkit-scrollbar {
    width: 6px;
}

.station-list::-webkit-scrollbar-track {
    background: #fff;
}

.station-list::-webkit-scrollbar-thumb {
    background-color: #000;
    border: 1px solid #fff;
}

.station, .category {
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
    transition: background-color 0.2s;
    font-family: 'DepartureMono', monospace;
    gap: 10px;
}

.station:hover, .category:hover {
    background-color: #f5f5f5;
}

.station:focus-visible {
    outline: 2px solid #000;
    outline-offset: -2px;
}

.category:focus-visible {
    outline: 2px solid #000;
    outline-offset: -2px;
}

.station.playing {
    background-color: #f0f0f0;
}

.station-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.station-name {
    font-size: 0.95em;
}

.station-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.station-info {
    font-size: 0.8em;
    opacity: 0.7;
}

.heart {
    cursor: pointer;
    user-select: none;
    opacity: 0.5;
    transition: opacity 0.2s;
    background: none;
    border: none;
    font: inherit;
    padding: 2px;
    line-height: 1;
}

.heart.active {
    opacity: 1;
}

.heart:focus-visible {
    outline: 1px solid #000;
    outline-offset: 2px;
}

.back-btn {
    padding: 15px;
    cursor: pointer;
    border-bottom: 1.5px solid #000;
    display: none;
}

.back-btn:hover {
    background-color: #f5f5f5;
}

.back-btn:focus-visible {
    outline: 2px solid #000;
    outline-offset: -2px;
}

.control-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    padding: 5px;
    transition: opacity 0.2s;
}

.control-btn:hover {
    opacity: 0.7;
}

.control-btn#play {
    font-size: 28px;
}

.logo {
    height: 50px;
    width: auto;
    margin-bottom: 10px;
}

#current-track {
    font-size: 1em;
    text-align: center;
    font-family: 'DepartureMono', monospace;
}

.search-container {
    padding: 15px;
    border-bottom: 1.5px solid #000;
}

.search-input {
    width: 100%;
    padding: 8px;
    font-family: 'DepartureMono', monospace;
    border: 1.5px solid #000;
    border-radius: 2px;
    outline: none;
}

.search-input:focus {
    border-color: #000;
}

.volume-control {
    padding: 10px 15px 15px;
    border-bottom: 1.5px solid #000;
}

.volume-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: #d3d3d3;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #000;
    cursor: pointer;
    border: none;
}

.notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 15px 20px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 1000;
    display: none;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes loadingDots {
    0% { content: "Connecting"; }
    33% { content: "Connecting."; }
    66% { content: "Connecting.."; }
    100% { content: "Connecting..."; }
}

.connecting::after {
    content: "Connecting";
    animation: loadingDots 1.5s infinite;
}

@media (max-height: 600px) {
    .player-container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .player-container {
        width: 100%;
        height: 100vh;
        max-height: none;
        border: none;
        border-radius: 0;
    }
        
    body {
        padding: 0;
    }
}

.attribution {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background-color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: 'DepartureMono';
    font-size: 12px;
    z-index: 1000;
}

.credit {
    position: fixed;
    bottom: 10px;
    right: 10px;
    background-color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-family: 'DepartureMono';
    font-size: 12px;
    z-index: 1000;
}

.credit a {
    color: black;
    text-decoration: none;
}

.credit a:hover {
    opacity: 0.7;
}

@media (max-width: 480px) {
    .credit {
        background: none;
        padding: 5px;
    }
}

