/* تنظیمات کلی صفحه */
body {
    background-color: #1a1a1a; /* پس‌زمینه تیره و مرموز */
    color: #f0f0f0;
    font-family: 'Vazirmatn', sans-serif; /* یک فونت فارسی زیبا (باید به پروژه اضافه شود) */
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
}

.main-container {
    width: 100%;
    max-width: 800px;
    padding: 20px;
}

/* استایل مخصوص صفحه ۱ */
.page-1-container {
    cursor: pointer; /* تغییر شکل ماوس برای نشان دادن قابلیت کلیک */
}

.glowing-brooch {
    max-width: 200px;
    /* انیمیشن درخشش */
    animation: glow 3s ease-in-out infinite alternate;
}

.instruction-text {
    margin-top: 20px;
    font-size: 1.2rem;
    color: #aaa;
    animation: fadeIn 2s ease-in;
}

/* تعریف انیمیشن‌ها */
@keyframes glow {
    from {
        box-shadow: 0 0 10px #fff, 0 0 20px #fff, 0 0 30px #e60073, 0 0 40px #e60073;
    }
    to {
        box-shadow: 0 0 20px #fff, 0 0 30px #ff4da6, 0 0 40px #ff4da6, 0 0 50px #ff4da6;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/***** استایل‌های مخصوص صفحه ۲ (ستاد فرماندهی) ****/
.page-2-container {
padding: 0;
max-width: 100%;
height: 100vh;
overflow: hidden; /* جلوگیری از اسکرول خوردن صفحه */
}

.map-wrapper {
position: relative; /* این عنصر والد نقاط روی نقشه است */
width: 100%;
height: 100%;
}

.map-image {
width: 100%;
height: 100%;
object-fit: cover; /* تصویر تمام صفحه را می‌پوشاند /
filter: sepia(0.5) brightness(0.7); / افکت قدیمی و تاریک به نقشه می‌دهد */
}

.dodman-smoke {
position: absolute;
top: 10%;
left: 10%;
width: 40%;
opacity: 0.5;
pointer-events: none; /* تصویر قابل کلیک نباشد /
animation: smokeDrift 15s linear infinite alternate; / انیمیشن حرکت آرام شبح */
}

@keyframes smokeDrift {
from {
transform: translate(0, 0);
}
to {
transform: translate(20px, 10px);
}
}

/* استایل نقاط ماموریت */
.mission-point {
position: absolute;
width: 40px;
height: 40px;
background-color: rgba(128, 128, 128, 0.7);
color: #fff;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
font-size: 1.5rem;
font-weight: bold;
border: 2px solid #555;
transform: translate(-50%, -50%); /* مرکز نقطه را دقیقاً روی مختصات قرار می‌دهد */
cursor: pointer;
text-decoration: none;
}

.mission-point.locked {
background-color: #333;
cursor: not-allowed; /* نشانگر "غیرمجاز" برای ماموریت‌های قفل */
}

.mission-point.active {
background-color: #c0392b; /* رنگ قرمز برای ماموریت فعال */
border-color: #f1c40f;
}

/* انیمیشن چشمک‌زن برای ماموریت فعال */
.pulse-ring {
position: absolute;
width: 100%;
height: 100%;
border-radius: 50%;
border: 3px solid #f1c40f;
animation: pulse 2s infinite;
}

@keyframes pulse {
0% {
transform: scale(0.95);
opacity: 0.7;
}
70% {
transform: scale(1.5);
opacity: 0;
}
100% {
transform: scale(0.95);
opacity: 0;
}
}

/* استایل پنجره پیام خوشامدگویی */
.welcome-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
display: flex;
justify-content: center;
align-items: center;
z-index: 100;
}

.modal-content {
background-color: #2c3e50;
padding: 30px;
border-radius: 10px;
border: 2px solid #f1c40f;
max-width: 90%;
width: 500px;
}

.modal-content h2 {
color: #f1c40f;
}

.modal-content .highlight {
color: #3498db;
font-weight: bold;
}

.modal-content button {
background-color: #f1c40f;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-size: 1rem;
font-weight: bold;
margin-top: 20px;
}

/* --- استایل‌های مخصوص صفحه ۳ (چالش جنگل) --- */
.page-3-container {
  background-color: #2c3e50;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #27ae60;
}

.challenge-intro h1 {
  color: #2ecc71;
}

.challenge-intro video {
  border-radius: 8px;
  margin-top: 15px;
}

.separator {
  border: 0;
  height: 1px;
  background-image: linear-gradient(to right, rgba(0, 0, 0, 0),
                                      rgba(46, 204, 113, 0.75),
                                      rgba(0, 0, 0, 0));
  margin: 40px 0;
}

.challenge-task h2 {
  color: #f1c40f;
}

/* استایل دکمه آپلود سفارشی */
input[type="file"] {
  display: none; /* مخفی کردن دکمه پیش‌فرض */
}

.upload-button {
  background-color: #3498db;
  color: white;
  padding: 10px 15px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-block;
}

#file-chosen {
  margin-right: 10px;
  color: #bdc3c7;
}

