/* Sermon Page - Themeable Design
 * Based on concept-3-themeable.html
 * Theme can be set via data-theme attribute on <html>
 */

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

/* ============================================
   THEME SYSTEM - CSS Custom Properties
   ============================================ */

/* THEME: Minimal (Default - Scandinavian/Modern) */
[data-theme="minimal"], :root {
  --bg-primary: #ffffff;
  --bg-secondary: #f9f9f9;
  --bg-card: #ffffff;
  --bg-hover: #f5f5f5;
  --text-primary: #111111;
  --text-secondary: #555555;
  --text-muted: #888888;
  --accent: #111111;
  --accent-hover: #333333;
  --accent-rgb: 17, 17, 17;
  --border: rgba(0,0,0,0.06);
  --radius-sm: 0px;
  --radius-md: 0px;
  --radius-lg: 0px;
  --shadow-card: none;
  --shadow-hover: none;
  --font-heading: 'Helvetica Neue', -apple-system, sans-serif;
  --font-body: 'Helvetica Neue', -apple-system, sans-serif;
  --hero-overlay: linear-gradient(to top, var(--bg-primary), transparent);
  --card-style: flat;
  --layout-style: grid;
}

/* THEME: Streaming (Netflix/TV style) */
[data-theme="streaming"] {
  --bg-primary: #141414;
  --bg-secondary: #1a1a1a;
  --bg-card: #252525;
  --bg-hover: #333333;
  --text-primary: #ffffff;
  --text-secondary: #b3b3b3;
  --text-muted: #808080;
  --accent: #e50914;
  --accent-hover: #f40612;
  --accent-rgb: 229, 9, 20;
  --border: rgba(255,255,255,0.08);
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-card: 0 4px 20px rgba(0,0,0,0.4);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.6);
  --font-heading: 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'Helvetica Neue', Arial, sans-serif;
  --hero-overlay: linear-gradient(to right, var(--bg-primary) 0%, rgba(20,20,20,0.7) 50%, transparent 100%);
}

/* THEME: California (Bethel/Hillsong clean style) */
[data-theme="california"] {
  --bg-primary: #fafafa;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f5f5f5;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-rgb: 37, 99, 235;
  --border: rgba(0,0,0,0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
  --font-heading: 'Georgia', serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --hero-overlay: linear-gradient(to top, var(--bg-primary), transparent);
}

/* THEME: Megachurch (Bold, modern, high-energy) */
[data-theme="megachurch"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-hover: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #f97316;
  --accent-hover: #fb923c;
  --accent-rgb: 249, 115, 22;
  --border: rgba(255,255,255,0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 4px 16px rgba(0,0,0,0.3);
  --shadow-hover: 0 12px 32px rgba(0,0,0,0.4);
  --font-heading: 'Impact', 'Oswald', sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, sans-serif;
  --hero-overlay: linear-gradient(135deg, rgba(15,23,42,0.95), rgba(15,23,42,0.5));
}

/* THEME: Traditional (Classic church feel) */
[data-theme="traditional"] {
  --bg-primary: #f5f3ef;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f0ede8;
  --text-primary: #2d2a26;
  --text-secondary: #5c5852;
  --text-muted: #8a857c;
  --accent: #8b4513;
  --accent-hover: #a0522d;
  --accent-rgb: 139, 69, 19;
  --border: rgba(0,0,0,0.1);
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 6px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.15);
  --font-heading: 'Palatino', 'Georgia', serif;
  --font-body: 'Georgia', serif;
  --hero-overlay: linear-gradient(to top, var(--bg-primary), transparent);
}

/* THEME: Vibrant (Elevation/Young adult) */
[data-theme="vibrant"] {
  --bg-primary: #0c0c0c;
  --bg-secondary: #161616;
  --bg-card: #1c1c1c;
  --bg-hover: #262626;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #707070;
  --accent: #00d4ff;
  --accent-hover: #00e5ff;
  --accent-rgb: 0, 212, 255;
  --border: rgba(255,255,255,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 20px rgba(0,212,255,0.1);
  --shadow-hover: 0 8px 40px rgba(0,212,255,0.2);
  --font-heading: -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, sans-serif;
  --hero-overlay: linear-gradient(135deg, rgba(12,12,12,0.9), rgba(12,12,12,0.3));
}

/* ============================================
   BASE STYLES
   ============================================ */

html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
  width: 100% !important;
}


body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 0;
  height: auto;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

a {
  color: inherit;
  text-decoration: none;
}

/* ============================================
   THEME SWITCHER (Admin preview)
   ============================================ */

.theme-switcher {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.theme-switcher h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  letter-spacing: 0.5px;
}

.theme-options {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.theme-option:hover {
  background: var(--bg-hover);
}

.theme-option.active {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

.theme-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 2px solid rgba(128,128,128,0.3);
}

.theme-name {
  font-size: 0.85rem;
  font-weight: 500;
}

/* ============================================
   NAVIGATION
   ============================================ */

.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.nav-logo img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: flex;
  gap: 0.25rem;
}

.nav-link {
  padding: 0.5rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
  width: 300px;
}

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  outline: none;
  font-size: 0.9rem;
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

/* ============================================
   HERO SECTION
   ============================================ */

.hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  inset: -15%;
  background: var(--hero-bg) center/cover no-repeat;
  animation: heroZoom 12s ease-out forwards;
  z-index: 0;
}

