/* =========================================
   VOODOOLILY - MASTER STYLE.CSS
   Handles Library Menu, Credits, and the Storybook
========================================= */

/* --- 1. RESET & GLOBALS --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Baloo 2', 'Poppins', sans-serif;
  background-color: #1e293b; /* Calm dark blue background for menus */
  color: white;
  overflow-x: hidden;
}

/* --- 2. GLOBAL UI (HOME BUTTON) --- */
.home-button {
  position: absolute;
  top: 20px;
  left: 20px;
  background-color: rgba(255, 255, 255, 0.9);
  border: 3px solid #e2e8f0;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.2s;
  text-decoration: none;
}

.home-button:hover {
  transform: scale(1.1);
  background-color: white;
}

/* --- 3. LIBRARY MENU (index.html) --- */
.library-background {
  min-height: 100vh;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.library-header {
  text-align: center;
  margin-bottom: 40px;
}

.library-header h1 {
  font-size: 48px;
  color: #fcd34d; /* Warm yellow */
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.library-header p {
  font-size: 20px;
  color: #cbd5e1;
}

.bookshelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
  width: 90%;
  max-width: 1400px;
}

.book-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.cover-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9; /* Fits your landscape cover image */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0,0,0,0.4);
  background-color: #0f172a; 
}

.book-title {
  margin-top: 15px;
  font-size: 18px;
  text-align: center;
  color: white;
  font-family: 'Poppins', sans-serif;
}

/* Active Book Styles */
.active-book {
  cursor: pointer;
}

.active-book .book-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Prevents the image from stretching */
  transition: transform 0.3s ease;
  display: block;
}

.active-book:hover {
  transform: translateY(-10px);
}

.active-book:hover .book-image {
  transform: scale(1.05);
}

.active-book .cover-wrapper {
  border: 4px solid #10b981;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.6); /* Green glow effect */
}

/* Locked Book Styles */
.locked-book {
  cursor: not-allowed;
  opacity: 0.6;
}

.placeholder-cover {
  width: 100%;
  height: 100%;
  background-color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 50px;
  color: #64748b;
  border: 2px dashed #475569;
}

.locked-book .book-title {
  color: #94a3b8;
}

/* --- 4. CREDITS PAGE (credits.html) --- */
.credits-wrapper {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.credits-container {
  background-color: rgba(255, 255, 255, 0.95);
  padding: 30px 50px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  text-align: left;
  width: 90%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  border: 4px solid #334155;
  display: flex;
  flex-direction: column;
  position: relative;
  margin: 5vh auto; 
}

.credits-container h2 {
  color: #16a34a;
  font-size: 32px;
  margin-bottom: 15px;
  text-align: center;
}

.credits-text p {
  font-size: 16px;
  color: #334155;
  margin-bottom: 5px;
  line-height: 1.4;
}

.credits-text a {
  color: #2563eb;
  text-decoration: none;
  font-weight: bold;
}

.credits-text a:hover {
  text-decoration: underline;
}

.btn-start-story {
  display: inline-block;
  margin: 25px auto 0;
  background-color: #16a34a;
  color: white;
  text-decoration: none;
  padding: 15px 40px;
  font-size: 24px;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(22, 163, 74, 0.4);
  transition: transform 0.2s, background-color 0.2s;
  text-align: center;
}

.btn-start-story:hover {
  background-color: #15803d;
  transform: scale(1.05);
}

/* =========================================
   --- 5. STORYBOOK ENVIRONMENT (story.html) --- 
   ========================================= */

#storybook-container {
  width: 100vw;
  height: 100vh;
  position: relative;
  /* This loads your beautiful meadow background for the story */
  background-image: url('images/background.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden; 
}

.story-page {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease-in-out, visibility 1s;
}

.active-page {
  opacity: 1;
  visibility: visible;
}

/* Karaok Text Styling (اصلاح شده) */
.text-container {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  background-color: rgba(255, 255, 255, 0.9);
  padding: 15px 30px;
  border-radius: 20px;
  border: 4px solid #16a34a;
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
  text-align: center;
  z-index: 10;
}

.story-text {
  font-size: 36px;
  color: #333;
  line-height: 1.8; /* فاصله خطوط را بیشتر کردیم تا کلمات روی هم نیفتند */
}

.word {
  display: inline-block;
  transition: color 0.2s; /* فقط رنگ تغییر کند تا کادر به هم نریزد */
  margin: 0 3px; /* فاصله ظریف بین کلمات */
}

.word.highlight {
  color: #d35400; /* رنگ نارنجی برای هایلایت */
  /* دستورات scale و bold را حذف کردیم تا ظاهر کلمات به هم نریزد */
}
/* Characters and Assets Base */
.character, .static-asset {
  position: absolute;
  transition: all 1s ease;
}

.clickable-asset {
  position: absolute;
  cursor: pointer;
  transition: transform 0.2s;
}

.clickable-asset:hover {
  transform: scale(1.05);
}

/* --- Page Specific Placements --- */

/* Page 1 */
.moses-p1 { bottom: 10%; left: 10%; height: 60%; }

/* Page 2 */
.interactive-area { width: 100%; height: 100%; position: absolute; }
#bush-left { bottom: 15%; left: 15%; height: 30%; z-index: 5; }
#bush-center { bottom: 10%; left: 45%; height: 35%; z-index: 5; }
#bush-right { bottom: 15%; right: 15%; height: 30%; z-index: 5; }
#hidden-lamb { bottom: 12%; left: 48%; height: 25%; opacity: 0; transition: opacity 1s; z-index: 4; }

/* Page 3 */
.lake-destination { bottom: 5%; right: 5%; height: 25%; }
#walking-lamb { bottom: 20%; left: 10%; height: 25%; z-index: 6; }
.stones-container { width: 100%; height: 100%; position: absolute; }
.stone { height: 8%; z-index: 5; }
#stone-1 { bottom: 15%; left: 30%; }
#stone-2 { bottom: 12%; left: 50%; }
#stone-3 { bottom: 18%; left: 70%; }

/* Page 4 */
.lake-final { bottom: 5%; right: 5%; height: 25%; }
.moses-p4 { bottom: 10%; left: 5%; height: 50%; }
.lamb-p4 { bottom: 10%; right: 25%; height: 25%; }

/* Page 5 */
.moses-p5 { bottom: 15%; left: 40%; height: 60%; }
.lamb-p5 { bottom: 10%; left: 55%; height: 35%; }

/* Button to enter the Game (Page 5) */
.btn-next-game {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  background-color: #f59e0b;
  color: white;
  text-decoration: none;
  padding: 15px 40px;
  font-size: 26px;
  font-weight: bold;
  border-radius: 50px;
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.4);
  transition: transform 0.2s, background-color 0.2s;
  z-index: 10;
}