.submit-button {
  background-color: #27ae60;
  color: white;
  font-weight: bold;
  font-size: 1.1rem;
  padding: 12px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: block;
  width: 100%;
  margin-top: 20px;
}

/* استایل بخش موفقیت */
.challenge-success {
  text-align: center;
  animation: fadeIn 1s;
}

.treasure-icon {
  width: 100px;
  margin: 20px 0;
  animation: treasureAppear 1.5s ease-out;
}

.back-to-map {
  display: inline-block;
  background-color: #f1c40f;
  color: #1a1a1a;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  margin-top: 20px;
}

.error-message {
  color: #e74c3c;
  font-weight: bold;
}

@keyframes treasureAppear {
  0% {
    transform: scale(0) rotate(-180deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

/* --- استایل‌های مخصوص صفحه ۴ (چالش همدلی) --- */
.page-4-container {
  background-color: #3e2723; /* قهوه‌ای تیره، حس گرما و شیرینی */
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #e67e22;
}

.page-4-container .challenge-intro h1 {
  color: #f39c12; /* نارنجی */
}

.orange-separator {
  background-image: linear-gradient(to right,
    rgba(0, 0, 0, 0),
    rgba(243, 156, 18, 0.75),
    rgba(0, 0, 0, 0)
  );
}

 /* استایل دکمه‌های نارنجی */
 .upload-button.orange-button {
   background-color: #d35400;
 }

 .submit-button.orange-button {
   background-color: #e67e22;
 }
 /* --- استایل‌های مخصوص صفحه ۵ (چالش خاطره) --- */
.page-5-container {
  background-color: #2c2c54; /* آبی-بنفش تیره، حس شب و خاطره */
  padding: 20px;
  border-radius: 10px;
  border: 2px solid #8e44ad;
}

.page-5-container .challenge-intro h1 {
  color: #9b59b6; /* بنفش */
}

.purple-separator {
  background-image: linear-gradient(to right,
    rgba(0, 0, 0, 0),
    rgba(155, 89, 182, 0.75),
    rgba(0, 0, 0, 0)
  );
}

/* استایل بخش انتخاب نوع ارسال */
.submission-choice {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.choice-button {
  background: #474787;
  border: 2px solid #8e44ad;
  color: white;
  padding: 10px 15px;
  cursor: pointer;
  font-size: 1rem;
}
.choice-button:first-child {
  border-radius: 0 5px 5px 0;
}
.choice-button:last-child {
  border-radius: 5px 0 0 5px;
}
.choice-button.active {
  background-color: #8e44ad;
}

/* استایل فرم‌ها */
textarea {
  width: 100%;
  background-color: #1e1e3f;
  border: 1px solid #9b59b6;
  color: white;
  padding: 10px;
  border-radius: 5px;
  font-family: inherit;
  font-size: 1rem;
  margin-bottom: 15px;
}

.upload-button.purple-button {
  background-color: #8e44ad;
}
.submit-button.purple-button {
  background-color: #9b59b6;
}

/* --- استایل‌های مخصوص صفحه ۶ (سپاه نگهبانان) --- */

.page-6-container {
    background: #141E30; /* پس‌زمینه کهکشانی تیره */
    background: -webkit-linear-gradient(to right, #243B55, #141E30);
    background: linear-gradient(to right, #243B55, #141E30);
    padding: 20px;
    border-radius: 10px;
    border: 2px solid #D4AF37; /* طلایی */
}

.call-to-arms {
    text-align: center;
}

.emblem {
    width: 150px;
    margin-bottom: 20px;
}

.call-to-arms h1 {
    color: #F7DC6F;
}

.prompt {
    font-size: 1.1rem;
    color: #bdc3c7;
}

.join-form input {
    width: 100%;
    padding: 12px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid #D4AF37;
    border-radius: 5px;
    color: white;
    font-size: 1.2rem;
    margin-top: 20px;
}

.join-form button {
    background-color: #D4AF37;
    color: #141E30;
    font-weight: bold;
    font-size: 1.2rem;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    display: block;
    width: 100%;
    margin-top: 15px;
}

/* --- استایل‌های گواهی نگهبان --- */

.certificate-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    border: 3px solid #b9933a;
    animation: fadeIn 1s;
}

.certificate-bg {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.3;
}

.certificate-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 40px;
    box-sizing: border-box;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.cert-intro {
    font-size: 1rem;
    margin: 0;
}

.cert-name {
    color: #F7DC6F;
    font-size: 2.5rem;
    margin: 5px 0;
}

.cert-title {
    font-size: 1.1rem;
    margin: 0;
}

.cert-rank {
    color: #fff;
    font-size: 1.8rem;
    margin: 5px 0;
}

.cert-body {
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 15px 0;
}

.cert-signature {
    margin-top: auto;
}

.cert-signature img {
    width: 120px;
}

.cert-signature p {
    margin: -10px 0 0;
    font-size: 0.8rem;
}

.after-cert-actions {
    text-align: center;
    margin-top: 20px;
}

.next-mission-button {
    display: inline-block;
    background-color: #27ae60;
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 10px;
}

/* --- استایل‌های مخصوص صفحه ۷ (دیوار افتخار) --- */
.page-7-container {
    background: #fdfcfb;
    color: #333;
    padding: 20px;
    border-radius: 10px;
}

/* هدر گالری */
.gallery-header {
    text-align: center;
    margin-bottom: 30px;
}

.gallery-header h1 {
    color: #c0392b;
}

/* ساختار گالری با استفاده از CSS Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

/* آیتم‌های گالری */
.gallery-item {
    position: relative;
    border: 3px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1 / 1; /* ایجاد تصاویر مربعی */
    animation: zoomIn 0.5s;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* عکس کادر را کاملاً پر می‌کند بدون تغییر نسبت */
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

/* پیام در صورت خالی بودن گالری */
.empty-gallery-message {
    grid-column: 1 / -1; /* پیام تمام عرض را بگیرد */
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #777;
}

/* روبان‌های رنگی روی عکس‌ها */
.ribbon {
    position: absolute;
    top: 10px;
    left: -10px;
    background-color: #3498db;
    color: white;
    padding: 5px 15px;
    font-size: 0.8rem;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3);
}

.ribbon.green {
    background-color: #27ae60;
}

.ribbon.orange {
    background-color: #e67e22;
}

.ribbon span {
    display: block;
    transform: rotate(-45deg);
    position: relative;
    left: -10px;
}

/* بخش فراخوان نبرد نهایی */
.final-battle-call {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.final-battle-button {
    display: inline-block;
    background-color: #c0392b;
    color: white;
    padding: 15px 30px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.3rem;
    transition: background-color 0.3s;
}

.final-battle-button:hover {
    background-color: #e74c3c;
}

/* انیمیشن ورود تصاویر */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- استایل‌های مخصوص صفحه ۸ (نبرد نهایی) --- */
.page-8-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    padding: 10px;
    box-sizing: border-box;
}

/* بخش دستورالعمل */
.instructions {
    text-align: center;
    margin-bottom: 20px;
}

.instructions h1 {
    color: #e74c3c;
}

/* کوله‌پشتی دیجیتال */
.backpack {
    display: flex;
    gap: 20px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin-bottom: 20px;
}

.backpack h3 {
    display: none;
}

.treasure-item {
    width: 60px;
    height: 60px;
    cursor: grab;
    transition: transform 0.2s;
}

.treasure-item img {
    width: 100%;
}

.treasure-item.dragging {
    opacity: 0.5;
    transform: scale(1.2);
}

/* نقشه نبرد نهایی */
.final-map-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 16 / 9;
}

.final-map-wrapper .map-image {
    border-radius: 10px;
    filter: brightness(0.6);
}

/* نقاط هدف برای قرار دادن گنج‌ها */
.target-zone {
    position: absolute;
    width: 70px;
    height: 70px;
    background-color: rgba(241, 196, 15, 0.3);
    border: 2px dashed #f1c40f;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: glow-target 2s infinite alternate;
}

.target-zone.hovered {
    background-color: rgba(46, 204, 113, 0.5);
}

.target-zone.filled {
    background-color: #2ecc71;
    border-style: solid;
    animation: none;
    opacity: 0.8;
}

/* موقعیت نقاط هدف روی نقشه (قابل تنظیم) */
#target1 { top: 30%; left: 70%; }
#target2 { top: 50%; left: 25%; }
#target3 { top: 75%; left: 50%; }

/* انیمیشن درخشش نقاط هدف */
@keyframes glow-target {
    from { box-shadow: 0 0 10px #f1c40f; }
    to { box-shadow: 0 0 20px #f1c40f, 0 0 30px #f1c40f; }
}

/* پنجره‌ی انیمیشن نهایی */
.final-animation-modal {
    display: none; /* در ابتدا مخفی است */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.final-animation-modal video {
    max-width: 90%;
    max-height: 90%;
}

/* پیام و دکمه بعد از ویدئو */
.after-video-content {
    text-align: center;
    color: white;
    animation: fadeIn 2s;
}

.hall-of-fame-button {
    display: inline-block;
    background-color: #f1c40f;
    color: #1a1a1a;
    padding: 15px 30px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.2rem;
    margin-top: 20px;
}
/* ... (تمام کدهای قبلی صفحه ۸ سر جای خود باقی می‌مانند) ... */

/* کد جدید برای بازخورد اشتباه، بر اساس پیشنهاد عالی شما */
.target-zone.wrong {
  animation: shake 0.4s;
  border-color: #e74c3c !important; /* رنگ قرمز برای خطا */
  background-color: rgba(231, 76, 60, 0.4) !important;
}

/* انیمیشن لرزش */
@keyframes shake {
  0%, 100% { transform: translate(-50%, -50%) translateX(0); }
  25% { transform: translate(-50%, -50%) translateX(8px); }
  75% { transform: translate(-50%, -50%) translateX(-8px); }
}
/* --- استایل‌های مخصوص تالار نگهبانان ابدی --- */
.page-hall-of-fame {
    background-image: url('/images/backgrounds/stone_wall.jpg');
    background-size: cover;
    background-attachment: fixed;
    padding: 20px;
    border-radius: 10px;
    border: 3px solid #6D4C41; /* قهوه‌ای تیره */
    color: #E0E0E0; /* رنگ متن روشن برای خوانایی روی پس‌زمینه تیره */
}

.hall-header {
    text-align: center;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    margin-bottom: 30px;
}

.hall-header h1 {
    color: #FFCC80; /* نارنجی کم‌رنگ */
    text-shadow: 2px 2px 4px #000;
}

.success-message {
    text-align: center;
    background-color: #4CAF50;
    color: white;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.scroll-of-names {
    background-color: rgba(255, 248, 225, 0.9); /* رنگ کاغذ پوستی */
    color: #3E2723; /* قهوه‌ای سوخته برای متن */
    max-height: 400px;
    overflow-y: auto; /* اسکرول عمودی در صورت زیاد بودن اسامی */
    border: 5px solid #6D4C41;
    border-radius: 5px;
    padding: 20px;
    box-shadow: 0 0 15px rgba(0,0,0,0.7);
}

.scroll-of-names h2 {
    text-align: center;
    border-bottom: 2px solid #A1887F;
    padding-bottom: 10px;
}

.scroll-of-names ul {
    list-style: none;
    padding: 0;
}

.scroll-of-names li {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px dashed #A1887F;
    font-size: 1.1rem;
}

.scroll-of-names li:last-child {
    border-bottom: none;
}

.guardian-name {
    font-weight: bold;
}

.join-date {
    font-size: 0.9rem;
    color: #795548;
}

.final-message {
    text-align: center;
    margin-top: 30px;
    background-color: rgba(0, 0, 0, 0.5);
    padding: 20px;
    border-radius: 10px;
}

.final-message h3 {
    color: #FFCC80;
}
