/* ==========================================================================
   AudioPod PWA - Modern Dark Theme CSS Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-main: #090d16;
  --bg-surface: #111827;
  --bg-surface-hover: #1f293d;
  --bg-surface-elevated: #1e293b;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(56, 189, 248, 0.4);
  
  --accent-primary: #38bdf8;
  --accent-primary-hover: #0ea5e9;
  --accent-secondary: #818cf8;
  --accent-danger: #f43f5e;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-dock: 0 -10px 30px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  width: 100%;
  height: 100%;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

#app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 90px; /* space for mini player */
}

/* Header Navbar */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background-color: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.brand-logo svg {
  width: 32px;
  height: 32px;
  color: var(--accent-primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn:hover {
  background-color: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background-color: var(--accent-primary);
  color: #090d16;
  border: none;
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  color: #090d16;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-subscribed {
  background-color: var(--bg-surface-elevated) !important;
  color: var(--accent-primary) !important;
  border: 1px solid rgba(56, 189, 248, 0.3) !important;
  opacity: 0.85 !important;
}

.btn-nowrap {
  white-space: nowrap;
  flex-shrink: 0;
}

#btn-perform-search,
#btn-add-rss-url {
  min-width: 105px;
  justify-content: center;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
}

/* Main Content Area */
.main-content {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Hero "Continue Listening" Shelf */
.continue-shelf {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(17, 24, 39, 0.9) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  box-shadow: var(--shadow-card);
}

.shelf-artwork {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.shelf-info {
  flex: 1;
  min-width: 0;
}

.shelf-badge {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-primary);
  margin-bottom: 0.25rem;
}

.shelf-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shelf-podcast {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.shelf-progress-bar {
  width: 100%;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  cursor: pointer;
  padding: 4px 0;
  margin: -4px 0;
  background-clip: content-box;
}

.shelf-progress-fill {
  height: 100%;
  background-color: var(--accent-primary);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: var(--radius-full);
}

.btn-shelf-play {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--accent-primary);
  color: #090d16;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn-shelf-play:hover {
  transform: scale(1.06);
}

/* Subscribed Podcast Section & Tile Grid */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.podcast-tile, .podcast-grid, .tile-artwork-wrapper, .tile-artwork, .tile-drag-handle, .tile-drag-avatar {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-tap-highlight-color: transparent !important;
}

.podcast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1.25rem;
}

.podcast-tile {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-normal);
  user-select: none;
}

.podcast-tile:hover {
  background-color: var(--bg-surface-hover);
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-4px);
  box-shadow: var(--shadow-card);
}

.podcast-tile.dragging {
  opacity: 0.4;
  transform: scale(0.95);
  border-style: dashed;
}

.podcast-tile.tile-dimmed {
  opacity: 0.35;
  transform: scale(0.96);
  filter: grayscale(30%);
}

.tile-drag-avatar {
  position: fixed !important;
  pointer-events: none !important;
  z-index: 1000 !important;
  opacity: 0.95;
  transform: scale(1.06);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7), 0 0 0 2px var(--accent-primary);
  border-radius: var(--radius-lg);
  margin: 0 !important;
  transition: transform 0.05s ease-out;
}

.podcast-tile.drag-over {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px var(--accent-primary);
}

.podcast-tile.drag-over-before {
  border-color: var(--accent-primary);
  position: relative;
}

.podcast-tile.drag-over-before::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-primary);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-primary);
  z-index: 10;
}

.podcast-tile.drag-over-after {
  border-color: var(--accent-primary);
  position: relative;
}

.podcast-tile.drag-over-after::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent-primary);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--accent-primary);
  z-index: 10;
}

.tile-artwork-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background-color: var(--bg-surface-elevated);
}

