/* RadioFreeBird - Dark Theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0f;
    --surface: #14141f;
    --surface-hover: #1e1e2e;
    --border: #2a2a3a;
    --text: #e0e0e0;
    --text-dim: #888;
    --accent: #e74c3c;
    --accent-hover: #c0392b;
    --success: #2ecc71;
}

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

.view { min-height: 100vh; min-height: 100dvh; }

/* Login */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 2rem;
}

.logo {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: -0.5px;
}

.tagline {
    color: var(--text-dim);
    margin: 0.25rem 0 2rem;
    font-size: 0.9rem;
}

#login-form {
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

input[type="text"], input[type="password"] {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

input:focus { border-color: var(--accent); }

button[type="submit"], .control-btn {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

button[type="submit"]:hover, .control-btn:hover { background: var(--accent-hover); }
button[type="submit"]:disabled { opacity: 0.5; cursor: not-allowed; }

.error {
    color: var(--accent);
    font-size: 0.85rem;
    text-align: center;
}

/* Header */
header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
}

header .logo { font-size: 1.4rem; }

.icon-btn {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}

.icon-btn:hover { color: var(--text); background: var(--surface); }

/* Channel Grid */
.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.channel-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.channel-card:hover { border-color: var(--accent); background: var(--surface-hover); }
.channel-card.active { border-color: var(--accent); background: var(--surface-hover); }

.channel-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.channel-card p {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.4;
}

.channel-card.active h2::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Now Playing Bar */
.now-playing {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 10;
}

.now-playing-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.np-channel { font-weight: 600; font-size: 0.95rem; }
.np-status { color: var(--text-dim); font-size: 0.8rem; }

.player-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.control-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    padding: 0;
}

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

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

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

/* Toast */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.5rem 1.25rem;
    border-radius: 8px;
    font-size: 0.85rem;
    z-index: 20;
    animation: fadeInOut 2s ease forwards;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateX(-50%) translateY(10px); }
    15%, 70% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* Mobile */
@media (max-width: 480px) {
    .channel-grid { grid-template-columns: 1fr; padding: 1rem; }
    .volume-slider { display: none; }
    header { padding: 0.75rem 1rem; }
    .now-playing { padding: 0.75rem 1rem; }
}
