/* =======================================
   THEBAN GAMES — وقت المزايدة
   نسخة 1:1 من حنكة الذيب
   مع ثيم أزرق بحري (#0a2038)
   ======================================= */
/* Reset بسيط مثل حنكة الذيب */
html, body { background: #0a2038; }

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --primary: #0a2038;        /* الأزرق البحري بدل الأحمر */
  --primary-dark: #07192d;   /* أغمق */
  --secondary: #f6c87a;      /* الذهبي */
  --muted: #c9b48d;
  --card: rgba(255,255,255,0.08);
  --background: #0a2038;
}

/* ===========================
   هيكل الصفحة العام
   =========================== */

body.bidding-select-page,
body.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  color: #fff;
  font-family: 'Tajawal','Segoe UI','Tahoma',Arial,sans-serif; /* نفس حنكة بالضبط */
  background-color: #0a2038;
  background-image: url(/assets/img/Bidding_Background.webp);
  background-size: cover;
  background-repeat: repeat;
  background-attachment: fixed;
  background-position: center;
}

.footer {
  margin-top: auto;
}

/* ===========================
   Header — مطابق لحـنـكـة الـذيـب
   =========================== */

.site-header,
.bid-header {
  display: flex;
  justify-content: center;
  align-items: center;
  max-width: 1200px;
  margin: 20px auto;
  padding: 20px;
  background: rgba(0,0,0,0.25);
  border-radius: 12px;
  text-align: center;
  position: relative;
  box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}

.logo,
.bid-logo {
  margin-left: 12px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--primary);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

.logo img,
.bid-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand h1,
.bid-title-block h1 {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--secondary);
}

.brand .subtitle,
.bid-title-block .bid-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

/* زر الرجوع — مطابق تمامًا */

.back-home,
.bid-back-home {
  position: absolute;
  top: 15px;
  right: 20px;
  background: var(--primary);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  transition: .2s;
}

.back-home:hover,
.bid-back-home:hover {
  background: var(--primary-dark);
}


/* الأزرار — مطابق حنكة الذيب 1:1 */
.btn {
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  border: none;
  transition: all .2s;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-dark);
}

.btn.secondary {
  background: #EBCE8F;
  color: #000;
}

.btn.secondary:hover {
  background: #f7e3b3;
}

.btn.danger {
  background: #c0392b;
  color: #fff;
}

.btn.success {
  background: #27ae60;
  color: #fff;
}

/* نفس الـ ghost حق حنكة */
.btn.ghost {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(0,0,0,0.15);
}

.btn-ghost:hover {
  background-color: rgb(255, 0, 0); 
  border-color: #ff0000;
  transform: translateY(-1px);
}



/* ===========================
   فرق — مطابق لحنكة
   =========================== */

.teams-section {
  max-width: 800px;
  margin: 20px auto;
  text-align: center;
}

.teams-inputs,
.teams-grid {
  display: flex;
  gap: 20px;
  justify-content: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.team-field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  flex: 1;
  min-width: 220px;
  background: var(--card);
  padding: 14px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.team-field label,
.field-label {
  margin-bottom: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.team-field input,
.text-input {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--secondary);
  background: #fff;
  color: #000;
  width: 100%;
  font-size: 1rem;
  font-weight: 600;

  /* ✅ يمنع خروج الخانة عن إطار الكرت */
  box-sizing: border-box;
}

/* زر البدء */

#startBtn,
.btn-primary.big {
  font-size: 1.2rem;
  padding: 14px 28px;
  border-radius: 12px;
  background: var(--primary);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0,0,0,0.35);
  transition: transform .2s, box-shadow .2s;
}

#startBtn:hover,
.btn-primary.big:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
  background: var(--primary-dark);
}

.btn-primary.big:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.hint-text,
.small-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 8px;
}

/* ===========================
   قسم التصنيفات
   =========================== */

.categories-section {
  max-width: 1100px;
  margin: 24px auto 0;
  padding: 20px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  text-align: center;
}

.categories-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  margin-top: 18px;
}

/* بطاقة التصنيف */

.cat-card {
  position: relative;
  width: 180px;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.15);
  cursor: pointer;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  transition: transform .25s, box-shadow .25s, border-color .25s;
}

.cat-card:hover:not(.disabled):not(.selected) {
  transform: translateY(-6px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.35);
  border-color: rgba(255,255,255,0.35);
}

.cat-card.selected {
  border-color: var(--secondary);
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(255,215,140,0.45);
}

.cat-card.disabled {
  opacity: .45;
  filter: grayscale(1);
  cursor: not-allowed;
}

/* صورة التصنيف */

.cat-image-wrapper {
  width: 100%;
  height: 150px;
  overflow: hidden;
  background: rgba(0,0,0,0.45);
}

.cat-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.cat-card:hover img {
  transform: scale(1.06);
}

/* placeholder */

.cat-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: rgba(255,255,255,0.8);
}

/* بادج الإتاحة */

.cat-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--secondary);
  color: #2b1a00;
  padding: 4px 10px;
  font-size: 0.85rem;
  font-weight: 900;
  border-radius: 999px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.35);
  pointer-events: none;
}

