/* Page Specific CSS for Golden Laws Index */

:root {
  --essence-primary: #10b981; /* Green */
  --essence-secondary: #3b82f6; /* Blue */
  --essence-gold: #fbbf24;
  --essence-text: #1e293b;
  --essence-muted: #64748b;
}

/* --- Background Decoration Blobs (Steam & Light Effect) --- */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  background: #ffffff;
}

.blob {
  animation: steam-float 25s infinite alternate ease-in-out;
  opacity: 0.15;
}

.blob-1 {
  background: rgba(134, 239, 172, 0.4);
  width: 600px;
  height: 600px;
  top: -100px;
  right: -100px;
}

.blob-2 {
  background: rgba(125, 211, 252, 0.4);
  width: 700px;
  height: 700px;
  bottom: -150px;
  left: -150px;
  animation-delay: -5s;
}

@keyframes steam-float {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
    filter: blur(40px);
  }
  33% {
    transform: translate(50px, -40px) scale(1.1) rotate(20deg);
    filter: blur(50px);
  }
  66% {
    transform: translate(-30px, 60px) scale(0.9) rotate(-15deg);
    filter: blur(55px);
  }
  100% {
    transform: translate(20px, -20px) scale(1.05) rotate(10deg);
    filter: blur(45px);
  }
}

/* --- Hero Section --- */
.essence-hero {
  padding: 3rem 2rem 3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  z-index: 1;
  border-radius: 30px;
  background-color: #fefcbf;
  background-image: 
    radial-gradient(#fcd34d 0.8px, transparent 0.8px),
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.9) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(250, 204, 21, 0.2) 0%, transparent 50%),
    linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  background-size: 24px 24px, 100% 100%, 100% 100%, 100% 100%;
  box-shadow: 0 30px 60px -10px rgba(250, 204, 21, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px);
  margin-bottom: 5rem;
}

.essence-hero-content {
  position: relative;
  z-index: 5;
  max-width: 900px;
  margin: 0 auto;
}

.essence-icon-large {
  font-size: 5rem;
  color: #86efac;
  margin-bottom: 2rem;
  display: inline-block;
  opacity: 0.8;
  filter: drop-shadow(0 10px 20px rgba(134, 239, 172, 0.3));
  animation: float-slow 8s ease-in-out infinite;
}

@keyframes float-slow {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  50% {
    transform: translateY(-15px) rotate(5deg);
  }
}

.essence-hero h1 {
  font-family: "Zen Maru Gothic", "Outfit", sans-serif;
  font-size: 2.8rem;
  font-weight: 800;
  color: #1e293b; 
  margin-bottom: 1.5rem;
  line-height: 1.4;
  letter-spacing: 0.05em;
}

.essence-gradient-text {
  background: linear-gradient(
    135deg,
    #0ea5e9 0%,    /* Rich Blue */
    #14b8a6 100%   /* Teal */
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block; /* Prevent gradient wrapping issues on some breaks */
}

.essence-divider {
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #86efac, #7dd3fc);
  margin: 1.5rem auto;
  border-radius: 50px;
}

.essence-hero p {
  font-size: 1.1rem;
  color: #64748b;
  font-weight: 500;
  line-height: 1.8;
}

/* --- Recommendation Section --- */
.recommend-section {
  max-width: 800px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.recommend-card {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 30px;
  padding: 1.5rem 2.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.03);
}

.recommend-content {
  flex: 1;
}

.recommend-content h3 {
  font-size: 1.25rem;
  color: var(--essence-text);
  margin-bottom: 0.5rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recommend-content p {
  color: var(--essence-muted);
  font-size: 1rem;
  margin: 0;
}

.btn-premium {
  background: linear-gradient(135deg, #86efac 0%, #3b82f6 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(59, 130, 246, 0.2);
  white-space: nowrap;
}

.btn-premium:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.3);
}

.btn-premium:active {
  transform: translateY(-1px) scale(0.98);
}

/* --- Golden Laws Container --- */
.golden-laws-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
  position: relative;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.law-card {
  background: white;
  border-radius: 24px;
  padding: 1.5rem;
  display: flex;
  gap: 1.25rem;
  align-items: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border: 1px solid #f1f5f9;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  opacity: 0;
  transform: translateY(30px);
  position: relative;
  overflow: visible;
  cursor: pointer;
  min-height: 160px;
}

.law-card.reveal {
  opacity: 1;
  transform: translateY(0);
}

.law-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 20px 40px rgba(234, 179, 8, 0.15);
  border-color: #fde047;
}

.law-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: radial-gradient(
    circle at center,
    rgba(253, 224, 71, 0.2),
    transparent 70%
  );
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.law-card:hover::after {
  opacity: 1;
}

/* Shuffle Animation */
.law-card.shuffling {
  animation: card-shuffle 0.5s ease-in-out;
}

@keyframes card-shuffle {
  0%,
  100% {
    transform: translateX(0) scale(1);
  }
  25% {
    transform: translateX(-10px) rotate(-1deg);
  }
  75% {
    transform: translateX(10px) rotate(1deg);
  }
}

.law-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #fef9c3, #fde047);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--essence-primary);
  flex-shrink: 0;
  box-shadow: 0 5px 15px rgba(16, 185, 129, 0.15);
  z-index: 5;
}

