/* Positive Mind Theme Elements */
:root {
  --pm-primary: #38bdf8; /* Sky Blue */
  --pm-secondary: #f0f9ff; /* Soft Light Blue */
  --pm-accent: #0ea5e9; /* Ocean Blue */
  --pm-text: #1e293b; /* Deep Slate for text */
  --pm-bg: #ffffff;
  --pm-glass: rgba(255, 255, 255, 0.7);
  --pm-blur: blur(12px);
}

.chapter-hero.positive-mind-theme {
  background-color: #f0f9ff;
  background-image: 
    radial-gradient(#bae6fd 0.8px, transparent 0.8px),
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.95) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(56, 189, 248, 0.15) 0%, transparent 50%),
    linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  background-size: 24px 24px, 100% 100%, 100% 100%, 100% 100%;
  
  border: 1px solid rgba(186, 230, 253, 0.3);
  box-shadow: 0 30px 60px -10px rgba(14, 165, 233, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  padding: 2.5rem 1.5rem;
  margin-bottom: 3.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(15px);
  transition: transform 0.4s cubic-bezier(0.23, 1, 0.32, 1), box-shadow 0.4s ease;
}

.chapter-hero.positive-mind-theme:hover {
  transform: translateY(-5px);
  box-shadow: 0 40px 70px -10px rgba(14, 165, 233, 0.2);
}

.chapter-hero.positive-mind-theme::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: 30px;
  background: linear-gradient(125deg, rgba(255,255,255,0) 40%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 60%);
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  background-size: 200% 200%;
  mix-blend-mode: overlay;
  transition: opacity 0.5s ease;
}

.chapter-hero.positive-mind-theme:hover::after {
  opacity: 1;
}

/* =========================================
   Video Theater Container (Hero Mode)
   ========================================= */
.video-theater-container.hero-video-mode {
  width: 260px;
  max-width: 90%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 0 auto 1rem;
  padding: 0;
  border-radius: 20px;
  background: #000;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
  border: 5px solid #fff;
  cursor: pointer;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 10;
  overflow: hidden;
}

.video-theater-container.hero-video-mode.is-playing {
  width: 100%;
  max-width: 900px;
  border-radius: 20px;
}

.video-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  overflow: hidden;
}

.video-theater-container.hero-video-mode .video-frame {
  padding-top: 0;
}

.video-theater-container.hero-video-mode.is-playing .video-frame {
  padding-top: 56.25%;
}

