/*
 * Wallet page specific tweaks
 */

.tfo-wallet-grid{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:14px;
}

.tfo-wallet-card .tfo-kpi{
  display:flex;
  align-items:baseline;
  gap:8px;
}

.tfo-wallet-card .tfo-kpi .tfo-kpi-value{font-size:22px;font-weight:800;color:var(--tfo-text);}
.tfo-wallet-card .tfo-kpi .tfo-kpi-unit{font-size:12px;color:var(--tfo-muted);font-weight:700;}

.tfo-wallet-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;}

.tfo-wallet-form .form-control{width:100%;}
.tfo-wallet-form .btn{width:100%;}

@media (max-width: 1100px){
  .tfo-wallet-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
}

@media (max-width: 560px){
  .tfo-wallet-grid{grid-template-columns:1fr;}
  .tfo-wallet-actions{grid-template-columns:1fr;}
}
.wallet-product-image {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.wallet-product-image img {
    width: 120px!important;
    height: 120px!important;
    object-fit: contain;
}
.tfo-card-inner {
    overflow: visible !important;
}

/* ===== WALLET CARD – FINAL OVERRIDE ===== */
.tfo-wallet-card .tfo-card-inner{
    display:flex !important;
    flex-direction:column !important;
    align-items:center !important;
    text-align:center !important;
}

/* image always on top */
.tfo-wallet-card .wallet-product-image{
    width:100%;
    height:120px;
    display:flex !important;
    align-items:center;
    justify-content:center;
    margin-bottom:10px;
}

/* image sizing */
.tfo-wallet-card .wallet-product-image img{
    max-width:90px;
    max-height:90px;
    object-fit:contain;
    display:block;
}

/* name */
.tfo-wallet-card .tfo-muted:first-of-type{
    font-weight:700;
    margin-top:6px;
}

/* amount */
.tfo-wallet-card .tfo-kpi{
    margin-top:4px;
}

/* Available */
.tfo-wallet-card .tfo-muted:last-child{
    margin-top:4px;
    font-size:12px;
}



/* =========================================================
   Unified Wallet Action Button + Modal (UI ONLY)
   ========================================================= */
.tfo-wallet-action-launch{
  width:100%;
  display:flex;
  justify-content:flex-start;
  margin-bottom:16px;
}
#tfo-wallet-legacy-actions{
  display:none !important;
}



.tfo-display-block{display:block !important;}
.tfo-display-flex{display:flex !important;}
.tfo-display-inline-flex{display:inline-flex !important;}

#tfo-wallet-action-overlay{
  position:fixed;
  inset:0;
  background:rgba(10,10,10,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index:999999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:18px;
}

#tfo-wallet-action-dialog{
  width:min(560px, 100%);
  background:#ffffff;
  border-radius:22px;
  padding:22px 22px 18px;
  position:relative;
  box-shadow: 0 18px 55px rgba(0,0,0,0.28);
  direction:rtl;
  text-align:right;
  border:1px solid rgba(0,0,0,0.06);
}


#tfo-wallet-action-dialog,
#tfo-wallet-action-dialog *,
#tfo-wallet-action-title,
.tfo-wallet-action-note,
.tfo-action-choice{
  font-family:"Cairo", sans-serif !important;
}

#tfo-choose-deposit{
  background:#16a34a !important;
  border-color:#16a34a !important;
  color:#ffffff !important;
}
#tfo-choose-deposit:hover{
  background:#15803d !important;
  border-color:#15803d !important;
  color:#ffffff !important;
}
#tfo-choose-deposit:active{
  background:#166534 !important;
  border-color:#166534 !important;
}

#tfo-choose-withdraw{
  background:#e11d48 !important;
  border-color:#e11d48 !important;
  color:#ffffff !important;
}
#tfo-choose-withdraw:hover{
  background:#be123c !important;
  border-color:#be123c !important;
  color:#ffffff !important;
}
#tfo-choose-withdraw:active{
  background:#9f1239 !important;
  border-color:#9f1239 !important;
}
#tfo-wallet-action-close{
  position:absolute;
  left:14px;
  right:auto;
  top:12px;
  width:42px;
  height:42px;
  border-radius:14px;
  border:1px solid #e7e7e7;
  background:#ffffff;
  font-size:26px;
  line-height:40px;
  cursor:pointer;
  color:#111;
  padding: 0px 5px!important;
}
#tfo-wallet-action-close:hover{
  background:#f7f7f7;
}

.tfo-wallet-action-head{
  padding-right:4px;
  padding-left:4px;
  padding-top:2px;
  margin-bottom:14px;
}

#tfo-wallet-action-title{
  font-size:20px;
  font-weight:900;
  letter-spacing:0.2px;
  margin:0 0 8px;
}

.tfo-wallet-action-note{
  font-size:13px;
  color:#6b7280;
  line-height:1.7;
  margin:0;
}

#tfo-wallet-action-status{
  display:block;
  font-weight:800;
  border-radius:16px;
  padding:12px 14px;
  margin:12px 0 0;
}

