/**
 * Minimal Site Styles - Mobile First
 */

:root {
  --primary-color: #2563eb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  --border-color: #e5e7eb;
  --hover-color: #1d4ed8;
}

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

/* Edge Wave Container */
#edge-wave-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
}

#edge-wave-container canvas {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
}

/* Ensure content appears above waves - preserve existing positioning */
.main-nav {
  z-index: 100 !important;
  /* Keep position: fixed from styles.css */
}

.main-content {
  position: relative;
  z-index: 10;
}

.main-footer {
  position: relative;
  z-index: 10;
}

/* Prevent body scroll issues */
html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  position: relative;
}

/* Home Page */
.home-hero {
  text-align: center;
  padding: 1rem 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.brand-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.brand-description {
  font-size: 1rem;
  color: var(--text-secondary);
  margin: 0 auto;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .home-hero {
    padding: 1rem 0rem;
  }
  
  .brand-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
  }
  
  .brand-description {
    font-size: 1.5rem;
  }
}

.shows-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  padding: 1.5rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .shows-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    padding: 3rem 2rem;
  }
  
  .show-image-container {
    max-width: 300px;
    margin: 0 auto 1.5rem;
  }
}

.show-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.show-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .show-card {
    padding: 2rem;
  }
}

.show-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.show-image-container {
  width: 100%;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.show-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: none;
}

.show-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .show-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
}

.show-title i {
  color: var(--primary-color);
  font-size: 1.25rem;
}

.show-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .show-description {
    font-size: 1.0rem;
    margin-bottom: 1.5rem;
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  transition: background-color 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-family: 'Space Grotesk', sans-serif;
}

.btn:hover,
.btn:focus {
  background-color: var(--hover-color);
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--primary-color);
}

/* Show Pages */
.show-header {
  padding: 1.5rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .show-header {
    padding: 2rem 1rem;
  }
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  transition: all 0.2s;
}

.back-link:hover,
.back-link:focus {
  color: var(--primary-color);
  text-decoration: underline;
  outline: none;
}

.back-link i {
  transition: transform 0.2s;
}

.back-link:hover i,
.back-link:focus i {
  transform: translateX(-2px);
}

.show-title-container {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0.5rem;
  background: white;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .show-title-container {
    padding: 2rem;
  }
}

.show-title-text {
  flex: 1;
}

.show-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
}

.show-header-image {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.show-header .show-subtitle {
  margin: 0;
}

@media (min-width: 768px) {
  .show-header h1 {
    font-size: 2rem;
  }
  
  .show-header-image {
    width: 80px;
    height: 80px;
  }
}

.show-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .show-subtitle {
    font-size: 1.125rem;
  }
}

.episodes-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}

@media (min-width: 768px) {
  .episodes-container {
    padding: 0 1rem 4rem;
  }
}

.episodes-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.episode-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  transition: all 0.2s;
  cursor: pointer;
  margin-bottom: 0.5rem;
}

@media (min-width: 768px) {
  .episode-item {
    gap: 1rem;
    padding: 0.75rem 1rem;
  }
}

.episode-item:hover {
  border-color: var(--primary-color);
  background: var(--bg-primary);
  transform: translateX(2px);
}

.episode-content {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .episode-content {
    gap: 1rem;
  }
}

.episode-title {
  font-size: 0.8125rem;
  margin: 0;
  color: var(--text-primary);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
}

@media (min-width: 768px) {
  .episode-title {
    font-size: 0.95rem;
    line-height: 1.3;
  }
}

.episode-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .episode-meta {
    gap: 0.75rem;
    font-size: 0.8125rem;
  }
}

.episode-description {
  display: none;
}

.btn-play {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem;
  width: 2rem;
  height: 2rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  font-family: 'Space Grotesk', sans-serif;
}

.btn-play:hover,
.btn-play:focus {
  background-color: var(--hover-color);
  transform: scale(1.1);
  outline: none;
}

.play-icon {
  font-size: 0.75rem;
}

.play-text {
  display: none;
}

/* Player Bar */
.player-bar {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  margin: 1rem 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 100;
  position: relative;
}

@media (min-width: 768px) {
  .player-bar {
    padding: 1.5rem;
  }
}

/* Player bar is hidden by default, only shown when needed */
.player-bar[style*="display: none"],
.player-bar:not([style*="display: block"]) {
  display: none !important;
}

