/* Simple Life Theme Elements */
:root {
  --sl-primary: #8c9986; /* Sage Green */
  --sl-secondary: #f4f5f3; /* Soft Light Gray */
  --sl-accent: #c9a96e; /* Gold/Brass for accents */
  --sl-text: #444b40; /* Deep Moss Green for text */
  --sl-bg: #ffffff;
  --sl-glass: rgba(255, 255, 255, 0.7);
  --sl-blur: blur(12px);
}

.chapter-hero.simple-life-theme {
  background-color: #fcfdfe;
  background-image: 
    radial-gradient(#a3b899 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(163, 184, 153, 0.15) 0%, transparent 50%),
    linear-gradient(135deg, #f4f7f2 0%, #edf1ea 100%);
  background-size: 24px 24px, 100% 100%, 100% 100%, 100% 100%;
  
  border: 1px solid rgba(163, 184, 153, 0.3);
  box-shadow: 0 30px 60px -10px rgba(74, 93, 68, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  padding: 2.5rem 1.5rem; /* Reduced to bring content up */
  margin-bottom: 3.5rem; /* Reduced space below hero */
  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.simple-life-theme:hover {
  transform: translateY(-5px);
  box-shadow: 0 40px 70px -10px rgba(108, 122, 101, 0.2);
}

.chapter-hero.simple-life-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.simple-life-theme:hover::after {
  opacity: 1;
}

/* =========================================
   Video Theater Container (Hero Mode)
   ========================================= */
.video-theater-container.hero-video-mode {
  width: 260px; /* Slightly smaller base size */
  max-width: 90%;
  aspect-ratio: 16 / 9;
  height: auto;
  margin: 0 auto 1rem; /* Reduced bottom margin */
  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; }

.simple-life-theme .hero-top-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: #7fa071; /* brighter text */
  letter-spacing: 0.1em;
}

.simple-life-theme .hero-main-title {
  font-size: 2.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #5b7553, #a3b899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 0.5rem;
}

/* Base override for layout/decorations */
.blob-1 {
  background-color: rgba(163, 184, 153, 0.4) !important;
}
.blob-2 {
  background-color: rgba(242, 166, 141, 0.3) !important;
}

/* Category Special Styles */
.category-basic .group-title {
  color: #7fa071;
  border-bottom: 2px dashed #a3b899;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}
.category-organize .group-title {
  color: #6ba1c4; /* brighter blue-grey */
  border-bottom: 2px dashed #9bc3df;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}
.category-items .group-title {
  color: #bfa688; /* warmer, less muddy brown */
  border-bottom: 2px dashed #e0caad;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
}

/* --- Compact Premium Category Tiles --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Slightly narrower minmax */
  gap: 1.5rem; /* Tighter gap */
  margin-bottom: 4rem;
  perspective: 1500px;
}

.method-group .category-tile {
  background: var(--sl-glass);
  backdrop-filter: var(--sl-blur);
  -webkit-backdrop-filter: var(--sl-blur);
  border-radius: 24px; /* Slightly tighter radius */
  padding: 2.2rem 1.5rem; /* Compact padding */
  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;
  z-index: 1;
  overflow: visible;
  transform-style: preserve-3d;
}

.method-group .category-tile::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border-radius: inherit;
  background: radial-gradient(circle at center, var(--sl-primary), transparent 70%);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.5s ease;
  filter: blur(30px);
}

.method-group .category-tile:hover {
  transform: translateY(-8px) rotateX(4deg) scale(1.01);
  box-shadow: 0 20px 45px rgba(140, 153, 134, 0.12);
  border-color: rgba(140, 153, 134, 0.3);
  background: rgba(255, 255, 255, 0.95);
}

.method-group .category-tile:hover::after {
  opacity: 0.12;
}

/* Compact Icon Wrapper */
.tile-icon-wrapper {
  width: 70px; /* Reduced from 90 */
  height: 70px;
  background: #fff;
  border-radius: 20px; /* Square with rounded corners for a modern feel */
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem; /* Tighter margin */
  box-shadow: 0 8px 20px rgba(0,0,0,0.04);
  position: relative;
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-tile:hover .tile-icon-wrapper {
  transform: translateZ(20px) scale(1.05) rotate(3deg);
}

.tile-icon-wrapper i {
  font-size: 2rem; /* Compact icon */
}

/* Compact Tile Tag */
.tile-tag {
  display: inline-block;
  padding: 0.25rem 0.8rem; /* Tighter padding */
  background: rgba(140, 153, 134, 0.08); /* Softer background */
  color: var(--sl-primary);
  border-radius: 4px; /* Smaller radius for tag */
  font-size: 0.7rem; /* Tiny tag */
  font-weight: 700;
  margin-bottom: 0.75rem; /* Tighter margin */
  letter-spacing: 0.05em;
  border-bottom: 2px solid rgba(140, 153, 134, 0.1); /* Underline style instead of full border */
}

.tile-title {
  font-family: "Kaisei Opti", serif;
  font-weight: 700;
  color: var(--sl-text);
  font-size: 1.25rem; /* Slightly smaller title */
  margin-bottom: 0.75rem;
  line-height: 1.4;
  display: block;
}

.tile-desc {
  font-size: 0.85rem; /* Slightly smaller description */
  color: #777;
  line-height: 1.6;
  padding: 0 0.5rem;
  opacity: 0.9;
}

/* Icon Color Variations */
.category-basic .tile-icon-wrapper i { color: #8c9986; }
.category-organize .tile-icon-wrapper i { color: #557a95; }
.category-items .tile-icon-wrapper i { color: #c2a582; }


/* Sidebar Specifics for Simple Life */
.sidebar .sidebar-advice {
  background: linear-gradient(135deg, #f9faf8, #f0f4ed) !important;
  border-left: 4px solid #8c9986 !important;
}
.sidebar .sidebar-advice .header {
  font-weight: bold;
  color: #4a5d44;
  margin-bottom: 0.5rem;
}

.sidebar-group-label {
  font-weight: 700;
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  color: #444;
  font-size: 0.95rem;
  border-bottom: 2px solid #ebebeb;
  padding-bottom: 5px;
}

/* Remove default dots from the custom lists if base classes don't already */
.recommendations-list li {
  list-style: none;
  margin-bottom: 0.5rem;
}
.recommendations-list a {
  text-decoration: none;
  color: #555;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}
.recommendations-list a:hover {
  color: var(--sl-primary);
  transform: translateX(3px);
}

/* =========================================
   Layout Override for 3-Column (PC & Split Screen)
   ========================================= */
@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 Sidebar / おすすめをさらに表示
   ========================================= */
.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: 100%;
}

.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: #eff6ff;
  border: none;
  color: #3b82f6;
  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: #3b82f6;
  color: white;
  transform: rotate(180deg);
}

/* Flap Card (3D Flip Animation System) */
.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;

  /* Animation Base */
  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: #3b82f6;
  z-index: 10;
}

/* Shuffle Animation (managed by container class) */
.discovery-cards.shuffling .discovery-card {
  animation: flipVert 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* pulse/Auto-Flap State (managed by single card class) */
.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: #3b82f6;
  background: #eff6ff;
  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;
}

/* =========================================
   HUB Dashboard (Roulette)
   ========================================= */
.hub-dashboard {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 2.5rem; /* Reduced from 3.5rem to pull tiles up */
}

@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 #8C9986;
  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;
  overflow: visible;
}

.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: #8C9986;
}

.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, #8C9986 0%, #6C7A65 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(140, 153, 134, 0.2);
  white-space: nowrap;
}

.btn-premium:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 30px rgba(140, 153, 134, 0.3);
}

/* =========================================
   Roulette & Highlight States
   ========================================= */
.recommended-highlight {
  border: 2px solid #8C9986 !important;
  background-color: #F9FAF8 !important;
  position: relative;
  z-index: 1; 
}

.recommend-badge {
  position: absolute;
  top: -15px;
  right: -10px;
  margin: 0;
  padding: 0.3rem 0.8rem;
  background: #8C9986;
  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; }
}