.tile-artwork {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tile-drag-handle {
  position: absolute;
  top: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  padding: 4px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.podcast-tile:hover .tile-drag-handle {
  opacity: 1;
}

.tile-badge {
  position: absolute;
  bottom: 6px;
  left: 6px;
  background-color: rgba(14, 165, 233, 0.9);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.tile-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-main);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-author {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

/* Docked Mini Player */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background-color: rgba(17, 24, 39, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-dock);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mini-player.active {
  transform: translateY(0);
}

.mini-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1;
  cursor: pointer;
}

.mini-artwork {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.mini-meta {
  min-width: 0;
}

.mini-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-podcast {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mini-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  padding: 4px 0;
  margin-top: -4px;
  background-clip: content-box;
}

.mini-progress-fill {
  height: 100%;
  background-color: var(--accent-primary);
  width: 0%;
  border-radius: var(--radius-full);
}

/* Modals Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background-color: rgba(9, 13, 22, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  padding: 1rem;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-modal);
  overflow: hidden;
  transform: scale(0.95);
  transition: transform var(--transition-normal);
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.podcast-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
}
.podcast-modal-artwork {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.podcast-modal-titles {
  flex: 1;
  min-width: 0;
}
.podcast-modal-titles .modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.podcast-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.btn-unsubscribe {
  color: var(--accent-danger);
  border-color: rgba(244, 63, 94, 0.3);
}

.btn-unsubscribe:hover {
  background-color: rgba(244, 63, 94, 0.1);
  border-color: var(--accent-danger);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

/* Full Screen Player Modal */
.full-player-card {
  max-width: 480px;
  max-height: 88vh;
  height: 88vh;
  background: linear-gradient(180deg, #162032 0%, #090d16 100%);
  padding: 1.5rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}

.full-player-top-pane {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding-right: 4px;
  scrollbar-width: thin;
}

.full-player-artwork {
  width: 220px;
  height: 220px;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

.full-player-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.3;
}

.full-player-podcast {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.full-player-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
  text-align: left;
  word-break: break-word;
}

.full-player-seeker {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.seek-slider {
  width: 100%;
  accent-color: var(--accent-primary);
  cursor: pointer;
}

.time-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.full-player-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  width: 100%;
}

.btn-circle {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-circle:hover {
  background-color: var(--bg-surface-hover);
  color: var(--accent-primary);
}

.btn-circle:active {
  transform: scale(0.92);
}

.btn-circle-lg {
  width: 64px;
  height: 64px;
  background-color: var(--accent-primary);
  color: #090d16;
  border: none;
}

.btn-circle-lg:hover {
  background-color: var(--accent-primary-hover);
  color: #090d16;
}

.btn-circle-lg:active {
  transform: scale(0.92);
}

.rate-badge {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-primary);
}

#btn-sleep-timer {
  position: relative;
}

.sleep-badge {
  font-size: 0.82rem;
  font-weight: 700;
  transition: all var(--transition-fast);
}

.sleep-badge.active {
  color: var(--accent-primary);
  border-color: rgba(56, 189, 248, 0.4);
  background-color: rgba(56, 189, 248, 0.08);
  font-size: 0.82rem;
  font-weight: 700;
}

.sleep-progress-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.sleep-progress-bg {
  stroke: rgba(255, 255, 255, 0.12);
}

.sleep-progress-fill {
  stroke: var(--accent-primary);
  transition: stroke-dashoffset 0.25s linear;
}

.sleep-timer-text {
  position: relative;
  z-index: 1;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-primary);
  font-family: var(--font-body);
}

.btn-share-inline {
  font-size: 0.8rem;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: all var(--transition-fast);
  font-weight: 500;
  margin-top: 0.5rem;
}

.btn-share-inline svg {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.btn-share-inline:hover {
  color: var(--accent-primary);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(56, 189, 248, 0.1);
}


/* Episode List Items */
.episode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 1rem;
  transition: background-color var(--transition-fast);
}

.episode-item:hover {
  background-color: var(--bg-surface-hover);
}

.ep-info {
  flex: 1;
  min-width: 0;
}

.ep-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--text-main);
}

.ep-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ep-progress-tag {
  color: var(--accent-primary);
  font-weight: 600;
}

/* Download Progress Button & Circular Indicators */
.btn-with-progress {
  position: relative;
  overflow: hidden;
}

.btn-progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background-color: var(--accent-primary);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: width 0.15s ease;
  pointer-events: none;
}

.btn-dl-action {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-dl-action .circular-progress-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.btn-dl-action .circular-progress-fill {
  transition: stroke-dashoffset 0.15s ease;
}

.btn-dl-action.is-downloading {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  background-color: var(--bg-surface-elevated);
  border-color: rgba(56, 189, 248, 0.4);
}

.btn-dl-action.is-downloading:hover {
  color: var(--accent-danger);
  border-color: rgba(244, 63, 94, 0.5);
  background-color: rgba(244, 63, 94, 0.12);
}

.btn-dl-action .btn-cancel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Storage Bar Gauge */
.storage-gauge-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.storage-meter-bar {
  width: 100%;
  height: 8px;
  background-color: #070a12;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  margin: 0.5rem 0;
}

.storage-meter-fill {
  height: 100%;
  background-color: var(--accent-primary);
  border-radius: 2px;
  transition: width 0.25s ease, opacity 0.2s ease;
  width: 0%;
  opacity: 0;
}

.storage-meter-fill.has-data {
  opacity: 1;
}

/* Dropzone for MP3 files */
.file-dropzone {
  border: 2px dashed var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: rgba(30, 41, 59, 0.4);
}

.file-dropzone:hover, .file-dropzone.drag-active {
  border-color: var(--accent-primary);
  background-color: rgba(56, 189, 248, 0.05);
}

#btn-import-local {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

#btn-import-local svg {
  flex-shrink: 0;
}

