/* ══════════════════════════════════════════════════════════════════
   ARCADE STORE — UNIFIED WALLET CARD STYLES (my-wallet.css)
   متوافق تماماً مع اوامر.ini ومع نمط بطاقات لوحة التحكم (orders-card / ea-card):
   - بطاقة موحدة (Single Unified Card) تجمع الرصيد والسجل بانسيابية
   - صفر ظلال (box-shadow: none !important)
   - لون المتجر الأساسي #433293
   - سرعة تفاعلات 140ms ease-out
══════════════════════════════════════════════════════════════════ */
.ww {
  direction: rtl;
  font-family: inherit;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ww *,
.ww *::before,
.ww *::after {
  box-sizing: border-box;
}

/* 1. البطاقة الموحدة */
.ww-card {
  background-color: #ffffff;
  border: 1px solid var(--color-border, #e0e0e0);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
}

/* 2. ترويسة البطاقة الرئيسية */
.ww-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background-color: var(--color-block, #f8fafc);
  border-bottom: 1px solid var(--color-divider, #e8e8e8);
  flex-wrap: wrap;
}

.ww-head-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ww-head-icon {
  width: 22px;
  height: 22px;
  stroke: var(--color-primary, #433293);
  flex-shrink: 0;
}

.ww-head-titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ww-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-heading, #0f0f0f);
  line-height: 1.2;
}

.ww-desc {
  margin: 0;
  font-size: 12px;
  color: var(--color-text-muted, #64748b);
  line-height: 1.3;
}

.ww-head-meta {
  display: flex;
  align-items: center;
}

/* شارة الحالة */
.ww-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
}

.ww-status--active {
  background-color: #f0fdf4;
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #059669;
}

.ww-status--banned {
  background-color: #fef2f2;
  border: 1px solid rgba(220, 38, 38, 0.25);
  color: #dc2626;
}

.ww-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

/* 3. شريط الرصيد والإجراءات */
.ww-balance-sec {
  padding: 24px 24px 22px;
  background-color: #ffffff;
  border-bottom: 1px solid var(--color-divider, #e8e8e8);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.ww-balance-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ww-balance-caption {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.ww-balance-val {
  font-size: 36px;
  font-weight: 800;
  color: #0f0f0f;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.ww-balance-val .woocommerce-Price-currencySymbol {
  font-size: 22px;
  font-weight: 600;
  color: #64748b;
  margin-right: 4px;
}

/* ── صف الأزرار الإجرائية الرئيسي ── */
.ww-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ww-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  min-width: 140px;
  padding: 0 20px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: none !important;
  transition: all 140ms ease-out;
  user-select: none;
}

.ww-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* 1. زر شحن الرصيد الأساسي (Primary) */
.ww-btn--primary {
  background-color: var(--color-primary, #433293);
  color: #ffffff !important;
  border: 1px solid var(--color-primary, #433293);
}

.ww-btn--primary:hover {
  background-color: #352875;
  border-color: #352875;
  color: #ffffff !important;
}

.ww-btn--primary:active {
  background-color: #271c59;
  border-color: #271c59;
}

/* 2. زر تحويل الرصيد الثانوي (Secondary) */
.ww-btn--secondary {
  background-color: #f5f3ff;
  color: var(--color-primary, #433293) !important;
  border: 1px solid rgba(67, 50, 147, 0.26);
}

.ww-btn--secondary:hover {
  background-color: var(--color-primary, #433293);
  color: #ffffff !important;
  border-color: var(--color-primary, #433293);
}

.ww-btn--secondary:active {
  background-color: #352875;
  border-color: #352875;
}

.ww-btn--disabled {
  background-color: #f1f5f9;
  color: #94a3b8 !important;
  border: 1px solid #e2e8f0;
  cursor: not-allowed;
  opacity: 0.75;
}

/* 4. شريط عنوان سجل العمليات والتبويبات */
.ww-tx-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--color-divider, #e8e8e8);
  flex-wrap: wrap;
}

.ww-tx-subhead-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ww-subhead-icon {
  width: 17px;
  height: 17px;
  stroke: var(--color-primary, #433293);
  flex-shrink: 0;
}

.ww-subhead-text {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #0f0f0f;
  line-height: 1.2;
}

/* تبويبات الفلترة المدمجة (Segmented Control) */
.ww-filter-tabs {
  display: inline-flex;
  align-items: center;
  background-color: #eef2f6;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  gap: 3px;
}

.ww-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 140ms ease-out;
  user-select: none;
}

.ww-tab:hover {
  color: #0f0f0f;
}

.ww-tab--active {
  background-color: #ffffff !important;
  color: var(--color-primary, #433293) !important;
  font-weight: 700;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
}

.ww-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  border-radius: 999px;
  background-color: #e2e8f0;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: all 140ms ease-out;
}

.ww-tab--active .ww-tab-count {
  background-color: #ede9fe;
  color: var(--color-primary, #433293);
}

.ww-tab-count--credit {
  background-color: #dcfce7;
  color: #166534;
}

.ww-tab-count--debit {
  background-color: #fee2e2;
  color: #991b1b;
}

.ww-tab--active .ww-tab-count--credit {
  background-color: #16a34a;
  color: #ffffff;
}

.ww-tab--active .ww-tab-count--debit {
  background-color: #dc2626;
  color: #ffffff;
}

/* 5. جسم قائمة المعاملات */
.ww-tx-wrap {
  padding: 16px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ww-tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ww-tx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(67, 50, 147, 0.08);
  border-radius: 8px;
  background-color: #fafafc;
  transition: background-color 140ms ease-out, border-color 140ms ease-out;
}

.ww-tx-row:hover {
  background-color: #f5f3ff;
  border-color: rgba(67, 50, 147, 0.2);
}

.ww-tx-row--hidden {
  display: none !important;
}

.ww-tx-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.ww-tx-sign {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ww-tx-sign svg {
  width: 15px;
  height: 15px;
}

.ww-tx-sign--credit {
  background-color: #f0fdf4;
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #059669;
}

.ww-tx-sign--debit {
  background-color: #fef2f2;
  border: 1px solid rgba(220, 38, 38, 0.2);
  color: #dc2626;
}

.ww-tx-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.ww-tx-desc {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: #0f0f0f;
  line-height: 1.35;
  word-break: break-word;
}

.ww-tx-date {
  font-size: 11.5px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

.ww-tx-amount-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.ww-tx-val {
  font-size: 14.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.ww-tx-val--credit {
  color: #059669;
}

.ww-tx-val--debit {
  color: #dc2626;
}

.ww-tx-pill {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1.1;
}

.ww-tx-pill--credit {
  background-color: #dcfce7;
  color: #166534;
}

.ww-tx-pill--debit {
  background-color: #fee2e2;
  color: #991b1b;
}

/* زر عرض المزيد */
.ww-more-wrap {
  display: flex;
  justify-content: center;
  padding-top: 6px;
}

.ww-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 22px;
  border-radius: 8px;
  background-color: #ffffff;
  border: 1px solid rgba(67, 50, 147, 0.2);
  color: var(--color-primary, #433293);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 140ms ease-out;
}

.ww-more-btn:hover {
  background-color: #f5f3ff;
  border-color: var(--color-primary, #433293);
}

.ww-more-btn svg {
  width: 14px;
  height: 14px;
}

.ww-more-count {
  font-size: 11.5px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}

/* حالة فارغة */
.ww-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 16px;
  gap: 12px;
}

.ww-empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background-color: #f5f3ff;
  border: 1px solid rgba(67, 50, 147, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary, #433293);
}

.ww-empty-icon svg {
  width: 24px;
  height: 24px;
}

.ww-empty-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f0f0f;
}

.ww-empty-desc {
  margin: 0;
  font-size: 12.5px;
  color: #64748b;
  max-width: 280px;
}

.ww-no-filter-msg {
  padding: 24px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  background-color: #f8fafc;
  border-radius: 8px;
  border: 1px dashed rgba(67, 50, 147, 0.16);
}

/* ══════════════════════════════════════════
   نافذة تحويل الرصيد المنبثقة (Modal)
   - صفر ظلال (box-shadow: none !important)
   - انتقالات هادئة 140ms
══════════════════════════════════════════ */
.ww-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999999;
}

.ww-modal.open,
.ww-modal.is-visible {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

.ww-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  z-index: 1;
}

.ww-modal-dialog {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 480px;
  margin: 16px;
  animation: wwModalFadeIn 140ms ease-out;
}

@keyframes wwModalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.ww-modal-content {
  background-color: #ffffff;
  border: 1px solid rgba(67, 50, 147, 0.18);
  border-radius: 12px;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: calc(100vh - 40px);
}

.ww-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(67, 50, 147, 0.1);
  background-color: #fafafc;
}

.ww-modal-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ww-modal-icon {
  width: 18px;
  height: 18px;
  stroke: var(--color-primary, #433293);
  flex-shrink: 0;
}

.ww-modal-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f0f0f;
  line-height: 1.2;
}

.ww-modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid rgba(67, 50, 147, 0.12);
  background-color: #ffffff;
  color: #64748b;
  cursor: pointer;
  box-shadow: none !important;
  transition: background-color 140ms ease-out, color 140ms ease-out;
}

.ww-modal-close:hover {
  background-color: #ede9fe;
  color: var(--color-primary, #433293);
  border-color: var(--color-primary, #433293);
}

.ww-modal-close svg {
  width: 14px;
  height: 14px;
}

.ww-modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* تنسيقات نموذج التحويل داخل النافذة */
.ww-transfer-form,
.ww-modal-body form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.ww-form-row,
.ww-modal-body .form-row,
.ww-modal-body p.form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  padding: 0;
}

.ww-form-row label,
.ww-modal-body label {
  font-size: 12.5px;
  font-weight: 600;
  color: #1e1b4b;
  margin: 0;
}

.ww-form-row input,
.ww-form-row textarea,
.ww-modal-body input[type="text"],
.ww-modal-body input[type="number"],
.ww-modal-body input[type="email"],
.ww-modal-body textarea {
  width: 100%;
  border: 1px solid rgba(67, 50, 147, 0.18);
  border-radius: 8px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  color: #0f0f0f;
  background-color: #f8fafc;
  box-shadow: none !important;
  outline: none;
  transition: border-color 140ms ease-out, background-color 140ms ease-out;
}

.ww-form-row input:focus,
.ww-form-row textarea:focus,
.ww-modal-body input:focus,
.ww-modal-body textarea:focus {
  border-color: var(--color-primary, #433293);
  background-color: #ffffff;
}

.ww-btn--full,
.ww-modal-body input[type="submit"],
.ww-modal-body button[type="submit"] {
  width: 100%;
  height: 42px;
  background-color: var(--color-primary, #433293);
  color: #ffffff;
  border: 1px solid var(--color-primary, #433293);
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none !important;
  transition: background-color 140ms ease-out;
}

.ww-modal-body input[type="submit"]:hover,
.ww-modal-body button[type="submit"]:hover {
  background-color: #352875;
}

.ww-transfer-trigger {
  display: none !important;
}

/* ══════════════════════════════════════════
   التجاوب مع الهواتف (Responsive)
══════════════════════════════════════════ */
@media (max-width: 680px) {
  .ww-head {
    padding: 14px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .ww-balance-sec {
    padding: 18px 16px;
    gap: 14px;
  }
  .ww-balance-val {
    font-size: 28px;
  }
  .ww-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
    width: 100%;
  }
  .ww-btn {
    width: 100%;
    min-width: 0;
    padding: 0 12px;
    font-size: 13px;
  }
  .ww-tx-subhead {
    padding: 12px 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .ww-filter-tabs {
    width: 100%;
    justify-content: space-between;
  }
  .ww-tab {
    flex: 1;
    justify-content: center;
    padding: 5px 6px;
  }
  .ww-tx-wrap {
    padding: 12px 14px 16px;
  }
  .ww-tx-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .ww-tx-amount-wrap {
    align-items: flex-start;
    flex-direction: row;
    width: 100%;
    justify-content: space-between;
    padding-top: 6px;
    border-top: 1px dashed rgba(67, 50, 147, 0.08);
  }
}