@keyframes heroZoom {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.2);
  }
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
  z-index: 1;
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  color: #111;
}

.hero-header {
  margin-bottom: 1rem;
}

.hero-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hero-search {
  position: absolute;
  top: 2rem;
  right: 2rem;
  z-index: 3;
}

.hero-search .search-bar {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md);
  padding: 0.5rem 1rem;
}

.hero-search .search-bar input {
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.9rem;
  width: 140px;
}

.hero-series {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 1rem;
  color: #111;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  color: #333;
}

.hero-description {
  font-size: 1.05rem;
  color: #333;
  margin-bottom: 1.5rem;
  max-width: 500px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
}

/* ============================================
   CONTENT SECTIONS
   ============================================ */

.content {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  overflow-x: hidden;
}

.section {
  margin-bottom: 0;
  padding: 1.5rem 2rem;
  margin-left: -2rem;
  margin-right: -2rem;
}

/* Alternating backgrounds only on main media page, excluding series-rows */
.media-home > .section:nth-child(even) {
  background: #f7f7f7;
}

[data-theme="dark"] .media-home > .section:nth-child(even) {
  background: rgba(255,255,255,0.03);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.section-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.section-link:hover {
  text-decoration: underline;
}

/* ============================================
   MESSAGE CARDS (Horizontal scroll)
   ============================================ */

.row-wrapper {
  position: relative;
  overflow: hidden;
}

.scroll-arrow {
  position: absolute;
  top: 90px; /* Center on thumbnail (320px * 9/16 / 2 = 90px) */
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: all 0.2s;
}

.scroll-arrow:hover {
  background: var(--bg-hover);
  transform: translateY(-50%) scale(1.1);
}

.scroll-prev {
  left: 0.5rem;
}

.scroll-next {
  right: 0.5rem;
}

.row-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 1rem;
  scroll-snap-type: x mandatory;
  cursor: grab;
  scrollbar-width: none;
  -ms-overflow-style: none;
  user-select: none;
  -webkit-user-select: none;
}

.row-scroll::-webkit-scrollbar {
  display: none;
}

.row-scroll.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

/* Wrap layout for search results and speaker pages */
.messages-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1rem 0;
}

.messages-wrap > .message-card {
  flex: 0 0 320px;
  width: 320px;
  max-width: 320px;
}

.message-card {
  flex: 0 0 auto;
  width: 320px;
  scroll-snap-align: start;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.message-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

[data-theme="vibrant"] .message-card:hover {
  box-shadow: 0 8px 40px rgba(var(--accent-rgb), 0.25);
}

.message-image {
  position: relative;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-hover) 100%);
  overflow: hidden;
}

