/* ===================== */
/* 🎨 رنگ‌های اصلی پروژه */
/* ===================== */
#tr-booking-app {
  --color-title: #141414;
  --color-subtitle: #6b6b6b;
  --color-red: #f35b53;
  --color-green: #249f9c;
  --color-yellow: #e9a82a;
  --color-pink: #f44786;
  --color-stroke: #cccccc;
  --color-pill: #6b6c7b;
  --color-summary-bg: #d9d9d9;
  --color-sold: #343a49;
}

/* رنگ خطا */
.error-color {
  color: var(--color-red);
  font-size: 0.9rem;
}

/* ===================== */
/* 🔹 ساختار هر بخش       */
/* ===================== */
.tr-section {
  margin-bottom: 2rem;
}

.tr-section-title {
  color: var(--color-title);
  font-size: 1.2rem;
  margin-bottom: 1rem;
  text-align: right;
}

/* ========================= */
/* 📅 لیست روزهای موجود     */
/* ========================= */
.tr-days-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  margin-top: 1rem;
}

.tr-day-item {
  background: #fff;
  padding: 12px 16px;
  border-radius: 7px;
  cursor: pointer;
  border: 1px solid var(--color-stroke);
  min-width: 85px;
  text-align: center;
  line-height: 1.5;
  transition: 0s;
}

.tr-day-item:hover {
  background-color: #f2f2f2;
}

.tr-day-item.active {
  background-color: #faf7ff;
  border: solid 2px var(--color-pink);
  color: white;
}

.tr-day-item strong {
  display: block;
  font-size: 15px;
  color: var(--color-title);
}

.tr-day-item span {
  display: block;
  font-size: 13px;
  color: var(--color-subtitle);
}

/* =========================== */
/* ⏰ لیست سانس‌های هر روز     */
/* =========================== */
.tr-sessions-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-start;
  margin-top: 1rem;
}

.tr-session-item {
  background: #fff;
  padding: 12px 20px;
  border-radius: 7px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  min-width: 110px;
  border: 1px solid var(--color-stroke);
  color: var(--color-title);
  transition: 0s;
}

.tr-session-item:hover {
  background-color: #f9f9f9;
}

.tr-session-item.active {
  background-color: #faf7ff;
  border: solid 2px var(--color-pink);
  color: white;
}

.tr-session-item.disabled {
  background-color: #fff;
  border: 1px solid var(--color-red);
  color: var(--color-red);
  cursor: not-allowed;
}

.tr-session-item strong {
  display: block;
  font-size: 15px;
  color: var(--color-title);
}

.tr-session-item span {
  display: block;
  font-size: 13px;
  color: var(--color-subtitle);
}

/* =========================== */
/* 🔢 لیست شماره بازیکن‌ها    */
/* =========================== */
.tr-players-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tr-player-item {
  width: 49px;
  height: 57px;
  border-radius: 8px;
  border: 1px solid var(--color-stroke);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: normal;
  background-color: #fff;
  color: var(--color-title);
  cursor: pointer;
}

.tr-player-item:hover {
  background-color: #f2f2f2;
}

.tr-player-item svg.player-icon {
  width: 20px;
  height: 20px;
  margin-bottom: 2px;
  stroke: currentColor;
  fill: none;
}

.tr-player-item span {
  font-size: 14px;
  line-height: 1;
}

/* وضعیت‌ها */
.tr-player-item.hold {
  background-color: var(--color-yellow);
  color: white;
  cursor: not-allowed;
}

.tr-player-item.reserved {
  background-color: var(--color-sold);
  color: white;
  cursor: not-allowed;
}

.tr-player-item.mine {
  background-color: var(--color-pink);
  color: white;
}

.tr-player-item.selected {
  background-color: var(--color-pink);
  border-color: var(--color-pink);
  color: white;
}

/* ======================= */
/* 🔘 لجند وضعیت بازیکن‌ها */
/* ======================= */
.tr-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-top: 1rem;
  margin-bottom: 2rem;
  font-size: 14px;
  align-items: center;
}

.tr-legend span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--color-title);
}

.tr-legend .circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--color-stroke);
}

.tr-legend .available {
  background-color: #fff;
  border-color: var(--color-title);
}

.tr-legend .hold {
  background-color: var(--color-yellow);
}

.tr-legend .reserved {
  background-color: var(--color-sold);
}

.tr-legend .mine {
  background-color: var(--color-pink);
}

/* ====================== */
/* 💳 نوار خلاصه پرداخت   */
/* ====================== */
.tr-summary-bar {
  background-color: var(--color-summary-bg);
  padding: 1.5rem 1rem;
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-start;
  justify-content: space-between;
}

/* بازیکن‌های انتخاب‌شده */
.selected-players {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.player-pill {
  background-color: var(--color-pill);
  color: white;
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.player-pill .remove {
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

/* دکمه پرداخت */
.summary-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.summary-total {
  font-size: 15px;
  font-weight: bold;
  color: var(--color-title);
  text-align: right;
  margin-bottom: 0.5rem;
}

.summary-pay-btn {
  background-color: var(--color-red);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 15px 35px;
  font-size: 14px;
  cursor: pointer;
  transition: 0s;
  white-space: nowrap;
}

.summary-pay-btn:hover {
  background-color: var(--color-pill);
}

.tr-player-item.loading {
  position: relative;
  opacity: 0.6;
  pointer-events: none;
}

.tr-player-item.loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid #e9a82a;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.summary-pay-btn.loading {
  pointer-events: none;
  opacity: 0.6;
  position: relative;
}
.summary-pay-btn.loading::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* 🎯 استایل مودال لاگین */
.tr-login-modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.tr-login-content {
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  width: 100%;
  max-width: 400px;
  position: relative;
  text-align: right;
}

.tr-login-close {
  position: absolute;
  left: 15px;
  top: 10px;
  font-size: 24px;
  color: #999;
  cursor: pointer;
}

#tr-login-form input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  text-align: right;
}

#tr-login-btn {
  width: 100%;
  background-color: var(--color-green);
  color: white;
  padding: 12px;
  font-size: 15px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#tr-login-btn:hover {
  background-color: #1e7d7b;
}

