/* css/pages/love_and_healing.css */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;700;800&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

:root {
  --healing-primary: #fff5f7;
  --healing-secondary: #fce4ec;
  --healing-accent: #f06292;
  --healing-text: #5d4037;
  --healing-gradient: linear-gradient(135deg, #fff5f7 0%, #fce4ec 100%);
  --healing-glow: rgba(240, 98, 146, 0.4);
  
  /* New Thematic Colors */
  --healing-pink: #f06292;
  --healing-blue: #4fc3f7;
  --healing-green: #81c784;
}

.main-content {
  animation: fadeIn 0.8s ease-out;
}

/* Hero Section */
.chapter-hero {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--healing-gradient);
  border-radius: 30px;
  margin-bottom: 3rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(240, 98, 146, 0.1);
}

.chapter-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, transparent 70%);
  opacity: 0.6;
  animation: pulseGlow 8s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); opacity: 0.4; }
    100% { transform: scale(1.1) translate(2%, 2%); opacity: 0.7; }
}

.hero-inner {
  position: relative;
  z-index: 1;
  perspective: 1000px;
  transform-style: preserve-3d;
}

.hero-icon-wrap {
  font-size: 3.5rem;
  color: var(--healing-accent);
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.chapter-hero h1 {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-size: 2.5rem;
  color: var(--healing-text);
  margin-bottom: 1rem;
}

.chapter-hero h1 span {
  display: block;
  font-size: 1.5rem;
  font-weight: 400;
  opacity: 0.8;
  margin-top: 0.5rem;
}

.chapter-hero .line {
    width: 60px;
    height: 4px;
    background: var(--healing-accent);
    margin: 1.5rem auto 0;
    border-radius: 2px;
}

.scroll-down-indicator {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    color: var(--healing-accent);
    font-size: 1.2rem;
    animation: bounce 2s infinite;
    opacity: 0.6;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Intro & Recommendation */
.intro-text {
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--healing-text);
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
}

.recommend-section {
    text-align: center;
    margin-bottom: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.recommend-label {
    font-size: 1rem;
    color: var(--healing-text);
    font-weight: 500;
    opacity: 0.8;
}

.recommend-label i {
    margin-left: 0.5rem;
    color: var(--healing-accent);
    animation: slideRight 2s infinite;
}

@keyframes slideRight {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(5px); }
}

.btn-healing-slim {
    background: white;
    color: var(--healing-accent);
    border: 1px solid var(--healing-secondary);
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 15px rgba(240, 98, 146, 0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
    border: none;
    background: linear-gradient(white, white) padding-box,
                linear-gradient(135deg, var(--healing-accent), var(--healing-blue)) border-box;
    border: 2px solid transparent;
}

.btn-healing-slim i {
    font-size: 1.1rem;
    transition: transform 0.4s ease;
}

.btn-healing-slim:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 25px rgba(240, 98, 146, 0.2);
    color: white;
    border-color: transparent;
}

.btn-healing-slim::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--healing-accent), var(--healing-blue));
    z-index: -1;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: scaleX(0);
    transform-origin: right;
}

.btn-healing-slim:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

.btn-healing-slim:hover i {
    transform: rotate(20deg) scale(1.2);
}

.recommend-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: white;
    color: var(--healing-accent);
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 800;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    animation: badgePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes badgePop {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Highlight Animations */
.recommended-highlight-pink { animation: highlightPink 2s ease-out; }
.recommended-highlight-blue { animation: highlightBlue 2s ease-out; }
.recommended-highlight-green { animation: highlightGreen 2s ease-out; }

@keyframes highlightPink {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    50% { box-shadow: 0 0 0 10px rgba(240, 98, 146, 0.2); border-color: var(--healing-pink); }
}
@keyframes highlightBlue {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    50% { box-shadow: 0 0 0 10px rgba(79, 195, 247, 0.2); border-color: var(--healing-blue); }
}
@keyframes highlightGreen {
    0%, 100% { box-shadow: 0 0 0 0 transparent; }
    50% { box-shadow: 0 0 0 10px rgba(129, 199, 132, 0.2); border-color: var(--healing-green); }
}

/* Method Groups */
.method-group {
  margin-bottom: 5rem;
}

.group-title {
  font-size: 1.5rem;
  color: var(--healing-text);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--healing-secondary);
}

