/* Podcast Player Pro — Frontend Player */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@300;400;500;600&family=DM+Mono:wght@400;500&display=swap');

.ppp-player-root {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --accent:      #2ecc8e;
    --accent-dark: #27ae74;
    --text:        #1a2332;
    --muted:       #7a8fa6;
    --border:      #e2eaf2;
    --card:        #ffffff;
    --bg:          #f0f4f8;
    --radius:      16px;
    --shadow:      0 4px 24px rgba(30,50,80,0.10);
    --shadow-sm:   0 2px 8px  rgba(30,50,80,0.07);
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 0 0 24px;
}

/* ─── Loading ─── */
.ppp-loading {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; padding: 40px; color: var(--muted); font-size: 14px;
}
.ppp-spinner {
    width: 20px; height: 20px; border: 2px solid var(--border);
    border-top-color: var(--accent); border-radius: 50%;
    animation: ppp-spin .7s linear infinite;
}
@keyframes ppp-spin { to { transform: rotate(360deg); } }

/* ─── Shared buttons ─── */
.ppp-ctrl-btn {
    background: none; border: none; cursor: pointer; color: var(--muted);
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; width: 32px; height: 32px;
    transition: color .2s, background .2s; flex-shrink: 0;
}
.ppp-ctrl-btn:hover { color: var(--text); background: var(--border); }

.ppp-play-btn {
    border-radius: 50%; background: var(--accent); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; box-shadow: 0 4px 12px rgba(46,204,142,0.4);
    transition: background .2s, transform .15s; flex-shrink: 0;
}
.ppp-play-btn:hover  { background: var(--accent-dark); transform: scale(1.07); }
.ppp-play-btn:active { transform: scale(0.95); }

.ppp-speed-btn {
    background: var(--border); border: none; cursor: pointer;
    font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500;
    color: var(--text); border-radius: 6px; padding: 4px 8px;
    transition: background .2s; white-space: nowrap;
}
.ppp-speed-btn:hover { background: var(--accent); color: #fff; }

/* ─── Progress ─── */
.ppp-progress-track {
    width: 100%; height: 4px; background: var(--border);
    border-radius: 4px; cursor: pointer; position: relative;
}
.ppp-progress-fill {
    height: 100%; background: var(--accent); border-radius: 4px;
    width: 0%; transition: width .1s linear; position: relative;
}
.ppp-progress-fill::after {
    content: ''; position: absolute; right: -5px; top: -4px;
    width: 12px; height: 12px; background: var(--accent); border-radius: 50%;
    box-shadow: 0 0 0 3px #fff, 0 0 0 4px rgba(46,204,142,0.3);
    opacity: 0; transition: opacity .2s;
}
.ppp-progress-track:hover .ppp-progress-fill::after { opacity: 1; }

/* ─── Search ─── */
.ppp-search-box {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 10px; padding: 9px 14px; transition: border-color .2s;
}
.ppp-search-box:focus-within { border-color: var(--accent); }
.ppp-search-box svg { color: var(--muted); flex-shrink: 0; }
.ppp-search-box input {
    background: none; border: none; outline: none; flex: 1;
    font-family: 'DM Sans', sans-serif; font-size: 13px; color: var(--text);
}
.ppp-search-box input::placeholder { color: var(--muted); }

/* ─── Filter row ─── */
.ppp-filter-row {
    display: flex; gap: 8px; flex-wrap: wrap; padding: 0 20px 12px;
}
.ppp-filter-row select {
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 8px; padding: 6px 10px; font-size: 12px;
    font-family: 'DM Sans', sans-serif; color: var(--text); cursor: pointer;
    outline: none; transition: border-color .2s;
}
.ppp-filter-row select:focus { border-color: var(--accent); }

/* ─── Episode list ─── */
.ppp-ep-list { overflow-y: auto; }
.ppp-ep-list::-webkit-scrollbar { width: 4px; }
.ppp-ep-list::-webkit-scrollbar-track { background: transparent; }
.ppp-ep-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.ppp-ep-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: 10px; cursor: pointer; transition: background .18s;
}
.ppp-ep-item:hover { background: var(--bg); }
.ppp-ep-item.active { background: rgba(46,204,142,0.08); }
.ppp-ep-item.active .ppp-ep-title { color: var(--accent); font-weight: 600; }