.law-content {
  flex-grow: 1;
  z-index: 5;
}

.law-content h3 {
  font-size: 1.25rem;
  color: var(--essence-text);
  margin-bottom: 0.8rem;
  font-weight: 800;
}

.law-content p {
  color: var(--essence-muted);
  line-height: 1.7;
  margin: 0;
}

/* --- Special Effects --- */
.text-gold {
  background: linear-gradient(135deg, #d4af37 0%, #fcd34d 50%, #d4af37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

.law-card.golden-glow-card {
  border: 1px solid #fcd34d;
  box-shadow: 0 0 15px rgba(252, 211, 77, 0.3);
}

.recommend-badge {
  position: absolute;
  top: -20px;
  right: -10px;
  background: #10b981;
  color: white;
  padding: 0.6rem 1.4rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: bold;
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.4);
  z-index: 100;
  animation: badge-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  white-space: nowrap;
}

@keyframes badge-pop {
  from {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

.recommended-highlight {
  border-color: #10b981 !important;
  box-shadow: 0 0 30px rgba(16, 185, 129, 0.3) !important;
  background: rgba(255, 255, 255, 0.95) !important;
}

/* --- Footer Navigation --- */
.footer-nav-container {
  margin-top: 4rem;
  text-align: center;
  border-top: 1px solid #e2e8f0;
  padding-top: 2rem;
}

.back-home-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 2rem;
  border-radius: 50px;
  background: #f1f5f9;
  color: #64748b;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  border: 1px solid #cbd5e1;
}

.back-home-btn:hover {
  background: #e2e8f0;
  color: #475569;
  transform: translateY(-2px);
}

/* --- Sidebar Styles --- */
.sidebar {
  position: sticky !important;
  top: calc(var(--nav-height) + 2rem);
  height: fit-content;
  align-self: start;
}

.sticky-sidebar-wrapper {
  position: relative; /* Outer container handles stickiness */
}

.sidebar-advice {
  background: #ffffff;
  border: 1px solid #fdba74;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 15px rgba(253, 186, 116, 0.1);
}

.sidebar-advice .header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--essence-gold);
  font-weight: 800;
  margin-bottom: 1rem;
  font-size: 1rem;
  border-bottom: 1px dashed #fdba74;
  padding-bottom: 0.5rem;
}

.sidebar-advice-text {
  color: #431407;
  font-size: 0.9rem;
  line-height: 1.8;
}

.advice-highlight {
  color: #f97316;
  font-weight: 800;
  background: linear-gradient(transparent 70%, #ffedd5 70%);
}

.nav-box {
  margin-top: 2rem;
}

.nav-title {
  font-size: 1.1rem;
  color: var(--essence-text);
  margin-bottom: 0.8rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-separator {
  height: 2px;
  background: linear-gradient(to right, #86efac, transparent);
  margin: 1rem 0;
}

/* Checklist style for sidebar links */
.checklist-style li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
}

.checklist-style li::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  color: var(--essence-primary);
  font-size: 0.8rem;
}

/* Responsiveness */
@media (max-width: 900px) {
  .golden-laws-container {
    grid-template-columns: 1fr;
  }
  .essence-hero h1 {
    font-size: 2rem;
  }
  .recommend-card {
    flex-direction: column;
    text-align: center;
  }
}

/* =========================================
   Layout Override for 3-Column
   ========================================= */
@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;
    top: 0;
    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;
    top: 0;
    animation: fadeInUp 0.8s ease-out both;
  }

  .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
   ========================================= */ 
.sidebar-discovery .sidebar-widget {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    border-radius: 24px;
    padding: 1.5rem;
}

.discovery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 2px solid #e0f2fe;
}

.discovery-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: #1e293b;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.discovery-header h3 i {
    color: #3b82f6;
}

.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;
    box-shadow: 0 2px 5px rgba(59, 130, 246, 0.1);
}

.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;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
    display: inline-block;
}

.discovery-card .card-title {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.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;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   Video Theater Container
   ========================================= */
.essence-hero-content {
    perspective: 1000px;
    transform-style: preserve-3d;
}

.video-theater-container.hero-video-mode {
    width: 280px;
    max-width: 90%;
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 0 auto 1.5rem;
    padding: 0;
    border-radius: 20px;
    background: #000;
    /* Stronger shadow for 3D feel */
    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;
    transform-style: preserve-3d;
    transform: translateZ(40px); /* Most prominent element */
}

.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, #ef4444, #b91c1c); /* Red Gradient */
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 25px rgba(239, 68, 68, 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: #b91c1c; margin-top: 1rem; font-weight: 800; font-size: 0.8rem;
    letter-spacing: 0.15em; text-transform: uppercase;
    text-align: center; width: 100%; display: block;
    text-shadow: 0 0 5px rgba(255,255,255,0.8); /* Make it pop against video background */
}

.play-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.video-theater-container.is-playing .play-text { display: none; }

.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: #10b981; width: 0%; border-radius: 3px; box-shadow: 0 0 10px rgba(16, 185, 129, 0.4); }
.time-display { color: #fff; font-size: 0.8rem; font-weight: 700; min-width: 80px; text-align: right; }