.btn-next-game:hover {
  background-color: #d97706;
  transform: translateX(-50%) scale(1.05);
}


/* --- 6. MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
  /* Menu Adjustments */
  .library-header h1 { font-size: 32px; }
  .library-header p { font-size: 16px; }
  .bookshelf-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }
  .book-title { font-size: 16px; }
  .credits-container { padding: 20px; width: 95%; margin-top: 80px; }
  
  /* Story Adjustments */
  .story-text { font-size: 24px; }
  .btn-start-story, .btn-next-game { font-size: 20px; padding: 12px 30px; }
}

@media (max-width: 480px) {
  /* Small Mobile Adjustments */
  .bookshelf-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .cover-wrapper { width: 90%; margin: 0 auto; }
  .story-text { font-size: 20px; }
  .text-container { padding: 10px 15px; width: 90%; }
}
/* --- استایل لوگوها در صفحه شناسنامه --- */
.credits-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 30px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e2e8f0;
}

.credit-logo-img {
  height: 60px; /* اندازه لوگوها را فیکس کردیم */
  width: auto;
  object-fit: contain;
}

/* برای موبایل اندازه لوگوها کمی کوچک‌تر شود */
@media (max-width: 768px) {
  .credit-logo-img {
    height: 45px;
  }
  .credits-logos {
    gap: 15px;
  }
}
/* --- STORY NAVIGATION BUTTONS --- */
.story-navigation {
  position: absolute;
  bottom: 30px;
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 30px;
  z-index: 1000;
}

.nav-btn {
  background-color: #3b82f6; /* رنگ آبی ملایم و جذاب */
  color: white;
  border: none;
  padding: 12px 35px;
  border-radius: 50px;
  font-size: 22px;
  font-family: 'Baloo 2', sans-serif;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 5px 15px rgba(59, 130, 246, 0.4);
  transition: transform 0.2s, background-color 0.2s;
}

.nav-btn:hover {
  background-color: #2563eb;
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .story-navigation { bottom: 15px; gap: 15px; }
  .nav-btn { font-size: 18px; padding: 10px 25px; }
}
#stone-1, #stone-2, #stone-3 {
    height: 15%; /* اندازه سنگ‌ها را به ۱۵ درصد افزایش دادیم */
    width: auto;
}
/* --- اصلاحات دقیق صفحه 3 --- */