#tfo-wallet-action-status.tfo-alert{
  margin-bottom:0;
}

.tfo-wallet-action-chooser{
  display:flex;
  gap:12px;
  margin-top:16px;
}

.tfo-action-choice{
  flex:1;
  border-radius:16px;
  border:1px solid #e7e7e7;
  padding:14px 12px;
  font-weight:900;
  font-size:15px;
  cursor:pointer;
  transition: background .15s ease, transform .05s ease, border-color .15s ease;
}
.tfo-action-choice:hover{
  background:#f8f8f8;
  border-color:#dedede;
  color: #000;
}
.tfo-action-choice:active{
  transform: translateY(1px);
}
.tfo-action-choice:disabled{
  opacity:0.55;
  cursor:not-allowed;
}

.tfo-wallet-action-formhost{
  margin-top:16px;
}

#tfo-wallet-action-formhost .tfo-wallet-form{
  margin-top:10px;
}

@media (max-width: 520px){
  #tfo-wallet-action-dialog{
    padding:18px 16px 14px;
    border-radius:18px;
  }
  #tfo-wallet-action-title{
    font-size:18px;
  }
  .tfo-wallet-action-chooser{
    flex-direction:column;
  }
  .tfo-action-choice{
    width:100%;
  }
}


/* Wallet balances layout refinement */
.tfo-wallet-page-grid{
  width:100%;
}

.tfo-wallet-balances-card{
  width:100%;
  grid-column:1 / -1;
}

.tfo-wallet-balances-card > .tfo-card-inner{
  width:100%;
}

.tfo-wallet-balances-card .tfo-wallet-grid{
  width:100%;
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  align-items:stretch;
}

.tfo-wallet-balances-card .tfo-wallet-card{
  width:100%;
  min-width:0;
}

.tfo-wallet-balances-card .tfo-wallet-card > .tfo-card-inner{
  width:100%;
  height:100%;
}

@media (max-width: 767px){
  .tfo-wallet-balances-card .tfo-wallet-grid{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}


.tfo-wallet-cash-summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:16px 18px;
  border:1px solid var(--tfo-border);
  border-radius:18px;
  background:linear-gradient(180deg,#fff 0%,#fcfcfc 100%);
  margin-bottom:16px;
}
.tfo-wallet-cash-title{
  font-size:18px;
  font-weight:800;
  color:var(--tfo-text);
}
.tfo-wallet-cash-metrics{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
}
.tfo-wallet-cash-item{
  min-width:180px;
  display:flex;
  align-items:baseline;
  gap:8px;
  padding:12px 14px;
  border:1px solid var(--tfo-border);
  border-radius:14px;
  background:#fff;
}
.tfo-wallet-cash-label{
  font-size:12px;
  font-weight:700;
  color:var(--tfo-muted);
}
.tfo-wallet-cash-value{
  font-size:28px;
  font-weight:900;
  color:var(--tfo-text);
  line-height:1;
}
.tfo-wallet-cash-unit{
  font-size:12px;
  font-weight:800;
  color:var(--tfo-muted);
}
.tfo-wallet-transactions-card{
  grid-column:1 / -1;
  width:100%;
}
.tfo-wallet-transactions-card .tfo-table-wrap{
  width:100%;
}
@media (max-width: 767px){
  .tfo-wallet-cash-summary{
    flex-direction:column;
    align-items:stretch;
  }
  .tfo-wallet-cash-metrics{
    display:grid;
    grid-template-columns:1fr 1fr;
  }
  .tfo-wallet-cash-item{
    min-width:0;
  }
}
@media (max-width: 560px){
  .tfo-wallet-cash-metrics{
    grid-template-columns:1fr;
  }
}


/* =========================================================
   Wallet Views Cleanup – Batch 2B
   ========================================================= */
.tfo-wallet-card-title{
  font-weight:700;
}

.tfo-wallet-card-kpi{
  margin-top:10px;
}

.tfo-wallet-card-meta{
  margin-top:6px;
  font-size:12px;
}

.tfo-wallet-product-hint{
  margin-top:8px;
  font-size:12px;
}

.tfo-wallet-submit-wrap{
  margin-top:12px;
}

.tfo-wallet-shortcode{
  --tfo-bg:#ffffff;
  --tfo-text:#0b0b0b;
  --tfo-muted:#6b7280;
  --tfo-gold:#bba87e;
  --tfo-gold-2:#d6c08a;
  --tfo-border:#e7e7e7;
  --tfo-card:#ffffff;
  --tfo-shadow:0 8px 24px rgba(0,0,0,.06);
  --tfo-radius:16px;
  --tfo-radius-sm:12px;
}

.tfo-wallet-shortcode .tfo-section{
  margin:14px 0;
}

.tfo-wallet-shortcode .card{
  border:1px solid var(--tfo-border);
  border-radius:var(--tfo-radius);
  background:var(--tfo-card);
  box-shadow:var(--tfo-shadow);
}

.tfo-wallet-shortcode .card-inner,
.tfo-wallet-shortcode .tfo-panel-body{
  padding:14px;
}

.tfo-wallet-shortcode .tfo-section-title{
  font-weight:800;
  margin-bottom:10px;
}

.tfo-wallet-shortcode .tfo-table-wrap{
  width:100%;
  overflow:auto;
}

.tfo-wallet-shortcode .tfo-table{
  width:100%;
  border-collapse:collapse;
}

.tfo-wallet-shortcode .tfo-table th,
.tfo-wallet-shortcode .tfo-table td{
  padding:10px 12px;
  border-bottom:1px solid var(--tfo-border);
  text-align:right;
}

.tfo-wallet-shortcode .tfo-wallet-shortcode-form{
  display:grid;
  gap:12px;
}

.tfo-wallet-shortcode .tfo-wallet-shortcode-form label{
  display:grid;
  gap:8px;
  font-weight:700;
}

.tfo-wallet-shortcode .tfo-wallet-shortcode-form select,
.tfo-wallet-shortcode .tfo-wallet-shortcode-form input{
  width:100%;
  min-height:44px;
  padding:10px 12px;
  border:1px solid var(--tfo-border);
  border-radius:12px;
  background:#fff;
  color:var(--tfo-text);
}

.tfo-wallet-shortcode .tfo-wallet-shortcode-form .tfo-btn{
  width:100%;
  justify-content:center;
}

@media (max-width: 640px){
  .tfo-wallet-shortcode .tfo-table thead{
    display:none;
  }

  .tfo-wallet-shortcode .tfo-table,
  .tfo-wallet-shortcode .tfo-table tbody,
  .tfo-wallet-shortcode .tfo-table tr{
    display:block;
    width:100%;
  }

  .tfo-wallet-shortcode .tfo-table tr{
    border:1px solid var(--tfo-border);
    border-radius:var(--tfo-radius-sm);
    background:var(--tfo-card);
    box-shadow:var(--tfo-shadow);
    margin-bottom:12px;
    padding:10px 12px;
  }

  .tfo-wallet-shortcode .tfo-table td{
    display:flex;
    justify-content:space-between;
    gap:10px;
    padding:8px 0;
    border:0;
  }

  .tfo-wallet-shortcode .tfo-table td::before{
    content:attr(data-label);
    color:var(--tfo-muted);
    font-weight:700;
    font-size:12px;
    min-width:36%;
  }

  .tfo-wallet-shortcode .tfo-table td > *{
    max-width:62%;
  }
}


/* Wallet confirm modal extracted from wallet-ui.js */
#tfox-wallet-backdrop.tfo-wallet-confirm-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:2147483647;
  padding:16px;
}