.tr-login-error {
  color: var(--color-red);
  margin-top: 10px;
  font-size: 13px;
}

/* =========================== */

/* ============================== */
/* 🏷️ نوع سانس + رده سنی در کارت */
/* ============================== */

/* چون دیگه tr-session-meta استفاده نمی‌کنیم، این بخش رو حذف/بی‌اثر می‌کنیم */
.tr-session-meta {
  display: none;
}

/* badge نوع سانس: بالا، یک خط جدا */
/* badge نوع سانس (حالت عمومی) */
.tr-type-badge {
  display: inline-block !important;
  padding: 5px 20px;
  border-radius: 30px;
  font-size: 15px !important;
  border: 1px solid var(--color-stroke);
  background: #fff;
  color: var(--color-title);
  line-height: 1.6;
  margin: 0; /* ✅ مهم: دیگه auto نداریم تا وسط نره */
  font-weight: 300 !important;
}

/* فقط داخل کارت‌های سانس، بج وسط‌چین باشه */
.tr-session-item .tr-type-badge {
  margin: 0 auto 6px auto; /* ✅ اینجا وسط‌چین */
}

/* رنگ‌بندی نوع‌ها */
.tr-type-badge.type-vip {
  border-color: #e9a82aba;
  color: var(--color-yellow);
}
.tr-type-badge.type-standard {
  border-color: #f44786a6;
  color: #f44786;
}
.tr-type-badge.type-economic {
  border-color: #c48bff;
  color: #7b2fe0;
}

/* رده سنی: همیشه پایین، یک خط جدا */
.tr-age-badge {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-pink) !important;
  line-height: 1.6;
  font-weight: normal;
}

/* متن مهلت خرید (به جای قیمت) */
.tr-session-expired {
  display: block;
  margin-top: 2px;
  color: var(--color-red);
  font-size: 13px;
  font-weight: bold;
}

/* اگر کارت disabled است، بج همچنان دیده شود ولی کلیک‌ناپذیر است (منطقش در JS) */
.tr-session-item.disabled .tr-type-badge {
  opacity: 0.95;
}

/* ============================== */
/* 📦 باکس توضیحات زیر سانس‌ها   */
/* ============================== */
.tr-session-details {
  display: flex;
  margin-top: 14px;
  text-align: right;
}

.tr-session-details-card {
  background: #faf7ff;
  border: 1px solid var(--color-stroke);
  border-radius: 7px;
  padding: 14px 16px;
}

.tr-session-details-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  justify-content: flex-start;
}

.tr-session-details-title {
  font-weight: normal;
  color: var(--color-title);
}

.tr-session-details-age {
  color: var(--color-subtitle);
  font-size: 13px;
  margin-bottom: 10px;
}

.tr-session-details-list {
  margin: 0;
  padding-right: 18px;
  color: var(--color-title);
  font-size: 13px;
  line-height: 1.9;
}

/* ✅ disabled مثل کارت‌های معمولی باشد (نه قرمز) */
.tr-session-item.disabled {
  border: 1px solid var(--color-stroke) !important;
  color: var(--color-title) !important;
  background: #fff !important;
  cursor: not-allowed;
}

/* فقط متن مهلت خرید قرمز بماند */
.tr-session-item.disabled .tr-session-expired {
  color: var(--color-red) !important;
  font-weight: bold;
  margin-top: 6px;
}

.tr-session-price {
  font-weight: 400;
  font-size: 14px !important;
  color: var(--color-title) !important;
  margin-top: 6px;
}

.tr-session-time {
  font-weight: 300;
  font-size: 15px !important;
  color: var(--color-title) !important;
  margin-top: 6px;
}

/* محتوای ادیتور داخل باکس توضیحات */
.tr-session-details-content {
  color: var(--color-subtitle);
  font-size: 13px;
  line-height: 1.9;
}

.tr-session-details-content p {
  margin: 0 0 10px 0;
}

.tr-session-details-content ul,
.tr-session-details-content ol {
  margin: 0 0 10px 0;
  padding-right: 18px;
}

.tr-session-details-content li {
  margin: 4px 0;
}

.tr-session-details-content h1,
.tr-session-details-content h2,
.tr-session-details-content h3,
.tr-session-details-content h4 {
  margin: 0 0 10px 0;
  color: var(--color-title);
}

.tr-session-details-content ul {
  list-style-type: disc;
}

/* ✅ Notification */
.tr-notice {
  position: sticky;
  top: 12px;
  z-index: 999;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.7;
  margin: 10px 0 14px 0;
  border: 1px solid #ddd;
  background: #ffffff;
  color:#ffffff;
}

.tr-notice.is-error {
  border-color: rgba(247, 92, 92, 0.685);
  background: rgba(247, 92, 92, 0.836);
}

.tr-notice.is-success {
  border-color: rgba(46, 204, 113, 0.35);
  background: rgba(46, 204, 113, 0.08);
  color:#0f5132;
}

@media (max-width: 768px){
  .tr-notice{
    font-size:13px;
    padding: 9px 10px;
    top: 45px;
    color: var(--color-title);
  }
}

.summary-pay-btn:disabled,
.summary-pay-btn[aria-disabled="true"]{
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}
