/* ============================================
   The Scattered Stethoscope - Theme
   Bright, vibrant, neurodivergent-friendly
   ============================================ */

:root {
  --bg-main: #1A1A2E;
  --bg-surface: #16213E;
  --bg-elevated: #0F3460;
  --pink: #E91E8C;
  --coral: #FF6B6B;
  --teal: #4ECDC4;
  --yellow: #FFD93D;
  --purple: #7B68EE;
  --blue: #4A90D9;
  --text-body: #E8E8E8;
  --text-heading: #FFFFFF;
  --text-muted: #9CA3AF;
  --border: #2D3748;
  --radius: 12px;
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-body);
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: var(--pink);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--teal); }
a:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  color: var(--text-heading);
  line-height: 1.3;
  margin-bottom: 0.5em;
}
h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

/* --- Layout --- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Header --- */
.site-header {
  background: var(--bg-surface);
  border-bottom: 3px solid var(--pink);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-heading);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.site-logo .accent { color: var(--pink); }
.site-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.site-nav a {
  color: var(--text-body);
  font-weight: 600;
  font-size: 1rem;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

/* --- Footer --- */
.site-footer {
  background: var(--bg-surface);
  border-top: 3px solid var(--pink);
  padding: 2rem 0;
  margin-top: 4rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.site-footer a { color: var(--pink); }

/* --- Hero --- */
.hero {
  text-align: center;
  padding: 4rem 0 3rem;
}
.hero h1 {
  font-size: 3rem;
  background: linear-gradient(135deg, var(--pink), var(--coral), var(--yellow), var(--teal), var(--blue), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 1rem auto;
}

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding: 2rem 0;
}
.card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--teal);
}
.card-artwork {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}
.card-body {
  padding: 1.25rem;
}
.card-body h3 { margin-bottom: 0.25rem; }
.card-body p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}
.card-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* --- Badge --- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}
.badge-coral { background: var(--coral); color: #fff; }
.badge-teal { background: var(--teal); color: #1A1A2E; }
.badge-yellow { background: var(--yellow); color: #1A1A2E; }
.badge-purple { background: var(--purple); color: #fff; }

/* --- Episode List --- */
.episode-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem 0;
}
.episode-item {
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: border-color 0.2s;
}
.episode-item:hover { border-color: var(--pink); }
.episode-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--pink);
  min-width: 2.5rem;
  text-align: center;
}
.episode-info { flex: 1; }
.episode-info h3 { margin-bottom: 0.15rem; font-size: 1.1rem; }
.episode-info p { margin-bottom: 0; color: var(--text-muted); font-size: 0.9rem; }
.episode-duration {
  color: var(--purple);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* --- Audio Player --- */
.player-container {
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 2px solid var(--pink);
  padding: 2rem;
  margin: 2rem 0;
}
.player-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.player-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--pink);
  color: #fff;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}
.player-btn:hover { background: var(--purple); transform: scale(1.05); }
.player-btn:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
.player-progress {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-elevated);
  border-radius: 4px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  border-radius: 4px;
  width: 0%;
  transition: width 0.1s;
}
.player-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.player-extras {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.75rem;
}
.speed-select {
  background: var(--bg-elevated);
  color: var(--text-body);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.speed-select:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
.download-btn {
  background: none;
  border: 1px solid var(--pink);
  color: var(--pink);
  padding: 0.3rem 0.75rem;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.download-btn:hover { background: var(--pink); color: #fff; }

/* --- Volume --- */
.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  outline: none;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pink);
  cursor: pointer;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  text-decoration: none;
}
.btn:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
.btn-primary { background: var(--pink); color: #fff; }
.btn-primary:hover { background: #c4177a; color: #fff; }
.btn-secondary { background: var(--teal); color: var(--bg-main); }
.btn-secondary:hover { background: #3dbdb5; color: var(--bg-main); }
.btn-danger { background: #EF4444; color: #fff; }
.btn-danger:hover { background: #DC2626; }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-body);
}
.btn-outline:hover { border-color: var(--teal); color: var(--teal); }
.btn-sm { padding: 0.4rem 0.75rem; font-size: 0.85rem; }

/* --- Forms --- */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.95rem;
}
.form-control {
  width: 100%;
  padding: 0.65rem 0.85rem;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-body);
  font-size: 1rem;
  font-family: var(--font);
  transition: border-color 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.2);
}
textarea.form-control {
  min-height: 120px;
  resize: vertical;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.form-check input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal);
}

/* --- Admin --- */
.admin-header {
  background: var(--bg-surface);
  border-bottom: 3px solid var(--purple);
  padding: 1rem 0;
}
.admin-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-title {
  font-weight: 800;
  color: var(--purple);
  font-size: 1.25rem;
}
.admin-nav {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.admin-nav a {
  color: var(--text-body);
  font-weight: 600;
}
.admin-nav a:hover { color: var(--purple); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  padding: 2rem 0;
}
.stat-card {
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}
.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--pink);
}
.stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.25rem;
}

