/* Podcast Listing Page Styles */

:root {
  --background: #ffffff;
  --foreground: #1a1a1a;
  --card: #5E5EA1;
  --card-foreground: #ffffff;
  --primary: #d4a855;
  --primary-foreground: #0a0a0a;
  --muted: #5E5EA1;
  --muted-foreground: #ffffff;
  --border: #5E5EA1;
  --ring: #d4a855;
  --purple: #5E5EA1;
}

.sort-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 10px 12px;
  background: var(--purple);
  border-radius: 16px 16px 0 0;
}

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

.sort-stats {
  color: white;
  font-size: 14px;
  font-weight: 500;
}

.sort-btn {
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 3px;
}

.sort-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
  color: white;
}

.sort-btn.active {
  background: white;
  color: var(--purple);
  border-color: white;
}

.sort-arrow {
  font-size: 10px;
  min-width: 10px;
}

.podcast-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 16px;
}

.podcast-card {
  position: relative;
  display: grid;
  grid-template-rows: 160px auto auto;
  align-items: center;
  justify-items: center;
  padding: 16px 16px 12px 16px;
  background: #E6E6F8;
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  height: auto;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.podcast-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.podcast-edit-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  z-index: 10;
  transition: transform 0.2s, background 0.2s;
}

.podcast-edit-icon:hover {
  transform: scale(1.1);
  background: #f0f0f0;
}

.podcast-edit-icon svg {
  width: 14px;
  height: 14px;
  color: var(--purple);
}

.podcast-logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 160px;
  min-height: 160px;
  max-height: 160px;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.podcast-logo {
  max-width: 90%;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.3)) drop-shadow(0 0 8px rgba(94, 94, 161, 0.4));
  border: 1px solid #ccc;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  pointer-events: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.podcast-logo-placeholder {
  width: 120px;
  height: 120px;
  min-width: 120px;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 8px;
  color: transparent;
  font-weight: bold;
  font-size: 14px;
  text-align: center;
  padding: 8px;
}

.podcast-name {
  font-weight: 600;
  font-size: 14px;
  color: #333;
  text-align: center;
  margin-bottom: 4px;
  line-height: 1.3;
  align-self: end;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 8px;
}

.episode-count-btn {
  display: inline-block;
  margin-top: 4px;
  padding: 4px 14px;
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, filter 0.2s;
}

.episode-count-btn:hover {
  filter: brightness(1.1);
}

.loading-message {
  padding: 40px 20px;
  text-align: center;
  color: #666;
  grid-column: 1 / -1;
}

/* Breadcrumb */
.breadcrumb {
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  font-size: 13px;
  color: #666;
}

.breadcrumb a {
  color: var(--purple);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb-sep {
  margin: 0 6px;
  color: #999;
}

/* Responsive */
@media (max-width: 1000px) {
  .podcast-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .podcast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 500px) {
  .podcast-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .podcast-card {
    padding: 10px 10px 6px 10px;
    grid-template-rows: 120px auto auto;
  }

  .podcast-logo-container {
    height: 120px;
    min-height: 120px;
    max-height: 120px;
  }

  .podcast-logo {
    max-width: 90%;
    max-height: 100px;
  }

  .podcast-logo-placeholder {
    width: 90px;
    height: 90px;
    font-size: 12px;
  }

  .podcast-name {
    font-size: 12px;
    margin-bottom: 2px;
  }

  .sort-header {
    flex-wrap: nowrap;
    gap: 6px;
    padding: 8px 10px;
  }

  .sort-buttons-left {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .sort-stats {
    font-size: 10px;
    white-space: nowrap;
  }
}
