/* ========== RADIO MAD FLIX -- AJAX PLAYER CSS v1.0 ========== */

#rmf-player {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: #1a1a1a;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
    transition: transform 0.3s;
    padding-bottom: env(safe-area-inset-bottom);
}
#rmf-player.rmf-player-idle { opacity: 0.92; }

/* Progress bar */
#rmf-progress-bar {
    position: absolute; top: 0; left: 0; right: 0;
    height: 1px; background: transparent;
}
#rmf-progress-fill {
    height: 100%; width: 0%;
    background: #c2185b;
    transition: width 0.3s linear;
}

/* Pop-out — NIE UŻYWAMY (aplikacja zamiast popupu w osobnym oknie) */
#rmf-popout {
    display: none !important;
}

/* Top bar */
#rmf-topbar {
    display: flex; align-items: center;
    padding: 4px 10px 2px 10px;
    font-size: 13px; color: #ccc;
    background: #111;
}
#rmf-track-title {
    flex: 1; white-space: nowrap; overflow: hidden;
    text-overflow: ellipsis; font-weight: 500;
}
#rmf-demo-badge {
    background: #c2185b; color: #fff;
    font-size: 10px; font-weight: 700;
    padding: 1px 6px; border-radius: 3px;
    margin-left: 6px; white-space: nowrap;
    letter-spacing: 0.5px;
}

/* Center */
#rmf-center {
    display: flex; align-items: center;
    padding: 4px 8px; gap: 8px;
    min-height: 52px;
}
#rmf-thumb-wrap {
    width: 40px; height: 40px; flex-shrink: 0;
    border-radius: 4px; overflow: hidden;
    background: #2a2a2a; position: relative;
}
#rmf-thumb {
    width: 100%; height: 100%; object-fit: cover;
    display: none;
}
#rmf-thumb-placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #666;
}

/* Controls */
#rmf-controls {
    display: flex; align-items: center; flex: 1;
    justify-content: flex-start; gap: 6px;
}
/* Volume */
#rmf-volume-wrap {
    display: flex; align-items: center; gap: 4px;
}
#rmf-volume {
    width: 80px; height: 4px;
    -webkit-appearance: none; appearance: none;
    background: #333; border-radius: 2px; outline: none;
    cursor: pointer;
}
#rmf-volume::-webkit-slider-thumb {
    -webkit-appearance: none; width: 12px; height: 12px;
    border-radius: 50%; background: #c2185b; cursor: pointer;
}