.ppp-ep-thumb {
    width: 44px; height: 44px; border-radius: 8px; object-fit: cover;
    background: var(--border); flex-shrink: 0; box-shadow: var(--shadow-sm);
}
.ppp-ep-play-btn {
    width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
    background: var(--border); border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); transition: background .2s, color .2s;
}
.ppp-ep-play-btn:hover,
.ppp-ep-item.active .ppp-ep-play-btn { background: var(--accent); color: #fff; }

.ppp-ep-meta { flex: 1; min-width: 0; }
.ppp-ep-title {
    font-size: 13px; font-weight: 500; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3;
}
.ppp-ep-subtitle {
    display: flex; gap: 8px; align-items: center; margin-top: 2px; flex-wrap: wrap;
}
.ppp-ep-dur   { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); }
.ppp-ep-date  { font-size: 11px; color: var(--muted); }
.ppp-ep-badge {
    font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 20px;
    background: rgba(46,204,142,0.12); color: var(--accent); text-transform: uppercase; letter-spacing:.04em;
}
.ppp-ep-explicit {
    font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 4px;
    background: #fee2e2; color: #dc2626; text-transform: uppercase;
}
.ppp-ep-divider { height: 1px; background: var(--border); margin: 2px 12px; }

/* ─── Pagination ─── */
.ppp-pagination {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px 14px; gap: 8px;
}
.ppp-pg-btn {
    display: flex; align-items: center; gap: 5px;
    background: var(--bg); border: 1.5px solid var(--border);
    border-radius: 8px; padding: 6px 12px; cursor: pointer;
    font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
    color: var(--muted); transition: all .2s;
}
.ppp-pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); background: rgba(46,204,142,0.06); }
.ppp-pg-btn:disabled { opacity: .35; cursor: not-allowed; }
.ppp-pg-info { font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); text-align: center; flex: 1; }
.ppp-pg-info strong { color: var(--text); }
.ppp-pg-dots { display: flex; align-items: center; gap: 5px; }
.ppp-pg-dot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--border);
    border: none; cursor: pointer; padding: 0; transition: background .2s, transform .2s;
}
.ppp-pg-dot.active { background: var(--accent); transform: scale(1.3); }
.ppp-pg-dot:hover:not(.active) { background: var(--muted); }

/* ─── Playing indicator ─── */
.ppp-playing-ind { display: flex; align-items: flex-end; gap: 2px; height: 16px; }
.ppp-playing-ind span {
    display: block; width: 3px; background: var(--accent); border-radius: 2px;
    animation: ppp-bounce .8s ease-in-out infinite;
}
.ppp-playing-ind span:nth-child(1) { height: 6px;  animation-delay: 0s; }
.ppp-playing-ind span:nth-child(2) { height: 12px; animation-delay: .15s; }
.ppp-playing-ind span:nth-child(3) { height: 8px;  animation-delay: .3s; }
@keyframes ppp-bounce {
    0%,100% { transform: scaleY(.5); opacity: .6; }
    50%      { transform: scaleY(1.2); opacity: 1; }
}

/* ─── Footer ─── */
.ppp-player-footer {
    padding: 11px 20px; border-top: 1px solid var(--border);
    display: flex; align-items: center; gap: 8px;
}
.ppp-player-footer svg { color: var(--accent); }
.ppp-player-footer span { font-size: 11px; color: var(--muted); }