#tfox-wallet-dialog.tfo-wallet-confirm-dialog{
  background:#fff;
  border-radius:22px;
  max-width:520px;
  width:100%;
  box-shadow:0 18px 60px rgba(0,0,0,.25);
  overflow:hidden;
  direction:rtl;
}

.tfo-wallet-confirm-header{
  padding:14px 16px;
  border-bottom:1px solid #e7e7e7;
  background:#fafafa;
  font-weight:800;
}

.tfo-wallet-confirm-body{
  padding:14px 16px;
  line-height:1.6;
}

.tfo-wallet-confirm-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
  border-bottom:1px dashed #eee;
}

.tfo-wallet-confirm-label{
  color:#6b7280;
  font-weight:700;
}

.tfo-wallet-confirm-value{
  font-weight:800;
}

.tfo-wallet-confirm-note{
  margin-top:12px;
  padding:10px 12px;
  border:1px solid #eee;
  border-radius:12px;
  background:#ffffff;
}

.tfo-wallet-confirm-field{
  margin-top:12px;
}

.tfo-wallet-confirm-field-label{
  display:block;
  font-weight:800;
  margin-bottom:6px;
}

.tfo-wallet-confirm-field-input{
  width:100%;
  padding:10px 12px;
  border:1px solid #e7e7e7;
  border-radius:12px;
}

.tfo-wallet-confirm-actions{
  display:flex;
  gap:10px;
  justify-content:flex-start;
  padding:14px 16px;
  border-top:1px solid #e7e7e7;
}

.tfo-wallet-confirm-button{
  padding:10px 14px;
  border-radius:12px;
  font-weight:800;
  cursor:pointer;
}

.tfo-wallet-confirm-button-primary{
  border:1px solid #0b0b0b;
  background:#0b0b0b;
  color:#fff;
}

.tfo-wallet-confirm-button-secondary{
  border:1px solid #e7e7e7;
  background:#fff;
  color:#111;
}

@media (max-width: 520px){
  #tfox-wallet-dialog.tfo-wallet-confirm-dialog{
    border-radius:18px;
  }

  .tfo-wallet-confirm-actions{
    flex-direction:column;
  }

  .tfo-wallet-confirm-button{
    width:100%;
  }
}