.group-title i {
  color: var(--healing-accent);
}

/* Category Grid & Tiles */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.category-tile {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 2.5rem 2rem;
  border-radius: 20px;
  text-decoration: none;
  color: var(--healing-text);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  border: 1px solid rgba(252, 228, 236, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
  position: relative;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px);
}

.category-tile.reveal {
    opacity: 1;
    transform: translateY(0);
}

.category-tile i {
  font-size: 2.5rem;
  color: var(--healing-accent);
  margin-bottom: 1.5rem;
  transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: floatIcon 4s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-8px) rotate(3deg); }
}

.tile-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.tile-desc {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.8;
}

.category-tile:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 40px rgba(240, 98, 146, 0.12);
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--healing-accent);
}

.category-tile:hover i {
  transform: scale(1.2) rotate(5deg);
  animation: none;
}

/* Color Variants */
.group-destiny .group-title i, 
.group-destiny .category-tile i { color: var(--healing-pink); }
.group-destiny .category-tile.reveal { border-color: rgba(240, 98, 146, 0.2); }
.group-destiny .category-tile:hover { border-color: var(--healing-pink); box-shadow: 0 20px 40px rgba(240, 98, 146, 0.15); }

.group-leadership .group-title i,
.group-leadership .category-tile i { color: var(--healing-blue); }
.group-leadership .category-tile.reveal { border-color: rgba(79, 195, 247, 0.2); }
.group-leadership .category-tile:hover { border-color: var(--healing-blue); box-shadow: 0 20px 40px rgba(79, 195, 247, 0.15); }

.group-present .group-title i,
.group-present .category-tile i { color: var(--healing-green); }
.group-present .category-tile.reveal { border-color: rgba(129, 199, 132, 0.2); }
.group-present .category-tile:hover { border-color: var(--healing-green); box-shadow: 0 20px 40px rgba(129, 199, 132, 0.15); }

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .chapter-hero h1 {
    font-size: 2rem;
  }
  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================
   Layout Override for 3-Column
   ========================================= */
@media (min-width: 920px) {
    .hub-page .layout-container {
        display: grid;
        grid-template-columns: 240px 1fr; 
        gap: 3rem;
        padding: 4rem 2% 8rem 2%; 
        max-width: none;
        width: 100%;
        margin: 0;
    }

    .hub-page .sidebar {
        grid-column: 1;
        width: 100% !important;
        order: 1; 
        grid-row: 1 / span 2; 
    }

    .hub-page .main-content {
        grid-column: 2;
        width: 100% !important;
        margin: 0 auto;
        order: 2; 
    }

    .hub-page .sidebar-discovery {
        grid-column: 2; 
        width: 100%;
        position: relative; 
        top: 0;
        margin-top: 4rem;
        display: block !important;
        order: 3; 
    }
}

@media (min-width: 1200px) {
    .hub-page .layout-container {
        grid-template-columns: 240px 1fr 320px; 
        gap: 4rem;
    }

    .hub-page .sidebar-discovery {
        grid-column: 3; 
        position: sticky;
        top: calc(var(--nav-height) + 3rem);
        margin-top: 0;
    }
}

@media (min-width: 1400px) {
    .hub-page .layout-container {
        grid-template-columns: 260px 1fr 380px;
        gap: 8rem;
        padding-left: 5%;
        padding-right: 5%;
    }
    .hub-page .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
   ========================================= */
.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, #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;
    text-shadow: none;
}

.play-trigger {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.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; }