.message-image.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
}

.message-image.no-image::after {
  content: '';
  width: 60%;
  height: 60%;
  background: url('/u/orglogo.png') center/contain no-repeat;
  opacity: 0.4;
}

.message-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.message-duration {
  position: absolute;
  bottom: 0.5rem;
  right: 0.5rem;
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
}

.message-content {
  padding: 1rem;
}

.message-series {
  font-size: 0.7rem;
  color: var(--accent);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.episode-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  text-transform: none;
  vertical-align: middle;
  position: relative;
  top: -1px;
}

/* Hide video.js no-js message by default (prevents flash) */
.vjs-no-js {
  display: none;
}
noscript .vjs-no-js,
.vjs-no-js:only-child {
  display: block;
}

.message-title {
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.message-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  gap: 0.75rem;
}

/* ============================================
   SERIES GRID
   ============================================ */

.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.series-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
}

.series-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.series-image {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--bg-hover);
}

.series-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.series-badge {
  display: inline-block;
  background: var(--accent);
  color: white;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.series-parts {
  position: absolute;
  bottom: 0.75rem;
  right: 0.75rem;
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.series-content {
  padding: 1.25rem;
}

.series-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.series-description {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.series-meta {
  display: flex;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   SPEAKERS
   ============================================ */

.speakers-scroll {
  display: flex;
  gap: 2rem;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;  /* top padding for hover animation */
}

.speaker-card {
  flex: 0 0 auto;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.speaker-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  margin: 0 auto 0.75rem;
  border: 3px solid var(--accent);
  padding: 3px;
  transition: transform 0.3s;
  background: var(--bg-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--accent);
}

.speaker-card:hover .speaker-avatar {
  transform: scale(1.05);
}

.speaker-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.speaker-name {
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.speaker-status {
  font-size: 0.75rem;
  color: #666;
  background: #e8e8e8;
  padding: 0.1rem 0.4rem;
  border-radius: 0.75rem;
}

.speaker-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ============================================
   PLAYER PAGE
   ============================================ */

.player-container {
  background: var(--bg-primary);
  overflow-x: hidden;
}

.player-container > .back-link {
  display: block;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem 0;
}

.player-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1rem 2rem 2rem;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}

.player-video-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.video-wrapper {
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  width: 100%;
  max-width: 100%;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-info {
  flex: 1;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

.player-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.player-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

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

/* Speaker link in player meta */
.speaker-link {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

a.speaker-link:hover {
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
}

/* Previous/Next Series Navigation */
.series-nav {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.series-nav-item {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.series-nav-item:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
}

.series-nav-item.empty {
  visibility: hidden;
}

.series-nav-item.next {
  text-align: right;
  justify-content: flex-end;
}

.series-nav-thumb {
  width: 80px;
  min-width: 80px;
  max-width: 80px;
  height: 45px;
  min-height: 45px;
  max-height: 45px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-hover);
  flex-shrink: 0;
}

.series-nav-thumb.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
}

.series-nav-thumb.no-image::after {
  content: '';
  width: 50%;
  height: 50%;
  background: url('/u/orglogo.png') center/contain no-repeat;
  opacity: 0.4;
}

.series-nav-thumb img {
  width: 80px !important;
  height: 45px !important;
  max-width: 80px !important;
  max-height: 45px !important;
  object-fit: cover !important;
  display: block !important;
}

.series-nav-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.series-nav-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.series-nav-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

@media (max-width: 600px) {
  .series-nav {
    gap: 0;
    margin-left: -1rem;
    margin-right: -1rem;
    margin-top: 0;
    padding: 0;
    border-top: none;
    width: auto;
    left: 0;
    right: 0;
    box-sizing: border-box;
  }

  .series-nav-thumb {
    display: none;
  }

  .series-nav-item {
    padding: 0.75rem 1rem;
    flex: 1 1 0;
    border-radius: 0;
    min-width: 0;
  }
}

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

.player-tag {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 0.35rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.player-tag:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* Sidebar */
.player-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-self: start;
}

.sidebar-section {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  /* Match video height: (container - sidebar - gap - padding) * 9/16 aspect ratio */
  /* At max container 1400px: (1400 - 340 - 32 - 64) * 9/16 = 542px */
  max-height: calc((min(100vw, 1400px) - 340px - 2rem - 4rem) * 9 / 16);
}

.sidebar-section .episode-list {
  flex: 1;
  min-height: 0;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-title i {
  color: var(--accent);
}

.episode-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 450px;
  overflow-y: auto;
}

.episode {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
}

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

.episode.current {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
}

.episode-thumb {
  width: 100px;
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-hover);
}

.episode-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.episode-thumb.no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #333;
}

.episode-thumb.no-image::after {
  content: '';
  width: 50%;
  height: 50%;
  background: url('/u/orglogo.png') center/contain no-repeat;
  opacity: 0.4;
}

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

.episode-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.episode-title {
  font-size: 0.9rem;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-number {
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  flex-shrink: 0;
}

.episode-speaker,
.episode-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.show-more-btn {
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.show-more-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

.show-more-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.show-more-btn i {
  font-size: 0.75rem;
}

.show-more-section {
  display: flex;
  justify-content: center;
  padding: 0 0 1.5rem;
  margin-top: -2rem;
}

.show-more-section .show-more-btn {
  width: auto;
  min-width: 200px;
  background: var(--accent);
  color: white;
  border: none;
  padding: 0.875rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
}

.show-more-section .show-more-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  color: white;
  border-color: transparent;
}

/* ============================================
   VIDEO PLAYER STYLES
   ============================================ */

.video-js {
  width: 100%;
  height: 100%;
}

.video-js .vjs-big-play-button {
  background: var(--accent) !important;
  border: none !important;
  border-radius: 50% !important;
  width: 80px !important;
  height: 80px !important;
  line-height: 80px !important;
  margin-left: -40px !important;
  margin-top: -40px !important;
}

.video-js:hover .vjs-big-play-button {
  background: var(--accent-hover) !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
  .player-main {
    grid-template-columns: 1fr;
    padding: 1rem;
    display: flex;
    flex-direction: column;
  }

  .player-video-area {
    width: 100%;
    order: 1;
  }

  .player-sidebar {
    position: static;
    order: 2;
    width: 100%;
  }

  .sidebar-section {
    max-height: none;
    border-radius: 0;
    margin-left: -1rem;
    margin-right: -1rem;
    border-left: none;
    border-right: none;
  }

  .series-nav {
    order: 3;
    margin-top: 0;
    width: 100%;
  }

  .video-wrapper {
    border-radius: 0;
  }

  .episode-list {
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 768px) {
  .theme-switcher {
    top: auto;
    bottom: 1rem;
    right: 1rem;
    left: 1rem;
  }

  .theme-options {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .theme-option {
    flex: 1;
    min-width: 80px;
    justify-content: center;
  }

  .theme-name {
    display: none;
  }

  .nav-links {
    display: none;
  }

  .search-bar {
    width: 200px;
  }

  .hero-search {
    top: 1rem;
    right: 1rem;
  }

  .hero-search .search-bar {
    min-width: 130px;
    width: auto;
  }

  .hero-content {
    padding-top: 3rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .content {
    padding: 1.5rem 1rem;
  }

  .section {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .series-grid {
    grid-template-columns: 1fr;
  }

  .message-card {
    width: 280px;
  }

  .scroll-arrow {
    display: none;
  }

  .player-title {
    font-size: 1.5rem;
  }

  .player-main {
    padding: 1rem;
    gap: 1.5rem;
  }
}

/* ============================================
   MESSAGE/FULL SERVICE TOGGLE
   ============================================ */

.player-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.player-header-row .player-title {
  margin: 0;
}

.player-mode-toggle {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

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

.mode-btn.active:hover {
  background: var(--accent-hover);
}
