/* فونت‌ها و جهت نوشتار */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@500&display=swap');

@font-face {
  font-family: 'IRNazanin';
  src: local('IRNazanin');
}
@font-face {
  font-family: 'IRBadr';
  src: local('IRBadr');
}
@font-face {
  font-family: 'IRRoya';
  src: local('IRRoya');
}

body {
  margin: 0;
  padding: 2em;
  font-family: 'Vazirmatn', 'IRNazanin', 'IRBadr', 'IRRoya', sans-serif;
  background: #f3f6fa;
  color: #222;
  direction: rtl;
}

/* عنوان اصلی */
.title {
  text-align: center;
  font-size: 1.7em;
  font-weight: bold;
  margin-bottom: 1em;
}

/* نوار ابزار بالای صفحه */
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2em;
}

/* زمان شمسی */
.refresh-box {
  background: linear-gradient(to right, #e8f0fe, #cdddee);
  padding: 0.7em 1.2em;
  border-radius: 14px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-weight: bold;
  text-align: right;
  margin: 0;
  max-width: fit-content;
}

/* دکمه‌های اشتراک‌گذاری */
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4em;
  justify-content: flex-start;
}

.share-buttons a,
.qr-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  text-decoration: none;
  background: #e0e0e0;
  padding: 0.6em 1.2em;
  border-radius: 8px;
  font-size: 1em;
  color: #333;
  border: none;
  cursor: pointer;
  font-family: 'IRNazanin', 'IRBadr', 'IRRoya', sans-serif;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* منوی انتخاب صفحه */
.dropdown-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2em;
}

.group-selector {
  font-size: 1em;
  padding: 0.5em 1.1em;
  border-radius: 10px;
  border: 1px solid #0078d4;
  background-color: #eef6ff;
  font-family: inherit;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* کادر کانفیگ‌ها */
.group {
  background: #fff;
  margin-bottom: 2em;
  padding: 1em;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  text-align: center;
}

textarea {
  width: 50%;
  height: 300px;
  font-family: monospace;
  font-size: 0.95em;
  margin: 1em auto 0.5em auto;
  white-space: pre-wrap;
  direction: ltr;
  text-align: left;
  display: block;
}

.copy-btn {
  display: block;
  margin: 1em auto 0.5em auto;
  padding: 0.8em 1.5em;
  background: linear-gradient(to right, #00aaff, #0078d4);
  color: white;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1em;
  font-weight: bold;
  font-family: inherit;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}

.copy-btn span {
  display: block;
  font-size: 0.85em;
  margin-top: 0.3em;
  text-align: center;
  opacity: 0.9;
}

/* پیام موفقیت کپی */
.copy-status {
  font-size: 0.85em;
  color: green;
  font-weight: bold;
  text-align: center;
  margin-top: 6px;
  display: none;
}

/* نوتیف کپی‌شدن */
.copy-toast {
  position: fixed;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #0078d4;
  color: white;
  padding: 1em 2em;
  border-radius: 10px;
  font-size: 1.15em;
  font-weight: bold;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 1001;
  display: none;
  text-align: center;
}

/* QR */
.qr-popup {
  position: fixed;
  z-index: 999;
  background: #fff;
  padding: 1em;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  display: none;
}

#closeQR {
  margin-top: 1em;
  padding: 0.6em 1.2em;
  background-color: crimson;
  color: white;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  cursor: pointer;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.5);
  width: 100%;
  height: 100%;
  z-index: 998;
  display: none;
}

/* لودینگ مرحله‌ای */
.loading-box {
  text-align: center;
  font-size: 18px;
  padding: 1.8em;
  font-weight: bold;
  color: #555;
}

/* شمارشگر معکوس برای مراحل */
.countdown-box {
  text-align: center;
  background: #fff;
  padding: 1.5em;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.2);
  margin: 1em auto;
  max-width: 320px;
  font-size: 1.2em;
  color: #333;
}

.countdown-box p {
  margin-bottom: 0.6em;
  font-weight: bold;
  font-size: 1.1em;
}

.countdown-timer {
  font-size: 1.1em;
  font-weight: bold;
  color: #0078d4;
}

@media (max-width: 600px) {
  .toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 1em;
  }

  .group-selector {
    font-size: 1.1em;
    padding: 0.7em 1.2em;
  }

  textarea {
    width: 90%;
    height: 250px;
  }

  .copy-btn {
    font-size: 0.95em;
    padding: 0.7em 1.2em;
  }

  .refresh-box {
    font-size: 1em;
  }

  .countdown-box {
    max-width: 90%;
  }
}

.group-title {
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  background: #eef6ff;
  padding: 0.8em;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
  transition: background 0.3s;
  text-align: right;
}

.group-title:hover {
  background: #dbeeff;
}

.group-content {
  margin-top: 1em;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scaleY(0.98); }
  to { opacity: 1; transform: scaleY(1); }
}

@keyframes stageFade {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.countdown-box {
  animation: stageFade 0.4s ease-in-out;
}
