/* TangoRadio — Clean Player Styles */

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #1a1a1a;
    --bg-card: #242424;
    --text-primary: #e0e0e0;
    --text-secondary: #888;
    --accent: #c0392b;
    --border: #333;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ── App layout: flex column, player at bottom of page flow ── */
.app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px;
}

/* Content area flexes to fill space, scrollable */
.content {
    flex: 1;
    padding: 16px 0;
}

/* ── Player — sticky at bottom, inside page flow ──
   Browser toolbars (Via, etc.) cannot overlap because player
   is part of the document layout, not a fixed overlay.       */
.player {
    position: sticky;
    bottom: 0;
    z-index: 50;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    padding: 22px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    text-align: center;
    margin: 0 -16px;
}

.player-station {
    position: absolute;
    top: 6px;
    left: 16px;
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.55;
    max-width: 35%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
    text-align: left;
}

.player-info {
    min-height: 40px;
    margin-bottom: 8px;
}

.player-track {
    font-size: 16px;
    font-weight: 600;
    min-height: 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-artist {
    font-size: 13px;
    color: var(--text-secondary);
    min-height: 18px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.player-year {
    font-size: 12px;
    color: var(--text-secondary);
    min-height: 16px;
}

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.btn {
    background: #2a2a2a;
    border: 1px solid #444;
    color: var(--text-primary);
    cursor: pointer;
    border-radius: 10px;
    padding: 0;
    display: grid;
    place-items: center;
    -webkit-user-select: none;
    user-select: none;
    transition: all 0.15s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn:hover {
    background: #333;
    border-color: #555;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn:active {
    transform: scale(0.94);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.btn-icon {
    width: 44px;
    height: 44px;
}

.btn-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

.btn-play {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-play svg {
    width: 28px;
    height: 28px;
    display: block;
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3));
}

.btn-play:hover {
    background: linear-gradient(135deg, #f05a4a, #d14233);
    box-shadow: 0 5px 16px rgba(192, 57, 43, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-play:active {
    transform: scale(0.92);
    box-shadow: 0 2px 6px rgba(192, 57, 43, 0.4);
}

.volume-control {
    display: flex;
    align-items: center;
}

.volume-slider {
    width: 80px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

/* Station List */
.stations {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.station-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.station-card:hover {
    border-color: var(--accent);
    background: #2a2a2a;
}

.station-card.active {
    border-color: var(--accent);
    background: #2a1a18;
}

.station-info {
    flex: 1;
    min-width: 0;
}

.station-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 2px;
}

.station-desc {
    font-size: 13px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.station-now {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.station-play-icon {
    font-size: 20px;
    margin-left: 12px;
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 100;
}

.toast.visible {
    opacity: 1;
}

/* Responsive */
@media (max-width: 400px) {
    .player-track {
        font-size: 17px;
    }
    .volume-slider {
        width: 60px;
    }
}