/* ================================
   Miqurios – Audio Curiosity OS
   podcastdemo.css
   ================================ */

/* ================================
   Variables
   ================================ */

:root {
  --sidebar-width: 260px;
  --bg: #f5f5f5;
  --card-bg: #ffffff;
  --border: #e5e5e5;
  --text-primary: #111;
  --text-secondary: #666;
  --brand: #336699;
  --radius: 12px;
}

/* ================================
   Reset
   ================================ */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
}

/* ================================
   App Shell
   ================================ */

.podcast-app {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  overflow: hidden;
}

/* ================================
   Sidebar
   ================================ */

.podcast-sidebar {
  background: #fff;
  border-right: 1px solid var(--border);
  padding: 20px 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.sidebar-logo {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.sidebar-subtitle {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  color: #333;
  transition: background 0.15s;
}

.nav-item:hover {
  background: #f1f3f4;
}

.nav-item.active {
  background: #e8f0fe;
  color: #1967d2;
  font-weight: 600;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ccc;
  flex-shrink: 0;
}

.nav-item.active .dot {
  background: #1967d2;
}

.nav-section {
  margin-top: 16px;
}

.nav-section-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.15s;
}

.nav-section-header:hover {
  background: #f5f5f5;
}

.nav-section-content {
  display: flex;
  flex-direction: column;
  margin-top: 2px;
}

.nav-section-content button {
  background: none;
  border: none;
  text-align: left;
  padding: 7px 12px 7px 28px;
  font-size: 13px;
  cursor: pointer;
  color: #444;
  border-radius: 6px;
  transition: background 0.15s;
}

.nav-section-content button:hover {
  background: #f5f5f5;
  color: var(--brand);
}

.sidebar-footer {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.back-link {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
}

.back-link:hover {
  color: var(--brand);
}

/* ================================
   Workspace
   ================================ */

.podcast-workspace {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100vh;
}

/* ================================
   Topbar (mobile only)
   ================================ */

.podcast-topbar {
  display: none;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
}

.icon-btn {
  border: none;
  background: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger {
  display: block;
  width: 18px;
  height: 2px;
  background: #555;
  position: relative;
}

.hamburger::before,
.hamburger::after {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: #555;
  position: absolute;
  left: 0;
}

.hamburger::before { top: -5px; }
.hamburger::after  { top: 5px; }

.topbar-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.topbar-context {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ================================
   Views
   ================================ */

.view {
  display: none;
  padding: 32px 36px;
  overflow-y: auto;
  flex: 1;
}

.view.active {
  display: flex;
  flex-direction: column;
}

.view-header {
  margin-bottom: 24px;
  flex-shrink: 0;
}

.view-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.view-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ================================
   Episode Scroll Container
   ================================ */

.episode-scroll {
  flex: 1;
  overflow-y: auto;
}

/* ================================
   Episode List
   ================================ */

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-bottom: 24px;
}

/* ================================
   Episode Card  (original clean style)
   ================================ */

.episode-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  transition: box-shadow 0.2s ease;
}

.episode-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.10);
}

/* Logo */
.episode-logo {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  border-radius: 10px;
  object-fit: cover;
  background: #ddd;
  flex-shrink: 0;
  display: block;
}

/* Text block */
.episode-content {
  flex: 1;
  min-width: 0;
}

.podcast-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.episode-date {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 8px;
}

.episode-summary {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Explore button */
.explore-btn {
  padding: 7px 16px;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background 0.2s;
}

.explore-btn:hover {
  background: #2a5580;
}

/* ================================
   List View Controls
   ================================ */

.list-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-toggle {
  display: flex;
  gap: 8px;
}

.pill-btn {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: #555;
  transition: all 0.15s;
}

.pill-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sort-controls label {
  font-size: 13px;
  color: var(--text-secondary);
}

.sort-controls select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 13px;
  background: #fff;
}

.sort-order-btn {
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}

/* ================================
   Loading / Empty States
   ================================ */

.loading-state,
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
  font-size: 15px;
}

/* ================================
   Responsive – Mobile
   ================================ */

@media (max-width: 1024px) {

  .podcast-app {
    grid-template-columns: 1fr;
  }

  .podcast-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
  }

  .podcast-sidebar.open {
    transform: translateX(0);
  }

  .podcast-topbar {
    display: flex;
  }

  .view {
    padding: 24px 20px;
  }

  .episode-card {
    gap: 12px;
  }

  .episode-logo {
    width: 48px;
    height: 48px;
  }
}

/* ================================
   Sort Tabs (Recent / Top Rated)
   ================================ */

.sort-tabs {
  display: flex;
  gap: 8px;
  padding: 20px 0 4px 0;
}

.tab {
  padding: 9px 22px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.tab:hover:not(.active) {
  background: #f0f0f0;
}

/* ================================
   Sidebar sub-item active state
   ================================ */

.nav-sub-item {
  background: none;
  border: none;
  text-align: left;
  padding: 7px 12px 7px 28px;
  font-size: 13px;
  cursor: pointer;
  color: #444;
  border-radius: 6px;
  width: 100%;
  transition: background 0.15s;
}

.nav-sub-item:hover {
  background: #f5f5f5;
  color: var(--brand);
}

.nav-sub-item.active {
  background: #e8f0fe;
  color: #1967d2;
  font-weight: 600;
}

/* ================================
   Sidebar Close Button (mobile only)
   ================================ */

.sidebar-close {
  display: none;
  justify-content: flex-end;
  margin-bottom: 8px;
}

.sidebar-close-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.sidebar-close-btn:hover {
  background: #f5f5f5;
  color: #333;
}

@media (max-width: 1024px) {
  .sidebar-close {
    display: flex;
  }
}