/* --- Table --- */
.table-container {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
}
td { font-size: 0.95rem; }
tr:hover td { background: rgba(233, 30, 140, 0.08); }

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* --- Alert --- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-weight: 500;
}
.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid #EF4444;
  color: #FCA5A5;
}
.alert-success {
  background: rgba(78, 205, 196, 0.15);
  border: 1px solid var(--teal);
  color: var(--teal);
}

/* --- Login --- */
.login-container {
  max-width: 400px;
  margin: 8rem auto;
  padding: 2rem;
  background: var(--bg-surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.login-container h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  color: var(--pink);
}

/* --- RSS Badge --- */
.rss-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  background: var(--pink);
  color: #FFFFFF;
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
.rss-link:hover { background: var(--purple); color: #FFFFFF; }

/* --- Upload area --- */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
.upload-area:hover {
  border-color: var(--teal);
  background: rgba(78, 205, 196, 0.05);
}
.upload-area.dragover {
  border-color: var(--coral);
  background: rgba(255, 107, 107, 0.1);
}
.upload-progress {
  margin-top: 1rem;
}
.upload-progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
}
.upload-progress-fill {
  height: 100%;
  background: var(--teal);
  width: 0%;
  transition: width 0.3s;
}

/* --- Grid Layout Classes --- */
.grid-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.grid-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.awareness-banner { border-radius: var(--radius); overflow: hidden; position: relative; min-height: 300px; }
.awareness-banner img { width: 100%; height: 300px; display: block; object-fit: cover; }
.awareness-overlay { position: absolute; bottom: 0; left: 0; right: 0; padding: 1.25rem 1.5rem; background: linear-gradient(transparent, rgba(0,0,0,0.85)); }

/* --- Hamburger Menu --- */
.nav-toggle {
  display: none;
  visibility: hidden;
  width: 0;
  height: 0;
  overflow: hidden;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: none;
  width: 26px;
  height: 3px;
  background: var(--text-body);
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
}
.nav-toggle.nav-active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.nav-toggle.nav-active span:nth-child(2) { opacity: 0; }
.nav-toggle.nav-active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* --- Responsive: Desktop (>1024px) --- */
@media (min-width: 1025px) {
  .awareness-banner img { height: 320px; }
}

/* --- Responsive: Tablet (<1024px) --- */
@media (max-width: 1024px) {
  .grid-2col { gap: 1rem; }
  .awareness-banner img { height: 250px; }
  .awareness-banner { min-height: 250px; }
}

/* --- Responsive: Mobile (<768px) --- */
@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  h1 { font-size: 1.75rem; }
  .card-grid { grid-template-columns: 1fr; }
  .episode-item { flex-direction: column; align-items: flex-start; }
  .stat-grid { grid-template-columns: 1fr 1fr; }

  /* Hamburger nav */
  .nav-toggle { display: flex; visibility: visible; width: auto; height: auto; overflow: visible; padding: 0.5rem; }
  .nav-toggle span { display: block; }
  .site-header .container { position: relative; }
  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    gap: 0;
    padding: 0.5rem 0;
  }
  .site-nav.nav-open { display: flex; }
  .site-nav li { width: 100%; }
  .site-nav a {
    display: block;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
  }
  .site-nav .rss-link { display: inline-flex; margin: 0.5rem 0; }

  /* Grids stack */
  .grid-2col { grid-template-columns: 1fr; }
  .grid-3col { grid-template-columns: 1fr; }

  /* Awareness banner */
  .awareness-banner img { height: 140px; }
  .awareness-banner { min-height: 140px; }
  .awareness-overlay { padding: 0.75rem 1rem; }
  .awareness-overlay h3 { font-size: 0.95rem; }
  .awareness-overlay p { font-size: 0.75rem; }

  /* Player touch targets */
  .progress-bar { height: 20px; border-radius: 10px; }
  .progress-fill { border-radius: 10px; }
  .volume-slider { height: 20px; }
  .volume-slider::-webkit-slider-thumb { width: 24px; height: 24px; }
  .speed-select { font-size: 1rem; padding: 0.5rem; }
  .player-extras { flex-wrap: wrap; gap: 0.75rem; }

  /* Pricing */
  .pricing-grid { grid-template-columns: 1fr; }
}

/* --- Responsive: Small Phone (<480px) --- */
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .hero img { max-width: 100%; }
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.35rem; }
  .player-btn { width: 48px; height: 48px; font-size: 1.25rem; }
  .awareness-banner img { height: 120px; }
  .awareness-banner { min-height: 120px; }
  .btn { padding: 0.5rem 1rem; font-size: 0.9rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .episode-number { font-size: 1.2rem; min-width: 2rem; }
  .admin-nav { flex-wrap: wrap; gap: 0.75rem; }
}
