/* =========================================
   Hero Section & Video Theater
   ========================================= */
.chapter-hero {
  background: linear-gradient(135deg, rgba(165, 243, 252, 0.8) 0%, rgba(56, 189, 248, 0.8) 100%);
  padding: 3.5rem 2rem 3rem; /* Tighter top/bottom padding */
  border-radius: 40px;
  text-align: center;
  margin-bottom: 3.5rem; /* Reduced from 5rem */
  position: relative;
  overflow: hidden;
  box-shadow: 0 30px 60px rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}

/* Video Theater Adaptation for Hero (YouTube-style Rectangular) */
.video-theater-container.hero-video-mode {
    width: 320px;
    max-width: 90%;
    aspect-ratio: 16 / 9;
    height: auto;
    margin: 0 auto 2rem; /* Reduced from 3rem */
    padding: 0;
    border-radius: 20px; /* Rounded card style */
    background: #000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    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; /* Use aspect-ratio in normal state */
}

.video-theater-container.hero-video-mode.is-playing .video-frame {
    padding-top: 56.25%; /* 16:9 when playing */
}

.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); } /* Visual balancing of triangle */
.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;
    width: 100%;
}

.video-theater-container.is-playing .play-text { display: none; }

.replay-trigger { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.replay-trigger i { font-size: 2.5rem; color: #fff; }

/* Video Seeker Styling */
.video-controls-ui {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
    padding: 2.5rem 1.2rem 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 30;
    pointer-events: none;
}

.video-theater-container.is-playing .video-controls-ui {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.progress-bar-container {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    transition: height 0.2s ease;
}

.progress-bar-container:hover {
    height: 8px;
}

.progress-bar-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: #ff0000; /* Red progress bar */
    border-radius: 3px;
    width: 0%;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.4);
}

.progress-bar-container::after {
    content: "";
    position: absolute;
    right: 100%;
    top: 50%;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transform: translate(50%, -50%);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    left: var(--progress, 0%);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-bar-container:hover::after {
    opacity: 1;
}

.time-display {
    color: #fff;
    font-size: 0.75rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Decorative Icons with Parallax Support */
.pharmacist-deco-1 {
    position: absolute;
    top: 15%;
    left: 8%;
    font-size: 7rem;
    color: rgba(255,255,255,0.15);
    transform: rotate(-20deg) translate(var(--mx, 0px), var(--my, 0px));
    pointer-events: none;
    transition: transform 0.2s ease-out;
}

.pharmacist-deco-2 {
    position: absolute;
    bottom: 8%;
    right: 8%;
    font-size: 8rem;
    color: rgba(255,255,255,0.15);
    transform: rotate(15deg) translate(var(--mx2, 0px), var(--my2, 0px));
    pointer-events: none;
    transition: transform 0.2s ease-out;
}

.chapter-hero:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(56, 189, 248, 0.35);
}

.hero-inner {
  position: relative;
  z-index: 2;
}

@keyframes float-icon {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.hero-icon-wrap i {
  font-size: 3rem;
  color: #0ea5e9;
  background: -webkit-linear-gradient(45deg, #0ea5e9, #6366f1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.chapter-hero h1 {
  margin: 0 auto;
  line-height: 1.4;
  color: #0f172a;
}

.hero-top-text {
  font-family: 'Outfit', 'Zen Kaku Gothic New', sans-serif;
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: #334155;
  display: inline-block;
  margin-bottom: 0.8rem;
  opacity: 0.85;
}

.hero-main-title {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 3.8rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg, #0f172a 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  position: relative;
  padding: 1rem 0;
  margin-top: 0.2rem;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  /* Gentle glow for the rounded text */
  filter: drop-shadow(0 4px 10px rgba(255, 255, 255, 0.3));
}

.chapter-hero:hover .hero-main-title {
  transform: translateY(-3px) scale(1.02);
  filter: drop-shadow(0 15px 30px rgba(59, 130, 246, 0.25));
}

.chapter-hero .line {
  margin: 1.5rem auto 0; /* Reduced from 2rem */
  width: 60px;
  background: #3b82f6; /* Accent color for the line */
  height: 4px;
  border-radius: 2px;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .hero-main-title {
    font-size: 2.4rem;
    padding: 0.4rem 1.2rem;
  }
}

/* =========================================
   HUB Dashboard (Intro & Quick Action)
   ========================================= */
.hub-dashboard {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    align-items: center;
    margin-bottom: 3.5rem; /* Reduced from 5rem */
}

.sidebar-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav-list li {
    margin-bottom: 0.2rem;
}

.sidebar-nav-list li a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 1rem;
    color: #64748b;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-nav-list li a i {
    font-size: 0.9rem;
    width: 1.2rem;
    text-align: center;
    color: #94a3b8;
}

.sidebar-nav-list li a:hover {
    background: #f1f5f9;
    color: #3b82f6;
}

.sidebar-nav-list li.active a {
    color: #3b82f6;
    font-weight: 800;
}

.sidebar-group-label {
    font-size: 0.7rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 1.5rem 0 0.5rem 1rem !important;
}

@keyframes bar-grow {
    from { height: 0; opacity: 0; }
    to { height: 18px; opacity: 1; }
}

.intro-text {
  text-align: left;
  margin: 0;
  color: #64748b;
  line-height: 1.7;
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 3px solid #e2e8f0;
  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 #e2e8f0;
  position: relative;
  overflow: visible; /* For badges */
}

.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 p {
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 0;
}

.btn-premium.mini {
    padding: 0.7rem 1.2rem;
    font-size: 0.9rem;
}

@media (max-width: 991px) {
    .hub-dashboard {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Premium Button Style (Ported from style.css) */
.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);
}

/* Selection Badge & Highlight (Ported from style.css) */
.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;
}

/* Fix for icon inside badge inheriting generic tile styles */
.recommend-badge i {
    font-size: 1rem !important;
    margin-bottom: 0 !important;
    color: white !important;
    margin-right: 4px;
}

@keyframes badge-pop {
  from {
    transform: scale(0) rotate(-10deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

/* Responsive adjustments for Rec-Card */
@media (max-width: 768px) {
  .recommend-card {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
  }

  .recommend-content h3 {
    justify-content: center;
  }

  #recommend-btn {
    width: 100%;
  }
}

/* =========================================
   Method Groups (Categories)
   ========================================= */
.method-group {
  margin-bottom: 3.5rem; /* Reduced from 5rem */
}

.group-title {
  font-size: 1.3rem; /* Slightly smaller */
  color: #334155;
  margin-bottom: 1.5rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.group-title i {
  color: var(--accent-color, #0ea5e9);
  background: #e0f2fe;
  padding: 0.5rem;
  border-radius: 12px;
  font-size: 1.2rem;
}

/* =========================================
   Category Grid & Tiles
   ========================================= */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem; /* Tighter gap */
}

@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

.category-tile {
  background: #fff;
  border-radius: 20px;
  padding: 1.25rem; /* More compact padding */
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.01);
  border: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
  align-items: center; /* Centered */
  text-align: center; /* Centered text */
  position: relative;
  /* overflow: hidden; Removed to allow badge to pop out */
}

/* Staggered Animation for Grid Items */
/* Assumes parent .reveal triggers generic fade up. 
   We want distinct staggered items. 
   We can use the fact that .reveal.active is on the parent (.method-group).
*/
.method-group.active .category-tile {
    animation: fadeInUp 0.6s ease backwards;
}

.method-group.active .category-tile:nth-child(1) { animation-delay: 0.1s; }
.method-group.active .category-tile:nth-child(2) { animation-delay: 0.2s; }
.method-group.active .category-tile:nth-child(3) { animation-delay: 0.3s; }
/* ... up to 6 just in case */
.method-group.active .category-tile:nth-child(4) { animation-delay: 0.4s; }
.method-group.active .category-tile:nth-child(5) { animation-delay: 0.5s; }
.method-group.active .category-tile:nth-child(6) { animation-delay: 0.6s; }

.category-tile:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12);
  border-color: var(--aura-color, #e0f2fe);
}

/* Specific Hover Auras per group */
.method-group.group-mental { --aura-color: #f59e0b; }
.method-group.group-self   { --aura-color: #ec4899; }
.method-group.group-action { --aura-color: #06b6d4; }

.category-tile::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at center, var(--aura-color), transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: -1;
    filter: blur(25px);
}

.category-tile:hover::before {
    opacity: 0.15;
}

/* Icon Styling */
.category-tile > i {
  font-size: 2rem;
  margin-bottom: 1rem; /* Reduced from 1.5rem */
  color: #94a3b8;
  transition: all 0.3s ease;
  /* Circle Background */
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9; /* Default gray bg */
  border-radius: 50%;
}

/* Icon Bounce on Hover */
.category-tile:hover > i {
  transform: scale(1.1);
  animation: icon-bounce 0.4s ease;
  color: var(--accent-color, #0ea5e9);
}

@keyframes icon-bounce {
    0%, 100% { transform: scale(1.1); }
    50% { transform: scale(1.25); }
}

/* Specific Icon Colors per group logic if desired, 
   but keeping it clean with semantic colors is better */

.tile-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.5rem; /* Reduced from 0.8rem */
  line-height: 1.4;
}

.tile-desc {
  font-size: 0.95rem;
  color: #64748b;
  line-height: 1.6;
  line-height: 1.6;
  margin: 0;
}

/* Group Specific Icon Colors */
/* Mental - Orange */
.method-group.group-mental .category-tile > i {
    color: #f59e0b;
    background: #fffbeb; /* Light Orange BG */
}

/* Self - Pink */
.method-group.group-self .category-tile > i {
    color: #ec4899;
    background: #fdf2f8; /* Light Pink BG */
}

/* Action - Cyan/Green */
.method-group.group-action .category-tile > i {
    color: #06b6d4;
    background: #ecfeff; /* Light Cyan BG */
}

/* Decoration Circle on Hover */
.category-tile::after {
  content: "";
  position: absolute;
  top: -50px;
  right: -50px;
  width: 100px;
  height: 100px;
  background: radial-gradient(
    circle,
    var(--accent-color, #0ea5e9) 0%,
    transparent 70%
  );
  opacity: 0;
  border-radius: 50%;
  transition: opacity 0.4s ease;
  pointer-events: none;
  filter: blur(20px);
}

.category-tile:hover::after {
  opacity: 0.1;
}

/* Recommended Highlight State */
/* Recommended Highlight State (Ported from style.css) */
/* Highlight Animation */
/* Recommended Highlight State (Blue Focus) */
@keyframes highlight-pulse-blue {
  0% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0.4);
    border-color: #38bdf8;
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 20px rgba(14, 165, 233, 0);
    border-color: #0ea5e9;
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(14, 165, 233, 0);
    border-color: #38bdf8;
    transform: scale(1);
  }
}

.recommended-highlight {
  animation: highlight-pulse-blue 1.5s ease-out;
  border-color: #0ea5e9 !important; /* Sky Blue */
  background: #fff;
  z-index: 10;
}

/* =========================================
   Footer Actions (Back to Home)
   ========================================= */
.page-footer-actions {
    margin-top: 6rem;
    text-align: center;
    padding-top: 3rem;
    border-top: 1px dashed #e2e8f0;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1.2rem 2.5rem;
    background: #fff;
    color: #334155;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    font-family: 'Zen Maru Gothic', sans-serif;
}

.btn-back-home i {
    font-size: 1.2rem;
    color: #3b82f6;
    transition: transform 0.3s ease;
}

.btn-back-home:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.12);
    border-color: #3b82f6;
    color: #0f172a;
}

.btn-back-home:hover i {
    transform: scale(1.2) rotate(-10deg);
}

/* =========================================
   Background Blob Animation Support
   ========================================= */
.bg-decoration {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  filter: blur(100px);
  opacity: 0.4;
  border-radius: 50%;
  animation: move 40s infinite alternate cubic-bezier(0.45, 0, 0.55, 1);
}

.blob-1 {
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, #bae6fd 0%, rgba(186, 230, 253, 0) 70%);
  top: -200px;
  left: -200px;
}

.blob-2 {
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, #dcfce7 0%, rgba(220, 252, 231, 0) 70%);
  bottom: -150px;
  right: -150px;
  animation-delay: -10s;
}

@keyframes move {
  0% {
    transform: translate(0, 0) scale(1) rotate(0deg);
  }
  33% {
    transform: translate(100px, 50px) scale(1.1) rotate(10deg);
  }
  66% {
    transform: translate(-50px, 100px) scale(0.9) rotate(-10deg);
  }
  100% {
    transform: translate(50px, -50px) scale(1) rotate(0deg);
  }
}

/* =========================================
   Animations
   ========================================= */
.reveal {
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================
   3-Column Experimental Layout
   ========================================= */
/* =========================================
   Layout Override for 3-Column (PC & Split Screen)
   ========================================= */
/* =========================================
   Layout Override: 2-Column Mode (Split Screen / Tablet Landscape)
   Range: 920px - 1199px
   ========================================= */
@media (min-width: 920px) {
    .layout-container {
        display: grid;
        /* Left Sidebar | Main Content */
        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; /* Explicit Order */
        grid-row: 1 / span 2; /* Span across height */
    }

    .main-content {
        grid-column: 2;
        width: 100% !important;
        margin: 0 auto;
        order: 2; /* Explicit Order */
    }

    /* Right sidebar moves to bottom of main content column */
    .sidebar-discovery {
        grid-column: 2; /* Same column as main content */
        width: 100%;
        position: relative; /* No sticky */
        top: 0;
        margin-top: 4rem;
        display: block !important;
        order: 3; /* Explicit Order */
    }
}

/* =========================================
   Layout Override: 3-Column Mode (Full PC)
   Range: 1200px+
   ========================================= */
@media (min-width: 1200px) {
    .layout-container {
        grid-template-columns: 240px 1fr 320px; /* 3 Columns */
        gap: 4rem;
    }

    .sidebar-discovery {
        grid-column: 3; /* Global Right Side */
        position: sticky;
        top: calc(var(--nav-height) + 3rem);
        margin-top: 0;
    }
}

/* Large Screen Optimization */
@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; }
}

/* Response for Mobile & Tablet Portrait (Layout override) */
@media (max-width: 919px) {
    .sidebar-discovery {
        display: block !important;
        width: 100%;
        order: 3; /* Below the main content and navigation sidebar */
        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;
    }
}

/* Restored Premium Sidebar Styling */
.sidebar .sidebar-widget, 
.sidebar-discovery .sidebar-widget {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    border-radius: 24px;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    opacity: 1;
    filter: none;
    overflow: hidden;
}

.discovery-header h3 {
    margin: 0;
    font-size: 0.8rem; /* Compact size */
    color: #94a3b8; /* Subtle color */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em; /* Rich spacing */
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Flap Card (3D Flip Animation) */
.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);
    
    /* 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.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    border-color: #3b82f6;
    z-index: 10;
}

/* Flapping State (managed by JS) */
.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; }
}


@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.98) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.reveal-card {
    animation: scaleIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Discovery Sidebar Styling (Consolidated) */
.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;
}