/* آوردن موسی پایین کنار برکه */
.moses-p3 { 
  bottom: 12%; 
  right: 22%; 
  height: 45%; 
  z-index: 5; 
}

/* بزرگ کردن سنگ‌ها */
.stone { 
  height: 15% !important; 
  width: auto; 
  z-index: 5; 
}

/* تنظیم دقیق جایگاه سنگ‌ها */
#stone-1 { bottom: 15%; left: 30%; }
#stone-2 { bottom: 12%; left: 50%; }
#stone-3 { bottom: 18%; left: 70%; }
/* --- تنظیمات دقیق صفحه 4 (کنار هم بودن موسی و گوسفند) --- */
.moses-p4 { 
  bottom: 15%; 
  left: 40%; /* موسی را آوردیم نزدیک برکه */
  height: 48%; 
  z-index: 5;
}

.lamb-p4 { 
  bottom: 12%; 
  left: 55%; /* گوسفند هم دقیقاً جلوی موسی و کنار برکه است */
  height: 25%; 
  z-index: 5;
}
/* --- استایل دکمه‌های دسترسی مستقیم به بازی‌ها در کتابخانه --- */
.book-main-link {
  text-decoration: none;
  display: block;
}

.direct-game-buttons {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0 5px;
}

.mini-game-btn {
  background-color: #ffffff;
  color: #1e293b;
  text-decoration: none;
  font-family: 'Baloo 2', sans-serif;
  font-size: 13px;
  font-weight: bold;
  padding: 6px 10px;
  border-radius: 12px;
  border: 2px solid #cbd5e1;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.mini-game-btn:hover {
  background-color: #3b82f6; /* تغییر رنگ به آبی جذاب هنگام هوور */
  color: white;
  border-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(59, 130, 246, 0.3);
}

/* برای اینکه خود کارت در حالت عادی کلیک‌خور نباشد و دکمه‌ها کار کنند */
.book-card.active-book {
  cursor: default;
}
.book-main-link .cover-wrapper {
  cursor: pointer;
}
/* Navigation Container */
.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin: 25px 0 35px;
  padding: 0 15px;
}

/* Base Button Style */
.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 25px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1.05em;
  box-shadow: 0 6px 15px rgba(118, 75, 162, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  border: 3px solid rgba(255, 255, 255, 0.4);
  user-select: none;
}

/* Hover Effect: Lift & Glow */
.nav-btn:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 25px rgba(118, 75, 162, 0.45);
  border-color: rgba(255, 255, 255, 0.8);
}

/* Active/Click Effect: Press Down */
.nav-btn:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 4px 10px rgba(118, 75, 162, 0.3);
}

/* Optional: Different colors for specific buttons */
.nav-btn.btn-menu {
  background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
  box-shadow: 0 6px 15px rgba(141, 211, 244, 0.4);
}

.nav-btn.btn-story {
  background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
  box-shadow: 0 6px 15px rgba(161, 140, 209, 0.4);
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .nav {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .nav-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}
/* === NAVIGATION BUTTONS - FIXED === */
.nav {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* Base button style for ALL nav buttons */
.nav-btn,
.nav-btn:link,
.nav-btn:visited,
.nav-btn:hover,
.nav-btn:active {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  padding: 10px 20px !important;
  background: linear-gradient(135deg, #667eea, #764ba2) !important;
  color: white !important;
  text-decoration: none !important;
  border-radius: 25px !important;
  font-weight: 600 !important;
  font-size: 1em !important;
  font-family: 'Baloo 2', cursive !important;
  border: none !important;
  cursor: pointer !important;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3) !important;
  transition: all 0.3s ease !important;
  user-select: none !important;
}

.nav-btn:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5) !important;
}

/* Optional: Different colors */
.nav-btn.btn-back {
  background: linear-gradient(135deg, #4fc3f7, #29b6f6) !important;
}
.nav-btn.btn-home {
  background: linear-gradient(135deg, #81c784, #66bb6a) !important;
}
/* =========================================
   دکمه بازگشت به خانه (نسخه دایره‌ای با ایموجی)
========================================= */
.home-button {
  align-self: flex-start;
  text-decoration: none;
  background-color: #f4a261; /* یک رنگ گرم مناسب فضای داستان */
  font-size: 1.8rem;
  width: 55px;
  height: 55px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  margin-bottom: 20px;
  box-shadow: 0 6px 15px rgba(244, 162, 97, 0.4);
  transition: all 0.3s ease;
}

.home-button:hover {
  background-color: #e76f51;
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(231, 111, 81, 0.5);
}
