:root {
    --bg-color: #121212;
    --card-bg: #1e1e1e;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #bb86fc; 
    --player-bg: #181818;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    padding-bottom: 120px;
    -webkit-tap-highlight-color: transparent;
}

/* --- Header & Grid (Unchanged) --- */
header { padding: 20px; background: linear-gradient(180deg, #1e1e1e 0%, #121212 100%); position: sticky; top: 0; z-index: 10; }
h1 { margin: 0 0 15px 0; font-size: 1.8rem; text-align: center; }
.search-container { position: relative; max-width: 500px; margin: 0 auto; }
#search-bar { width: 100%; padding: 12px 15px 12px 40px; border-radius: 25px; border: none; background-color: #333; color: white; font-size: 1rem; box-sizing: border-box; }
#search-bar:focus { outline: 2px solid var(--accent); }
.search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--text-secondary); }

#podcast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; padding: 20px; max-width: 1200px; margin: 0 auto; }
.episode-card { background-color: var(--card-bg); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.card-image { width: 100%; aspect-ratio: 1/1; object-fit: cover; cursor: pointer; transition: opacity 0.2s; } 
.card-image:hover { opacity: 0.8; }
.card-content { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.card-show-title { font-size: 0.75rem; color: var(--accent); text-transform: uppercase; font-weight: bold; margin-bottom: 5px; }
.card-title { font-size: 1rem; font-weight: 600; margin: 0 0 10px 0; color: #fff; cursor: pointer; }
.card-title:hover { text-decoration: underline; }
.card-actions { margin-top: auto; display: flex; gap: 10px; }
.play-btn, .queue-btn { flex: 1; background: transparent; border: 1px solid var(--text-secondary); color: var(--text-primary); padding: 8px; border-radius: 20px; cursor: pointer; font-size: 0.9rem; }
.play-btn:hover { background-color: var(--accent); border-color: var(--accent); color: #000; }
.queue-btn:hover { background-color: #333; border-color: white; }

/* --- Mini Player --- */
#player-bar { position: fixed; bottom: 0; left: 0; right: 0; height: 90px; background-color: var(--player-bg); border-top: 1px solid #333; display: flex; flex-direction: column; z-index: 100; padding-bottom: env(safe-area-inset-bottom); transition: transform 0.3s ease; cursor: pointer; }
#player-bar.hidden { transform: translateY(120%); }

.progress-container { width: 100%; height: 3px; background-color: #333; }
#mini-progress-bar { width: 0%; height: 100%; background-color: var(--accent); }

.player-main { display: flex; flex: 1; align-items: center; justify-content: space-between; padding: 0 20px; }
.player-info { display: flex; align-items: center; width: 35%; overflow: hidden; }
#player-img { width: 45px; height: 45px; border-radius: 4px; margin-right: 12px; object-fit: cover; }
.player-text { display: flex; flex-direction: column; overflow: hidden; padding-right: 10px; }
#player-title { font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#player-show { font-size: 0.75rem; color: var(--text-secondary); }

.player-controls { display: flex; align-items: center; gap: 15px; }
.time-display { font-family: monospace; font-size: 0.8rem; color: var(--text-secondary); min-width: 90px; text-align: right; }
.ctrl-btn { background: none; border: none; color: white; font-size: 1.2rem; padding: 10px; cursor: pointer; }
.play-main { font-size: 2rem; color: white; }
.volume-container { display: flex; align-items: center; gap: 8px; width: 100px; margin-left: 10px; }
.volume-slider { width: 100%; height: 4px; accent-color: var(--text-secondary); cursor: pointer; }

/* --- Full Screen Modal (Split View) --- */
#full-screen-player {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: #000;
    z-index: 200;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#full-screen-player.fs-hidden { transform: translateY(100%); pointer-events: none; }

/* Blurred Background */
#fs-bg-blur {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; filter: blur(60px) brightness(0.3); z-index: 1;
}

/* Layout Container for Split View */
.fs-layout-container {
    position: relative; z-index: 2;
    display: flex; width: 100%; height: 100%;
}

/* --- Left Side: Main Panel --- */
.fs-main-panel {
    flex: 1; /* Grows to fill available space */
    display: flex; flex-direction: column;
    padding: 30px; box-sizing: border-box;
    transition: width 0.3s ease, flex 0.3s ease;
}

.fs-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.fs-header-title { text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; color: var(--text-secondary); }
.fs-btn { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; padding: 10px; }

.fs-art-container { flex: 1; display: flex; justify-content: center; align-items: center; max-height: 40vh; margin: 10px 0; }
#fs-art { height: 100%; max-width: 100%; aspect-ratio: 1/1; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); object-fit: contain; }

.fs-info { margin-bottom: 30px; text-align: center; }
#fs-title { font-size: 1.6rem; margin: 0 0 8px 0; color: white; }
#fs-show { font-size: 1rem; color: var(--accent); margin: 0; }

.fs-progress-wrapper { margin-bottom: 40px; width: 100%; max-width: 800px; margin-left: auto; margin-right: auto; }
#fs-seek-slider { width: 100%; accent-color: var(--accent); cursor: pointer; height: 5px; }
.fs-time-labels { display: flex; justify-content: space-between; font-size: 0.8rem; color: var(--text-secondary); margin-top: 10px; }

.fs-controls { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 800px; margin: 0 auto; }
.fs-transport { display: flex; align-items: center; gap: 30px; }
.fs-ctrl-btn { background: none; border: none; color: white; cursor: pointer; transition: transform 0.1s; }
.fs-ctrl-btn:active { transform: scale(0.95); }
.fs-ctrl-btn.sm { font-size: 1.8rem; color: var(--text-secondary); }
.fs-ctrl-btn.big { font-size: 4.5rem; color: white; } /* Simplified Play Button */
.fs-vol { width: 120px; }

/* --- Right Side: Queue Panel --- */
#queue-panel {
    width: 0; opacity: 0; overflow: hidden;
    background: #121212; border-left: 1px solid #333;
    display: flex; flex-direction: column;
    transition: width 0.3s ease, opacity 0.3s ease;
}

/* When Active (Desktop) */
#full-screen-player.queue-active .fs-main-panel { flex: 0 0 66%; } /* Shrink Main */
#full-screen-player.queue-active #queue-panel { width: 34%; opacity: 1; } /* Show Queue */

.queue-header { padding: 20px; border-bottom: 1px solid #333; display: flex; justify-content: space-between; align-items: center; }
.queue-content { flex: 1; overflow-y: auto; padding: 0; }
#queue-list { list-style: none; padding: 0; margin: 0; }
#queue-list li { padding: 15px 20px; border-bottom: 1px solid #222; display: flex; justify-content: space-between; align-items: center; }
#queue-list li:hover { background: #1a1a1a; }
.clear-q-btn { margin: 20px; padding: 15px; background: #333; color: white; border: none; border-radius: 8px; cursor: pointer; }

/* --- Description Modal --- */
.modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.85); z-index: 500; display: flex; justify-content: center; align-items: center; padding: 20px; }
.modal.hidden { display: none; }
.modal-content { background: #222; width: 100%; max-width: 600px; border-radius: 12px; max-height: 80vh; display: flex; flex-direction: column; box-shadow: 0 20px 50px rgba(0,0,0,0.9); }
.modal-header { padding: 20px; border-bottom: 1px solid #444; display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 1.2rem; }
.close-modal { background: none; border: none; color: white; font-size: 1.5rem; cursor: pointer; }
.modal-body { padding: 25px; overflow-y: auto; line-height: 1.6; color: #ddd; font-size: 1rem; }

/* --- Mobile Responsiveness --- */
@media (max-width: 800px) {
    .desktop-only { display: none !important; }
    
    /* On mobile, Queue takes over full screen, simpler logic */
    #full-screen-player.queue-active .fs-main-panel { display: none; }
    #full-screen-player.queue-active #queue-panel { width: 100%; }
    
    .fs-main-panel { padding: 20px 10px; }
    .fs-art-container { max-height: 40vh; }
    .fs-controls { justify-content: center; gap: 0; }
    .fs-transport { gap: 20px; }
    .fs-ctrl-btn.big { font-size: 3.5rem; }
}