.modal-card.drag-active {
  border-color: var(--accent-primary) !important;
  box-shadow: 0 0 0 2px var(--accent-primary), var(--shadow-modal) !important;
}

#btn-clear-all-storage {
  transition: all var(--transition-fast);
}

#btn-clear-all-storage:hover, #btn-clear-all-storage:focus-visible {
  background-color: rgba(244, 63, 94, 0.25) !important;
  border-color: var(--accent-danger) !important;
  box-shadow: 0 0 12px rgba(244, 63, 94, 0.2);
}

/* Inputs */
.input-text {
  width: 100%;
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-elevated);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.95rem;
  outline: none;
}

.input-text:focus {
  border-color: var(--accent-primary);
}

/* Utility Animations */
@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning {
  animation: spin 1s linear infinite;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  width: 90%;
  max-width: 480px;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background-color: rgba(30, 41, 59, 0.95);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  color: var(--text-main);
  font-size: 0.9rem;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: toastIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transition: opacity 0.2s ease, transform 0.2s ease;
  user-select: none;
  cursor: pointer;
}

.toast.toast-warning {
  border-color: rgba(245, 158, 11, 0.4);
  background-color: rgba(35, 28, 20, 0.96);
}

.toast.toast-error {
  border-color: rgba(244, 63, 94, 0.4);
  background-color: rgba(38, 18, 24, 0.96);
}

.toast.toast-success {
  border-color: rgba(16, 185, 129, 0.4);
  background-color: rgba(18, 36, 28, 0.96);
}

.toast.toast-info {
  border-color: rgba(56, 189, 248, 0.4);
  background-color: rgba(18, 28, 40, 0.96);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive adjustments */
@media (max-width: 640px) {
  #app-container {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }

  .app-header {
    padding: calc(0.75rem + env(safe-area-inset-top, 0px)) 1rem 0.75rem 1rem;
  }
  .brand-logo {
    font-size: 1.15rem;
  }
  .brand-logo svg {
    width: 26px;
    height: 26px;
  }
  .header-actions {
    gap: 0.5rem;
  }
  .btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.82rem;
  }
  .btn-icon {
    width: 36px;
    height: 36px;
  }
  .main-content {
    padding: 1rem;
    gap: 1.5rem;
  }
  .podcast-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .podcast-tile {
    padding: 0.75rem;
    gap: 0.5rem;
    border-radius: var(--radius-md);
    touch-action: manipulation;
  }
  .tile-drag-handle {
    touch-action: none;
  }
  .tile-title {
    font-size: 0.9rem;
  }
  .tile-author {
    font-size: 0.75rem;
  }
  .continue-shelf {
    flex-direction: row;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
  }
  .shelf-artwork {
    width: 56px;
    height: 56px;
  }
  .shelf-title {
    font-size: 0.95rem;
  }
  .mini-player {
    padding: 0.6rem 1rem calc(0.6rem + env(safe-area-inset-bottom, 0px)) 1rem;
  }
  .mini-artwork {
    width: 42px;
    height: 42px;
  }
  .mini-title {
    font-size: 0.88rem;
  }
  .mini-podcast {
    font-size: 0.75rem;
  }
  .modal-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .modal-card {
    max-height: 90vh;
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    transform: translateY(100%);
  }
  .modal-overlay.open .modal-card {
    transform: translateY(0);
  }
  .full-player-card {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    padding: 1.5rem 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)) 1.25rem;
    justify-content: space-between;
  }
  .full-player-artwork {
    width: min(220px, 55vw);
    height: min(220px, 55vw);
  }
  .full-player-title {
    font-size: 1.15rem;
  }
  .podcast-modal-header {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 0.75rem 0.5rem;
    padding: 1rem;
  }
  .podcast-modal-artwork {
    grid-column: 1;
    grid-row: 1;
    width: 48px;
    height: 48px;
  }
  .podcast-modal-actions {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 0.4rem;
  }
  .podcast-modal-titles {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin-left: 0;
  }
  .podcast-modal-titles .modal-title {
    font-size: 1.15rem;
    line-height: 1.3;
    white-space: normal;
  }
}