/* Navbar */
#rmf-navbar {
    display: flex; background: #000;
    border-top: 1px solid #222;
}
.rmf-nav-btn {
    flex: 1; background: none; border: none;
    color: #888; cursor: pointer;
    padding: 6px 0; display: flex;
    flex-direction: column; align-items: center;
    font-size: 11px; transition: color 0.1s;
    border-bottom: 2px solid transparent;
}
.rmf-nav-btn:hover { color: #aaa; }
.rmf-nav-btn.active {
    color: #c2185b; border-bottom-color: #c2185b;
}
.rmf-nav-icon { font-size: 16px; line-height: 1; }
.rmf-nav-label { margin-top: 1px; }

/* Panels */
#rmf-panels { display: none; }
#rmf-panels.open { display: block; }
.rmf-panel { display: none; }
.rmf-panel.open { display: block; }
.rmf-panel-header {
    background: #111; padding: 6px 10px;
    font-size: 12px; font-weight: 600;
    color: #c2185b; border-bottom: 1px solid #222;
}
.rmf-panel-content {
    max-height: 300px; overflow-y: auto;
    padding: 8px; background: #0a0a0a;
    font-size: 12px; color: #ccc;
}

/* Desktop overrides */
@media (min-width: 769px) {
    #rmf-volume { width: 100px; }
}
@media (max-width: 768px) {
    #rmf-volume { width: 60px; }
    #rmf-center { padding: 4px; gap: 4px; }
    #rmf-thumb-wrap { width: 36px; height: 36px; }
    #rmf-controls { gap: 2px; }
    #rmf-play, #rmf-prev, #rmf-next { font-size: 18px; padding: 4px 6px; }
    #rmf-loop, #rmf-random { font-size: 15px !important; padding: 3px 5px !important; }
    #rmf-premium-toggle { font-size: 14px; padding: 2px 4px; }
}
/* Portrait mobile (iOS/Android) — bez paska głośności (telefon steruje głośnością) */
@media (max-width: 768px) and (orientation: portrait) {
    #rmf-volume-wrap { display: none !important; }
}

/* Popup window */
body.rmf-popup { margin: 0; padding: 0; overflow: hidden; background: #1a1a1a; }
body.rmf-popup #rmf-player {
    position: static; bottom: auto;
    padding-bottom: 0; height: 100vh;
    display: flex; flex-direction: column;
}

/* Logo */
#rmf-logo { font-size: 11px; font-weight: 700; letter-spacing: 0.5px; color: #e91e63; white-space: nowrap; margin-right: 8px; flex-shrink: 0; }

/* Premium badge */
#rmf-premium-badge { background: linear-gradient(135deg,#ffd700,#b8860b); color: #000; font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 3px; margin-left: 6px; white-space: nowrap; letter-spacing: 0.5px; }
#rmf-demo-badge { background: #c2185b; color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 3px; margin-left: 6px; white-space: nowrap; letter-spacing: 0.5px; }

/* Premium toggle button */
#rmf-premium-toggle { background: none; border: 1px solid #555; color: #aaa; font-size: 16px; cursor: pointer; padding: 2px 6px; border-radius: 4px; margin-left: 4px; transition: all 0.15s; flex-shrink: 0; }
#rmf-premium-toggle:hover { border-color: #c2185b; color: #c2185b; background: rgba(194,24,91,0.1); }

/* Volume icon */
#rmf-volume-icon { cursor: pointer; font-size: 16px; user-select: none; margin-right: 4px; }
#rmf-volume-icon:hover { opacity: 0.8; }

/* Transport buttons */
#rmf-play, #rmf-prev, #rmf-next { background: none; border: none; color: #ccc; font-size: 20px; cursor: pointer; padding: 6px 10px; line-height: 1; transition: color 0.1s; }
#rmf-play:hover, #rmf-prev:hover, #rmf-next:hover { color: #e91e63; }

/* Panel open */
#rmf-player.panel-open { height: auto !important; }
#rmf-player.panel-open #rmf-panels { display: block; max-height: 250px; overflow-y: auto; background: #141414; border-top: 1px solid #222; }

/* Demo limit */
#rmf-demo-limit { position: absolute; bottom: 100%; left: 0; right: 0; background: rgba(194,24,91,0.92); padding: 5px 12px; text-align: center; font-size: 11px; font-weight: 600; z-index: 3; display: none; }
#rmf-demo-limit a { color: #fff; text-decoration: underline; }

/* Stations Grid */
.rmf-scroll-viewport { max-height: 250px; overflow-y: auto; overflow-x: hidden; width: 100%; box-sizing: border-box; }
.rmf-stations-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(90px,1fr)); gap: 10px; padding: 10px; box-sizing: border-box; }
.rmf-station-card { position: relative; cursor: pointer; text-align: center; background: rgba(255,255,255,0.04); padding: 8px; border-radius: 6px; box-sizing: border-box; user-select: none; transition: background 0.15s; }
.rmf-station-card:hover { background: rgba(255,255,255,0.08); }
.rmf-station-cover { position: relative; width: 100%; aspect-ratio: 1/1; overflow: hidden; border-radius: 4px; background: #222; }
.rmf-station-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rmf-station-cover-placeholder { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 28px; background: linear-gradient(135deg,#2a2a2a,#333); }
.rmf-station-play-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.2s; color: #fff; font-size: 24px; z-index: 5; pointer-events: auto; }
.rmf-station-card:hover .rmf-station-play-overlay { opacity: 1; }
.rmf-station-name { padding-top: 5px; font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; text-transform: capitalize; }
.rmf-station-meta { font-size: 10px; opacity: 0.6; color: #bbb; margin-top: 1px; }

/* Album blocks */
.rmf-album-block { margin-bottom: 2px; }
.rmf-album-header { padding: 8px 10px; font-weight: bold; color: #e91e63; font-size: 12px; border-bottom: 1px solid rgba(255,255,255,0.06); background: rgba(255,255,255,0.02); }
.rmf-tracks-list { display: flex; flex-direction: column; }
.rmf-track-row { display: flex; align-items: center; padding: 8px; border-bottom: 1px solid rgba(255,255,255,0.03); cursor: pointer; transition: background 0.1s; }
.rmf-track-row:hover { background: rgba(255,255,255,0.04); }
.rmf-track-play-icon { color: #00e5a0; font-size: 13px; margin-right: 8px; cursor: pointer; flex-shrink: 0; }
.rmf-track-title-text { font-size: 12px; color: #fff; font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rmf-track-duration { font-size: 10px; color: #888; margin-right: 6px; }
.rmf-track-heart { cursor: pointer; flex-shrink: 0; font-size: 15px; transition: transform 0.1s; }
.rmf-track-heart:active { transform: scale(1.3); }

/* Fav star */
.rmf-fav-star { cursor: pointer; font-family: sans-serif; line-height: 1; transition: transform 0.1s; }
.rmf-fav-star:active { transform: scale(1.3); }

/* Back button */
.rmf-back-btn { padding: 5px 14px; background: #fff; color: #000; border: none; border-radius: 4px; cursor: pointer; font-weight: 600; font-family: sans-serif; font-size: 11px; }
.rmf-back-btn:hover { background: #eee; }

/* States */
.rmf-loading { padding: 20px; text-align: center; color: #fff; opacity: 0.6; font-size: 12px; }
.rmf-error { padding: 15px; text-align: center; color: #ff4444; font-weight: bold; font-size: 12px; }
.rmf-empty { padding: 15px; text-align: center; opacity: 0.5; font-size: 12px; color: #fff; }

/* Body padding */
body { padding-bottom: 175px !important; }
body.wp-admin { padding-bottom: 0 !important; }
body.wp-admin #rmf-player { display: none !important; }

/* Desktop */
@media (min-width: 769px) {
    .rmf-stations-grid { grid-template-columns: repeat(auto-fill,minmax(105px,1fr)); }
}

body.rmf-popup #rmf-popout { display: none; }