/* ============================================================
   PayFlowPro — Custom Styles on top of Tabler
   ============================================================ */

:root {
  --pfp-primary: #206bc4;
  --pfp-success: #2fb344;
  --pfp-danger: #d63939;
  --pfp-warning: #f59f00;
  --pfp-muted: #667382;
  --pfp-border: #e9ecef;
  --pfp-shadow: 0 4px 20px rgba(0, 0, 0, .07);
}

/* --- Page loader --- */
#page-loader {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .3s ease;
}
#page-loader.hidden { opacity: 0; pointer-events: none; }

/* --- Brand logo area --- */
.navbar-brand img { max-height: 48px; }
.brand-logo { font-size: 1.4rem; font-weight: 800; color: var(--pfp-primary); }

/* --- Stat cards --- */
.stat-card {
  border-radius: 12px;
  box-shadow: var(--pfp-shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
}

/* --- Payment form card --- */
.pay-card {
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(32,107,196,.15);
  overflow: hidden;
}
.pay-card .card-header {
  background: linear-gradient(135deg, #065CAD 0%, #1e5fa3 100%);
  padding: 28px 32px;
}
.pay-card .card-title {
  background: linear-gradient(35deg, #F7D000 0%, #00CF30 100%);
  padding: 2px 3px;
}

.pay-card .card-header h2 { color: #fff; margin: 0; font-size: 1.3rem; font-weight: 700; }
.pay-card .card-header h1 { color: #fff; margin: 0; font-size: 2.3rem; font-weight: 700; }
.pay-card .card-header p  { color: rgba(255,255,255,.75); margin: 4px 0 0; font-size: .9rem; }
.pay-card .card-title p  { color: rgb(255, 255, 255); margin: 4px 0 0; font-size: .9rem; }
/* --- Amount input ring --- */
.amount-ring {
  position: relative;
}
.amount-ring .currency-symbol {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--pfp-primary);
  z-index: 2;
}
.amount-ring input { padding-left: 32px; font-size: 1.4rem; font-weight: 700; height: 56px; }

/* --- Stripe badge --- */
.stripe-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: .75rem;
  color: var(--pfp-muted);
  margin-top: 12px;
}

/* --- Table enhancements --- */
.table-hover tbody tr:hover { background-color: rgba(32,107,196,.04); }

/* --- Status pills --- */
.status-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 6px;
}
.status-dot.succeeded { background: var(--pfp-success); }
.status-dot.pending   { background: var(--pfp-warning); }
.status-dot.failed    { background: var(--pfp-danger); }
.status-dot.processing { background: var(--pfp-primary); }

/* --- Invoice print styles --- */
@media print {
  .no-print, .navbar, .sidebar, .btn, footer { display: none !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
  .page-wrapper { padding: 0 !important; margin: 0 !important; }
}

/* --- Auth pages --- */
.auth-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #e8f0fe 0%, #f4f6f9 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(32,107,196,.2);
}

/* --- Account badge --- */
.account-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: .75rem;
  font-weight: 600;
}
.account-badge.default { background: #dbeafe; color: #1d4ed8; }
.account-badge.inactive { background: #fee2e2; color: #991b1b; }

/* --- Spinner overlay --- */
.btn-loading { position: relative; color: transparent !important; }
.btn-loading::after {
  content: "";
  position: absolute;
  width: 16px; height: 16px;
  top: 50%; left: 50%;
  margin: -8px 0 0 -8px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- Sidebar active --- */
.navbar-nav .nav-item.active > .nav-link {
  color: var(--pfp-primary) !important;
  background: rgba(32,107,196,.08);
  border-radius: 6px;
}

/* --- Mobile pay button --- */
.btn-cashapp {
  background: #00D54B;
  border-color: #00D54B;
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  height: 52px;
  border-radius: 10px;
  transition: background .2s, transform .15s;
}
.btn-cashapp:hover {
  background: #00b841;
  border-color: #00b841;
  color: #fff;
  transform: translateY(-1px);
}
.btn-cashapp:active { transform: translateY(0); }

.btn-logout {
  background: #ff0404;
  border-color: #ff0404;
  color: #ffffff;
  font-weight: 700;
  font-size: 1rem;
  height: 52px;
  border-radius: 10px;
  transition: background .2s, transform .15s;
}

/* --- Fix select visibility issue --- */
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-color: #ffffff;
  color: #111827; /* force visible text */
  border: 1px solid #e5e7eb;
  border-radius: 10px;

  padding-right: 40px; /* space for arrow */
  font-weight: 600;
}

/* Dropdown options */
select.form-control option {
  color: #111827;
  background: #ffffff;
}

/* Focus state */
select.form-control:focus {
  color: #111827;
  background-color: #ffffff;
  border-color: #206bc4;
  box-shadow: 0 0 0 3px rgba(32,107,196,0.12);
}

/* Disabled placeholder option */
select.form-control option[value=""] {
  color: #9ca3af;
}

/* Custom arrow */
select.form-control {
  background-image: url("data:image/svg+xml;utf8,<svg fill='%236b7280' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5.5 7l4.5 4 4.5-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 16px;
}

.card .form-control.form-control-lg {
  color: #111827 !important;
  background-color: #ffffff !important;
}

/* --- Responsive table --- */
@media (max-width: 768px) {
  .table-responsive-stack td:before {
    content: attr(data-label);
    font-weight: 600;
    display: block;
    font-size: .75rem;
    color: var(--pfp-muted);
    margin-bottom: 2px;
  }
}