/* ════════════════════════════════
   DESKTOP > 1024px — single panel
════════════════════════════════ */
.ppp-desktop {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    width: 100%; max-width: 600px; display: flex; flex-direction: column; overflow: hidden;
}
.ppp-dp-header {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
}
.ppp-dp-art {
    width: 64px; height: 64px; border-radius: 10px; object-fit: cover;
    flex-shrink: 0; background: var(--border); box-shadow: var(--shadow-sm); transition: box-shadow .3s;
}
.ppp-dp-art.playing { box-shadow: 0 0 0 3px var(--accent), 0 4px 16px rgba(46,204,142,0.25); }
.ppp-dp-info { flex: 1; min-width: 0; }
.ppp-dp-title { font-size: 14px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.ppp-dp-show  { font-size: 12px; color: var(--muted); }
.ppp-dp-controls { display: flex; align-items: center; gap: 6px; padding: 12px 20px 6px; }
.ppp-dp-controls .ppp-play-btn { width: 44px; height: 44px; }
.ppp-dp-progress { padding: 4px 20px 14px; display: flex; flex-direction: column; gap: 5px; }
.ppp-dp-times { display: flex; justify-content: space-between; font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); }
.ppp-dp-search-wrap { padding: 0 20px 12px; }
.ppp-dp-ep-list { padding: 0 8px 4px; }

/* ════════════════════════════════
   TABLET 641px–1024px — side by side
════════════════════════════════ */
.ppp-tablet { display: none; gap: 18px; width: 100%; max-width: 800px; align-items: flex-start; }

.ppp-tp-card {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    width: 220px; min-width: 220px; display: flex; flex-direction: column;
    align-items: center; padding: 24px 18px 20px; gap: 16px; position: sticky; top: 24px;
}
.ppp-tp-art { width: 170px; height: 170px; border-radius: 14px; object-fit: cover; background: var(--border); box-shadow: 0 6px 20px rgba(30,50,80,0.13); transition: box-shadow .3s; }
.ppp-tp-art.playing { box-shadow: 0 0 0 4px var(--accent), 0 8px 24px rgba(46,204,142,0.25); }
.ppp-tp-show  { font-size: 10px; font-weight: 600; color: var(--accent); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 5px; text-align: center; }
.ppp-tp-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; text-align: center; }
.ppp-tp-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.ppp-tp-controls .ppp-play-btn { width: 46px; height: 46px; }
.ppp-tp-progress { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.ppp-tp-times { display: flex; justify-content: space-between; font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); }

.ppp-tp-panel {
    background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
    flex: 1; min-width: 0; overflow: hidden; display: flex; flex-direction: column;
}
.ppp-tp-search-wrap { padding: 16px 16px 10px; }
.ppp-tp-ep-list { padding: 0 8px 4px; }

/* ════════════════════════════════
   MOBILE ≤ 640px — compact card
════════════════════════════════ */
.ppp-mobile {
    display: none; flex-direction: column; background: var(--card);
    border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 360px; overflow: hidden;
}
.ppp-mp-art-wrap { position: relative; width: 100%; padding-top: 70%; background: var(--border); overflow: hidden; }
.ppp-mp-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ppp-mp-body { padding: 18px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.ppp-mp-show  { font-size: 11px; font-weight: 500; color: var(--accent); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px; }
.ppp-mp-title { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.35; }
.ppp-mp-controls { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ppp-mp-controls .ppp-ctrl-btn { width: 34px; height: 34px; }
.ppp-mp-controls .ppp-play-btn { width: 50px; height: 50px; }
.ppp-mp-progress { display: flex; flex-direction: column; gap: 6px; }
.ppp-mp-times { display: flex; justify-content: space-between; font-family: 'DM Mono', monospace; font-size: 11px; color: var(--muted); }
.ppp-mp-ep-list { padding: 0 6px 4px; }

/* ─── Responsive switches ─── */
@media (min-width: 641px) and (max-width: 1024px) {
    .ppp-desktop { display: none; }
    .ppp-tablet  { display: flex; }
    .ppp-mobile  { display: none; }
}
@media (max-width: 640px) {
    .ppp-player-root { padding: 0 8px 16px; }
    .ppp-desktop { display: none; }
    .ppp-tablet  { display: none; }
    .ppp-mobile  { display: flex; }
}
