/* BDBOYS RADIO - Player Styles */
:root {
    --bg: #0f0f13;
    --bg2: #1a1a24;
    --card: #22222e;
    --text: #f0f0f5;
    --text2: #a0a0b0;
    --accent: #ff3b5c;
    --accent2: #ff6b81;
    --live: #00e676;
    --border: #2e2e3a;
    --radius: 16px;
    --shadow: 0 8px 32px rgba(0,0,0,0.4);
}

[data-theme="light"] {
    --bg: #f4f5f9;
    --bg2: #ffffff;
    --card: #ffffff;
    --text: #1a1a2e;
    --text2: #5a5a70;
    --accent: #e11d48;
    --accent2: #fb7185;
    --live: #059669;
    --border: #e2e2ea;
    --shadow: 0 8px 32px rgba(0,0,0,0.08);
}

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

body {
    font-family: 'Inter', 'Noto Sans Bengali', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
}

.app {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px;
    padding-bottom: 40px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 20px;
}

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

.logo-icon {
    font-size: 32px;
    background: var(--card);
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    box-shadow: var(--shadow);
}

.radio-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 0.75rem;
    color: var(--text2);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-badge {
    background: var(--live);
    color: #000;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: pulse-bg 1.5s infinite;
}

.pulse {
    width: 8px;
    height: 8px;
    background: #000;
    border-radius: 50%;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.listeners {
    background: var(--card);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text2);
}

.theme-btn {
    background: var(--card);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.theme-btn:hover { transform: scale(1.1); }

/* Player Section */
.player-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: var(--shadow);
    text-align: center;
    margin-bottom: 20px;
}

.cover-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 0 auto 20px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0,0,0,0.35);
}

.cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 16px;
    opacity: 0;
    transition: opacity 0.3s;
}

.cover-wrap.playing .cover-overlay { opacity: 1; }
.cover-wrap.playing .cover { transform: scale(1.03); }

/* Equalizer */
.equalizer {
    display: flex;
    gap: 4px;
    height: 24px;
    align-items: flex-end;
}

.equalizer span {
    width: 4px;
    background: var(--accent);
    border-radius: 2px;
    animation: eq 0.8s ease-in-out infinite alternate;
}

.equalizer span:nth-child(1) { height: 40%; animation-delay: 0s; }
.equalizer span:nth-child(2) { height: 70%; animation-delay: 0.1s; }
.equalizer span:nth-child(3) { height: 100%; animation-delay: 0.2s; }
.equalizer span:nth-child(4) { height: 60%; animation-delay: 0.3s; }
.equalizer span:nth-child(5) { height: 30%; animation-delay: 0.4s; }

@keyframes eq {
    from { height: 20%; }
    to { height: 100%; }
}

.track-info { margin-bottom: 18px; }

.track-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    color: var(--text2);
    font-size: 0.9rem;
}

.track-type {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.7rem;
    padding: 2px 10px;
    border-radius: 10px;
    background: var(--bg);
    color: var(--text2);
}

.track-type.ad {
    background: var(--accent);
    color: #fff;
}

.track-type.live {
    background: var(--live);
    color: #000;
}

/* Progress */
.progress-area {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.time {
    font-size: 0.75rem;
    color: var(--text2);
    min-width: 36px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s linear;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 18px;
}

.ctrl-btn {
    background: var(--bg);
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text);
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: var(--border);
    transform: scale(1.05);
}

.play-btn {
    width: 64px;
    height: 64px;
    font-size: 1.5rem;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    box-shadow: 0 6px 20px rgba(255, 59, 92, 0.4);
}

.play-btn:hover {
    transform: scale(1.08);
    background: linear-gradient(135deg, var(--accent2), var(--accent));
}

/* Volume */
.volume-area {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.volume-area input[type="range"] {
    width: 140px;
    accent-color: var(--accent);
}

/* Request Section */
.request-section, .history-section {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}

.request-section h3, .history-section h3 {
    font-size: 1rem;
    margin-bottom: 14px;
}

.request-section input,
.request-section textarea {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    color: var(--text);
    font-family: inherit;
    font-size: 0.9rem;
}

.request-section input:focus,
.request-section textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.request-section button {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #fff;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

.request-section button:hover { opacity: 0.9; }
.request-section button:disabled { opacity: 0.5; cursor: not-allowed; }

.request-msg {
    margin-top: 10px;
    font-size: 0.85rem;
    text-align: center;
}

.request-msg.success { color: var(--live); }
.request-msg.error { color: var(--accent); }

/* History */
.history-list {
    list-style: none;
    max-height: 220px;
    overflow-y: auto;
}

.history-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

.history-list li:last-child { border-bottom: none; }

.history-list .hist-cover {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--bg);
}

.history-list .hist-info {
    flex: 1;
    min-width: 0;
}

.history-list .hist-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-list .hist-artist {
    font-size: 0.8rem;
    color: var(--text2);
}

.history-list .empty {
    color: var(--text2);
    text-align: center;
    padding: 20px;
}

.footer {
    text-align: center;
    padding: 16px;
    color: var(--text2);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 400px) {
    .cover-wrap { width: 180px; height: 180px; }
    .track-title { font-size: 1.05rem; }
}

.mute-btn {
    background: none;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--text);
    padding: 4px;
}
.live-badge { display: flex !important; }

.yt-host {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 2;
}
.yt-host iframe {
    width: 100%;
    height: 100%;
}
.cover-wrap.has-yt .cover { opacity: 0; }
.share-box {
    margin-top: 18px;
    text-align: left;
}
.share-box label {
    font-size: 0.8rem;
    color: var(--text2);
    display: block;
    margin-bottom: 6px;
}
.share-row {
    display: flex;
    gap: 8px;
}
.share-row input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 0.8rem;
}
.btn-copy {
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.share-hint {
    font-size: 0.75rem;
    color: var(--text2);
    margin-top: 6px;
}
