/* ===================== */
/* 🎨 رنگ‌های اصلی پروژه */
/* ===================== */
#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: 0.3s;
}

.tr-day-item:hover {
  background-color: #f2f2f2;
}

.tr-day-item.active {
  background-color: var(--color-pink);
  color: white;
}

.tr-day-item.active strong,
.tr-day-item.active span {
  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: 0.3s;
}

.tr-session-item:hover {
  background-color: #f9f9f9;
}

.tr-session-item.active {
  background-color: var(--color-pink);
  color: white;
}

.tr-session-item.active strong,
.tr-session-item.active span {
  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.disabled span {
  color: var(--color-red);
}

.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: 42px;
  height: 50px;
  border-radius: 8px;
  border: 1px solid var(--color-stroke);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  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: 12px;
  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: 0.3s;
  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;
}