.btn-close-player {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1.125rem;
  cursor: pointer;
  padding: 0.375rem;
  border-radius: 4px;
  transition: all 0.2s;
  z-index: 101;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .btn-close-player {
    top: 1rem;
    right: 1rem;
    font-size: 1.25rem;
    padding: 0.5rem;
  }
}

.btn-close-player:hover,
.btn-close-player:focus {
  color: var(--text-primary);
  background: var(--bg-secondary);
  outline: none;
}

.player-content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-right: 2.5rem; /* Space for close button on mobile */
  width: 100%;
}

@media (min-width: 768px) {
  .player-content {
    padding-right: 3rem; /* More space for close button on desktop */
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 2rem;
  }
}

.player-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .player-info {
    flex: 1;
    max-width: 50%;
  }
}

.player-title {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  line-height: 1.4;
  padding-right: 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  flex: 1;
  min-width: 0;
}

@media (min-width: 768px) {
  .player-title {
    font-size: 0.95rem;
    padding-right: 0;
    white-space: normal;
    max-width: none;
  }
}

.player-date {
  font-size: 0.8125rem;
  color: var(--text-secondary);
}

@media (min-width: 768px) {
  .player-date {
    font-size: 0.875rem;
  }
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  width: 100%;
}

.player-controls audio {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

@media (min-width: 768px) {
  .player-controls {
    flex: 1;
    max-width: 50%;
    justify-content: flex-end;
    gap: 1rem;
  }
  
  .player-controls audio {
    min-width: 200px;
    width: auto;
  }
}

.btn-copy-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 0.875rem;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.8125rem;
  transition: background-color 0.2s;
  font-family: 'Space Grotesk', sans-serif;
  white-space: nowrap;
  flex-shrink: 0;
  width: 100%;
}

@media (min-width: 768px) {
  .btn-copy-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    width: auto;
  }
}

.btn-copy-link:hover,
.btn-copy-link:focus {
  background-color: var(--border-color);
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

.btn-icon {
  font-size: 0.875rem;
}

/* Sources */
.episode-sources {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.sources-header h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.sources-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.source-item {
  border: 1px solid var(--border-color);
  border-radius: 6px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.source-item:hover {
  border-color: var(--primary-color);
}

.source-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  text-decoration: none;
  color: inherit;
  gap: 1rem;
}

.source-content {
  flex: 1;
  min-width: 0;
}

.source-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
}

.source-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.source-category,
.source-country {
  text-transform: capitalize;
}

.source-icon {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.source-item:hover .source-icon {
  color: var(--primary-color);
  transform: translate(2px, -2px);
}

/* Loading & Error States */
.loading,
.error,
.no-episodes {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-secondary);
}

.error {
  color: #dc2626;
}

/* Footer - Static footer */
.main-footer {
  position: static !important;
  background: rgba(0, 0, 0, 0.8) !important;
  border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.1)) !important;
  padding: 1rem 0 !important;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem !important;
}

.footer-bottom {
  text-align: center;
  color: var(--text-muted, #888) !important;
  font-size: 0.875rem;
  padding: 0 !important;
  margin: 0 !important;
}

.footer-bottom p {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.5;
}

.footer-bottom a {
  color: var(--secondary-color, #4ECDC4) !important;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-bottom a:hover,
.footer-bottom a:focus {
  color: var(--accent-color, #45B7D1) !important;
  text-decoration: underline;
}

/* Remove padding since footer is no longer fixed */
.main-content {
  padding-bottom: 0;
}

/* Responsive - Mobile First */
@media (max-width: 767px) {
  .episode-item {
    flex-direction: row;
    align-items: center;
    gap: 0.75rem;
  }
  
  .episode-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .episode-meta {
    width: 100%;
    flex-wrap: wrap;
  }
  
  .btn-play {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
  }
  
  .player-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .player-controls {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }
  
  .player-controls audio {
    width: 100%;
    min-width: 0;
  }
  
  .btn-copy-link {
    width: 100%;
  }
  
  /* Ensure sources are readable on mobile */
  .episode-sources {
    margin-top: 1rem;
    padding-top: 1rem;
  }
  
  .source-link {
    padding: 0.75rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .source-content {
    width: 100%;
  }
  
  .source-meta {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media (min-width: 768px) {
  .player-content {
    flex-direction: row;
    align-items: center;
  }

  .player-info {
    min-width: 200px;
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus styles */
*:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}