.video-frame video {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.video-overlay, .video-replay-overlay {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  z-index: 20; transition: all 0.4s ease;
  text-align: center;
}

.video-overlay {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(0px);
}

.video-theater-container.hero-video-mode:hover .video-overlay {
  background: rgba(255, 255, 255, 0.2);
}

.video-replay-overlay {
  background: rgba(0, 0, 0, 0.7);
  opacity: 0; visibility: hidden;
  backdrop-filter: blur(8px);
  color: #fff;
}

.video-theater-container.is-playing .video-overlay { opacity: 0; visibility: hidden; }
.video-theater-container.is-finished .video-replay-overlay { opacity: 1; visibility: visible; }

.play-circle {
  width: 60px; height: 60px;
  background: linear-gradient(135deg, #ff0000, #cc0000); /* YouTube Red Gradient */
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 25px rgba(255, 0, 0, 0.4);
  transition: all 0.3s ease;
}

.video-theater-container.hero-video-mode.is-playing .play-circle {
  width: 80px; height: 80px;
}

.play-circle i { color: white; font-size: 1.5rem; transform: translateX(2px); }
.play-text {
  color: #cc0000; margin-top: 1rem; font-weight: 800; font-size: 0.75rem;
  letter-spacing: 0.15em; text-transform: uppercase;
  text-align: center; width: 100%; display: block;
}

.play-trigger {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.video-theater-container.is-playing .play-text { display: none; }

/* Progress Bar */
.video-controls-ui {
  position: absolute; bottom: 0; left: 0; width: 100%;
  padding: 1rem 1.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  opacity: 0; transition: opacity 0.3s;
  display: flex; align-items: center; gap: 1rem; z-index: 30;
}

.video-theater-container.is-playing:hover .video-controls-ui { opacity: 1; }

.progress-bar-container {
  flex: 1; height: 6px; background: rgba(255,255,255,0.3);
  border-radius: 3px; cursor: pointer; overflow: hidden;
}

.progress-bar-fill { height: 100%; background: #ff0000; width: 0%; border-radius: 3px; box-shadow: 0 0 10px rgba(255, 0, 0, 0.4); }
.time-display { color: #fff; font-size: 0.8rem; font-weight: 700; min-width: 80px; text-align: right; }

/* Volume Controls */
.volume-control {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-left: 1rem;
  padding: 5px 12px;
  background: rgba(0, 0, 0, 0.2); /* Slight dark background to define area */
  border-radius: 30px;
  backdrop-filter: blur(5px);
  z-index: 100;
}

.mute-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, color 0.2s;
  font-size: 1.2rem;
}

.mute-btn:hover {
  transform: scale(1.1);
  color: #ff0000;
}

.volume-slider-bg {
  width: 80px;
  height: 10px; /* Thicker for better hit area */
  background: rgba(255, 255, 255, 0.3);
  border-radius: 5px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.volume-slider-bg:hover {
  background: rgba(255, 255, 255, 0.5);
}

.video-theater-container.hero-video-mode:not(.is-playing) .volume-control {
  display: none; /* Hide entire control when not playing */
}

.volume-slider-fill {
  width: 100%;
  height: 100%;
  background: #ff0000;
  border-radius: 5px;
  box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

.positive-mind-theme .hero-top-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0ea5e9;
  letter-spacing: 0.1em;
}

.positive-mind-theme .hero-main-title {
  font-size: 2.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #0369a1, #0ea5e9);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0.5rem;
}

/* Blob Colors */
.blob-1 { background-color: rgba(56, 189, 248, 0.3) !important; }
.blob-2 { background-color: rgba(14, 165, 233, 0.2) !important; }

/* Step Headers Enhanced */
.step-header {
  color: #0369a1;
  border-bottom: 2px dashed #bae6fd;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.step-badge {
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  color: white;
  padding: 0.3rem 1.2rem;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.8rem;
  box-shadow: 0 4px 10px rgba(14, 165, 233, 0.2);
}

.step-title {
  font-family: "Zen Kurenaido", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0;
}

/* --- Category Hub Grid --- */
.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 4rem;
}

.category-card {
  background: var(--pm-glass);
  backdrop-filter: var(--pm-blur);
  -webkit-backdrop-filter: var(--pm-blur);
  border-radius: 24px;
  padding: 2.2rem 1.5rem;
  text-align: center;
  transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.04);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.5);
  position: relative;
}

.category-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 45px rgba(14, 165, 233, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  background: rgba(255, 255, 255, 0.95);
}

.card-icon {
  width: 70px;
  height: 70px;
  background: #fff;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  box-shadow: 0 8px 20px rgba(0,0,0,0.04);
  color: #38bdf8;
  font-size: 2rem;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
  background: #f0f9ff;
}

.card-content h4 {
  font-family: "Zen Kurenaido", sans-serif;
  font-weight: 700;
  color: #0f172a;
  font-size: 1.25rem;
  margin: 0 0 0.75rem 0;
  line-height: 1.4;
}

.card-content p {
  font-size: 0.85rem;
  color: #64748b;
  line-height: 1.6;
  margin: 0;
}

/* =========================================
   HUB Dashboard (Roulette)
   ========================================= */
.hub-dashboard {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2.5rem;
}

@media (max-width: 991px) {
    .hub-dashboard { grid-template-columns: 1fr; }
}

.intro-text {
  text-align: left;
  margin: 0;
  color: #64748b;
  line-height: 1.7;
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 3px solid #38bdf8;
  padding-left: 1.5rem;
}

.recommend-card.compact {
  background: #fff;
  border-radius: 20px;
  padding: 1.5rem 1.8rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border: 1px solid #EBEBEB;
  position: relative;
}

.recommend-content h3 {
  font-size: 1.1rem;
  color: #1e293b;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}
.recommend-content h3 i { color: #38bdf8; }
.recommend-content p { color: #94a3b8; font-size: 0.85rem; margin: 0; }

.btn-premium.mini { padding: 0.7rem 1.2rem; font-size: 0.9rem; }
.btn-premium {
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.2);
  white-space: nowrap;
}

.btn-premium:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 30px rgba(14, 165, 233, 0.3);
}

.recommended-highlight {
  border: 2px solid #38bdf8 !important;
  background-color: #f0f9ff !important;
}

.recommend-badge {
  position: absolute;
  top: -15px;
  right: -10px;
  padding: 0.3rem 0.8rem;
  background: #0ea5e9;
  color: white;
  font-weight: 700;
  font-size: 0.75rem;
  border-radius: 9999px;
  border: 2px solid #fff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 30;
  pointer-events: none;
}

@keyframes popIn {
  from { transform: scale(0) rotate(-10deg); opacity: 0; }
  to { transform: scale(1) rotate(0); opacity: 1; }
}

/* =========================================
   3-Column Layout Overrides (Matching Simple Life)
   ========================================= */
@media (min-width: 920px) {
  .layout-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 3rem;
    padding: 4rem 2% 8rem 2%;
    max-width: none;
    width: 100%;
    margin: 0;
  }
  .sidebar { grid-column: 1; width: 100% !important; order: 1; grid-row: 1 / span 2; }
  .main-content { grid-column: 2; width: 100% !important; margin: 0 auto; order: 2; }
  .sidebar-discovery {
    grid-column: 2; width: 100%; position: relative; margin-top: 4rem; display: block !important; order: 3;
  }
}

@media (min-width: 1200px) {
  .layout-container { grid-template-columns: 240px 1fr 320px; gap: 4rem; }
  .sidebar-discovery { grid-column: 3; position: sticky; top: calc(var(--nav-height) + 3rem); margin-top: 0; }
}

@media (min-width: 1400px) {
  .layout-container { grid-template-columns: 260px 1fr 380px; gap: 8rem; padding-left: 5%; padding-right: 5%; }
  .main-content { max-width: 1000px; }
}

@media (max-width: 919px) {
  .sidebar-discovery { display: block !important; width: 100%; order: 3; margin-top: 4rem; position: relative; }
  .layout-container { display: flex; flex-direction: column; padding-left: 5%; padding-right: 5%; }
  .main-content { order: 1; max-width: 100% !important; width: 100% !important; }
  .sidebar { order: 2; margin-top: 3rem; width: 100% !important; }
}

/* Discovery Box Box */
.discovery-box {
  background: #fff;
  border-radius: 24px;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03);
  border: 1px solid #f1f5f9;
  height: auto;
}

.discovery-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.discovery-header h3 { font-size: 1rem; font-weight: 800; color: #475569; display: flex; align-items: center; gap: 0.5rem; }

.btn-shuffle {
  background: #f0f9ff; border: none; color: #38bdf8; cursor: pointer;
  width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease;
}
.btn-shuffle:hover { background: #38bdf8; color: white; transform: rotate(180deg); }

.discovery-cards { perspective: 1000px; }
.discovery-card {
  background: #fff; border-radius: 16px; padding: 1.25rem; margin-bottom: 1.25rem;
  border: 1px solid #f1f5f9; text-decoration: none; display: block; position: relative;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03); color: inherit;
  backface-visibility: hidden; transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.discovery-card:hover { transform: translateY(-5px) scale(1.03); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08); border-color: #38bdf8; z-index: 10; }
.discovery-card.flipping { animation: flipVert 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

@keyframes flipVert {
  0% { transform: rotateX(0deg); opacity: 1; }
  45% { transform: rotateX(-90deg); opacity: 0.5; }
  55% { transform: rotateX(90deg); opacity: 0.5; }
  100% { transform: rotateX(0deg); opacity: 1; }
}

.discovery-card .card-tag { font-size: 0.65rem; font-weight: 800; color: #0ea5e9; background: #f0f9ff; padding: 0.2rem 0.6rem; border-radius: 50px; margin-bottom: 0.6rem; display: inline-block; }
.discovery-card .card-title { font-size: 1rem; font-weight: 800; color: #1e293b; margin-bottom: 0.5rem; }
.discovery-card .card-desc { font-size: 0.85rem; color: #64748b; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