/* اسم التصنيف */

.cat-name {
  padding: 12px 10px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0,0,0,0.35);
  border-top: 1px solid rgba(255,255,255,0.15);
  text-shadow: 0 1px 3px rgba(0,0,0,0.35);
}

/* لا يوجد بيانات */

.no-data {
  margin-top: 14px;
  font-size: 1rem;
  color: var(--muted);
}
/* ==========================================
   🔔 Toast
   ========================================== */

.bid-toast,
#toastHost .toast {
  position: fixed;
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  transition: all .35s;
  z-index: 600;
}

.bid-toast {
  right: 20px;
  bottom: 20px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
}

.bid-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================
   📱 Responsive — Mobile
   ========================================== */

@media (max-width: 767px) {

  body.bidding-select-page {
    padding: 0;
  }

  .bid-back-home {
    top: 10px;
    right: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(6px);
  }

  /* الهيدر */
  .bid-header {
    flex-direction: column;
    background: transparent;
    box-shadow: none;
    padding: 10px 0;
    margin: 60px 0 10px;
  }

  .bid-logo {
    width: 80px;
    height: 80px;
    margin-bottom: 10px;
  }

  .bid-title-block h1 {
    font-size: 1.3rem;
  }
  .bid-title-block .bid-subtitle {
    font-size: 0.9rem;
  }

  /* الفرق */
  .teams-section {
    margin: 10px auto;
    padding: 0 12px;
  }

  .teams-grid {
    flex-direction: column;
    gap: 12px;
  }

  .team-field {
    width: 100%;
    padding: 12px;
  }

  .text-input {
    font-size: 1rem;
  }

  /* زر البدء */
  .btn-primary.big {
    width: 100%;
    font-size: 1.1rem;
    padding: 14px 0;
    border-radius: 10px;
  }

  /* التصنيفات */
  .categories-section {
    padding: 16px;
    border-radius: 12px;
  }

  .categories-grid {
    gap: 14px;
  }

  .cat-card {
    width: 45%;
    min-width: 150px;
  }

  .cat-image-wrapper {
    height: 130px;
  }

  .cat-name {
    font-size: 0.95rem;
  }

  #toastHost .toast {
    font-size: 0.9rem;
    padding: 8px 10px;
  }

  .footer {
    font-size: 0.8rem;
    padding: 10px 0;
    background: rgba(0,0,0,0.3);
  }
}

/* ==========================================
   💻 Responsive — Tablet
   ========================================== */

@media (min-width: 768px) and (max-width: 1100px) {
  .cat-card {
    width: 170px;
  }
}

/* ==========================================
   ✨ Polish & GPU Boost
   ========================================== */

*:focus {
  outline: 2px solid #0a2038;
  outline-offset: 3px;
}

img {
  user-select: none;
  -webkit-user-drag: none;
}

.cat-card,
.team-field,
.categories-section {
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

/* ============================
   Modal إدخال الكود — موحّد مع حنكة الذيب
   ============================ */

.modal.is-hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.modal-dialog {
  position: relative;
  width: min(520px, 92vw);
  background: #93c7ffd3;          /* نفس الخلفية الدافئة */
  color: #000000;               /* لون النص الرئيسي */
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  padding: 18px 18px 14px;
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: 6px;
  left: 8px;                    /* RTL */
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.08);
  font-size: 20px;
  line-height: 36px;
  cursor: pointer;
}

/* العنوان والنصوص داخل المودال */
.modal-header h3 {
  margin: 0 0 6px;
  font-size: 1.2rem;
  font-weight: 800;
  text-align: center;
  color: #000000;
}

.modal-sub {
  margin: 0 0 10px;
  opacity: 0.85;
  text-align: center;
  font-size: 0.95rem;
  color: #000000;
}

.modal-body {
  margin-top: 6px;
}

.redeem-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0 14px;
}

.redeem-field label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #000000;
}

#redeemInput {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #0a2038;    /* نفس الذهبي في حنكة */
  background: #ffffff;
  color: #000;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-align: center;
}

/* الأزرار داخل المودال */
.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
}

.modal-actions .btn.primary {
  background: var(--primary);   
  color: #ffffff;
}

.modal-actions .btn.primary:hover {
  background: #103761;
}


/* نص "ما عندك كود؟" والرابط */
.modal-footer-hint {
  margin-top: 10px;
  text-align: center;
  font-size: 0.95rem;
  color: #2b0a00;
}

.modal-footer-hint a {
  color: #000000;
  font-weight: 800;
  text-decoration: underline;
}

/* رسالة الخطأ / النجاح أسفل الحقل */
.redeem-feedback {
  margin-top: 10px;
  text-align: center;
  min-height: 22px;
  font-weight: 700;
  color: #B00020;                /* أحمر واضح */
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.5);
}

/* موبايل */
@media (max-width: 767px) {
  .modal-dialog {
    padding: 16px 14px 12px;
    border-radius: 14px;
  }

  .modal-header h3 {
    font-size: 1.05rem;
  }

  .modal-sub {
    font-size: 0.9rem;
  }

  #redeemInput {
    font-size: 1rem;
  }
}
