/* styles.css — STFW custom styles layered on top of the Tailwind CDN build */

:root {
  --bg: #0b0f14;
  --surface: #11161d;
  --surface-2: #161d26;
  --border: #232b36;
  --brand: #22c55e;
  --brand-dark: #16a34a;
  --brand-light: #4ade80;
  --accent: #38bdf8;
  --danger: #ef4444;
  --warning: #f59e0b;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(34,197,94,0.08), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(56,189,248,0.06), transparent 45%),
    var(--bg);
}

#app-root {
  position: relative;
  isolation: isolate;
  min-height: 22rem;
  overflow: hidden;
}

.view-enter {
  position: relative;
  z-index: 1;
  animation: viewEnter .22s ease both;
}

@keyframes viewEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

/* ---------- RTL support ---------- */
html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .flip-rtl { transform: scaleX(-1); }
html[dir="rtl"] #toast-container { right: auto; left: 1rem; }

/* ---------- Language-specific font stacks ---------- */
html[lang="my"] body { font-family: 'Noto Sans Myanmar', 'Inter', sans-serif; }
html[lang="th"] body { font-family: 'Noto Sans Thai', 'Inter', sans-serif; }
html[lang="ar"] body { font-family: 'Noto Sans Arabic', 'Inter', sans-serif; }

/* ---------- Select / dropdown fix (prevents white-on-white option text) ---------- */
select {
  color-scheme: dark;
}
select option {
  background-color: var(--surface-2);
  color: #e2e8f0;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #2f3948; }

/* ---------- Nav links ---------- */
.nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: 0.5rem;
  color: #94a3b8;
  transition: background-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.nav-link:hover { background: var(--surface-2); color: #f1f5f9; }
.nav-link.active { background: rgba(34,197,94,0.12); color: var(--brand-light); }

/* ---------- Header glass cluster (language + wallet + auth button) ---------- */
.header-glass-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(255,255,255,0.035);
  border: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 999px;
  padding: 0.3rem;
}
.header-divider {
  width: 1px;
  height: 1.25rem;
  background: rgba(255,255,255,0.1);
  flex-shrink: 0;
}
.lang-select {
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color .15s ease;
}
.lang-select:hover { background: rgba(255,255,255,0.06); }
.lang-select:focus { outline: none; box-shadow: 0 0 0 2px rgba(34,197,94,0.35); }
.wallet-chip {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(34,197,94,0.1);
  color: var(--brand-light);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
}
.btn-header-primary {
  background: var(--brand);
  color: #04140a;
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: background-color .15s ease;
  white-space: nowrap;
}
.btn-header-primary:hover { background: var(--brand-dark); }
.btn-header-ghost {
  background: transparent;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  transition: background-color .15s ease, color .15s ease;
  white-space: nowrap;
}
.btn-header-ghost:hover { background: rgba(239,68,68,0.14); color: #fca5a5; }

/* ---------- View / layout transition ---------- */
#app-root.route-transitioning { opacity: 0; }
#app-root {
  transition: opacity .12s ease;
}
.view-enter {
  animation: viewFadeIn .32s cubic-bezier(.22,.68,.36,1) forwards;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.tab-panel-enter {
  animation: tabFadeIn .22s ease both;
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
}
.card-hover {
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.card-hover:hover {
  border-color: rgba(34,197,94,0.4);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px -12px rgba(0,0,0,0.5);
}

/* ---------- Folder / repo-directory style tile (Home view) ---------- */
.folder-tile {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.folder-tile:hover { background: var(--surface-2); border-color: #2c3644; }
.folder-icon {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  background: rgba(34,197,94,0.1);
  color: var(--brand-light);
}

/* ---------- Inputs ---------- */
.input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: #e2e8f0;
  border-radius: 0.6rem;
  padding: 0.65rem 0.9rem;
  font-size: 0.925rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(34,197,94,0.15);
}
.input::placeholder { color: #64748b; }
label.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.35rem;
}

/* ---------- Buttons ---------- */
.btn-primary {
  background: var(--brand);
  color: #04140a;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: 0.6rem;
  transition: background-color .15s ease, opacity .15s ease;
}
.btn-primary:hover { background: var(--brand-dark); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-secondary {
  background: var(--surface-2);
  color: #e2e8f0;
  border: 1px solid var(--border);
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  border-radius: 0.6rem;
  transition: background-color .15s ease;
}
.btn-secondary:hover { background: #1c2531; }

.btn-danger {
  background: rgba(239,68,68,0.12);
  color: #fca5a5;
  border: 1px solid rgba(239,68,68,0.3);
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: 0.6rem;
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

/* ---------- Password strength meter ---------- */
.strength-track {
  height: 6px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  display: flex;
  gap: 4px;
}
.strength-seg {
  flex: 1;
  border-radius: 999px;
  background: #232b36;
  transition: background-color .2s ease;
}
.strength-seg.filled-weak { background: var(--danger); }
.strength-seg.filled-medium { background: var(--warning); }
.strength-seg.filled-strong { background: var(--accent); }
.strength-seg.filled-very-strong { background: var(--brand); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge-pending { background: rgba(245,158,11,0.14); color: #fbbf24; }
.badge-approved { background: rgba(34,197,94,0.14); color: var(--brand-light); }
.badge-rejected { background: rgba(239,68,68,0.14); color: #fca5a5; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3,6,10,0.72);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 70;
  padding: 1rem;
  animation: fadeIn .15s ease both;
}
.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalPop .18s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: scale(0.96) translateY(6px); } to { opacity: 1; transform: scale(1) translateY(0); } }

/* ---------- Toast ---------- */
.toast {
  border-radius: 0.7rem;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 0.8rem 1rem;
  font-size: 0.875rem;
  box-shadow: 0 12px 30px -10px rgba(0,0,0,0.6);
  animation: toastIn .2s ease both;
}
.toast-success { border-color: rgba(34,197,94,0.4); }
.toast-error { border-color: rgba(239,68,68,0.4); }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
html[dir="rtl"] .toast { animation: none; }

/* ---------- Skeleton loader ---------- */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%);
  background-size: 400% 100%;
  animation: skeletonShimmer 1.4s ease infinite;
  border-radius: 0.6rem;
}
@keyframes skeletonShimmer {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ---------- Tabs ---------- */
.tab-btn {
  padding: 0.55rem 1rem;
  border-radius: 0.55rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #94a3b8;
}
.tab-btn.active { background: var(--surface-2); color: var(--brand-light); }

/* ---------- Wallet segmented tab bar ---------- */
.wallet-tabbar {
  display: flex;
  gap: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem;
  overflow-x: auto;
}
.wallet-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex: 1;
  white-space: nowrap;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.825rem;
  font-weight: 700;
  color: #94a3b8;
  transition: background-color .15s ease, color .15s ease;
}
.wallet-tab:hover { color: #e2e8f0; }
.wallet-tab.active { background: var(--brand); color: #04140a; }
.wallet-balance-chip {
  background: linear-gradient(135deg, rgba(34,197,94,0.14), rgba(56,189,248,0.08));
  border: 1px solid rgba(34,197,94,0.25);
  border-radius: 1rem;
  padding: 1rem 1.5rem;
  text-align: center;
}

/* ---------- Utility ---------- */
.text-gradient {
  background: linear-gradient(90deg, var(--brand-light), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 0.9rem;
  transition: border-color .15s ease, background-color .15s ease;
}
.dropzone.drag-over { border-color: var(--brand); background: rgba(34,197,94,0.06); }

/* ---------- Landing page: stats / steps / trust strip ---------- */
.stat-pill {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 1.1rem 1rem;
  text-align: center;
}
.stat-pill .stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(90deg, var(--brand-light), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.2;
}
.step-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.5rem 1.25rem 1.25rem;
}
.step-number {
  position: absolute;
  top: -0.8rem;
  left: 1.25rem;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 999px;
  background: var(--brand);
  color: #04140a;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(34,197,94,0.35);
}
html[dir="rtl"] .step-number { left: auto; right: 1.25rem; }

.guest-banner {
  background: linear-gradient(90deg, rgba(34,197,94,0.08), rgba(56,189,248,0.06));
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.85rem 1.1rem;
}

.fee-free-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand-light);
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.3);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

/* ---------- Language switcher: force readable colors on the native
   control and its dropdown list (belt-and-suspenders alongside the
   color-scheme:dark inline style, for browsers that ignore it) ---------- */
#lang-switcher {
  background-color: var(--surface-2);
  color: #e2e8f0;
}
#lang-switcher option {
  background-color: var(--surface-2);
  color: #e2e8f0;
}

@media (max-width: 640px) {
  .modal-box { max-width: 100%; }
}

/* ---------- Enhanced Background & QR & Anti-Download Styles ---------- */
.no-download {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}
.no-download img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
  display: block;
}

.blog-cover {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, rgba(34,197,94,.12), rgba(56,189,248,.1));
}

.qr-container {
  background: #ffffff;
  padding: 1.25rem;
  border-radius: 1rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  display: inline-block;
  border: 2px solid rgba(34, 197, 94, 0.3);
}

.hero-glow-bg {
  position: relative;
  overflow: hidden;
}
.hero-glow-bg::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 350px;
  background: radial-gradient(circle, rgba(34,197,94,0.18) 0%, rgba(56,189,248,0.1) 50%, transparent 70%);
  filter: blur(60px);
  z-index: -1;
  animation: pulseGlow 6s ease-in-out infinite alternate;
}
@keyframes pulseGlow {
  0% { transform: translateX(-50%) scale(0.95); opacity: 0.7; }
  100% { transform: translateX(-50%) scale(1.05); opacity: 1; }
}

.floating-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  z-index: -1;
  opacity: 0.15;
  animation: floatOrb 10s ease-in-out infinite alternate;
}
@keyframes floatOrb {
  0% { transform: translateY(0px) translateX(0px); }
  100% { transform: translateY(-30px) translateX(20px); }
}


/* ---------- Global splash / custom dialogue progress loader ---------- */
.global-loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s ease, visibility .24s ease;
}
.global-loader.is-visible {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.global-loader__backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(34,197,94,.14), transparent 34%),
    rgba(5, 10, 16, .78);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.global-loader__dialog {
  position: relative;
  width: min(22rem, calc(100vw - 2rem));
  padding: 2rem 1.5rem 1.4rem;
  border: 1px solid rgba(148,163,184,.18);
  border-radius: 1.25rem;
  background: linear-gradient(145deg, rgba(17,22,29,.96), rgba(10,16,24,.96));
  box-shadow: 0 24px 80px rgba(0,0,0,.42), 0 0 0 1px rgba(34,197,94,.06) inset;
  text-align: center;
  overflow: hidden;
}
.global-loader__dialog::before {
  content: '';
  position: absolute;
  inset: 0 25% auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: .8;
}
.global-loader__brand {
  margin-bottom: 1.25rem;
  color: #f8fafc;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: .18em;
}
.global-loader__brand span { color: var(--brand-light); }
.four-square-loader {
  position: relative;
  width: 3.25rem;
  height: 3.25rem;
  margin: 0 auto 1.35rem;
  transform: rotate(45deg);
  animation: squareLoaderOrbit 1.45s cubic-bezier(.65,.05,.36,1) infinite;
}
.four-square-loader span {
  position: absolute;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: .32rem;
  background: linear-gradient(135deg, var(--brand-light), var(--accent));
  box-shadow: 0 0 1rem rgba(34,197,94,.44);
  animation: squareLoaderPulse 1.45s ease-in-out infinite;
}
.four-square-loader span:nth-child(1) { top: 0; left: 0; animation-delay: -.36s; }
.four-square-loader span:nth-child(2) { top: 0; right: 0; animation-delay: -.18s; }
.four-square-loader span:nth-child(3) { bottom: 0; right: 0; animation-delay: 0s; }
.four-square-loader span:nth-child(4) { bottom: 0; left: 0; animation-delay: .18s; }
@keyframes squareLoaderOrbit {
  0%, 100% { transform: rotate(45deg) scale(.88); }
  50% { transform: rotate(225deg) scale(1); }
}
@keyframes squareLoaderPulse {
  0%, 100% { opacity: .38; transform: scale(.72); }
  50% { opacity: 1; transform: scale(1); }
}
.global-loader__label {
  margin: 0;
  color: #f1f5f9;
  font-size: .9rem;
  font-weight: 700;
}
.global-loader__progress {
  height: .28rem;
  margin: 1rem auto .7rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148,163,184,.15);
}
.global-loader__progress span {
  display: block;
  width: 45%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, var(--brand), var(--accent), transparent);
  box-shadow: 0 0 1rem rgba(56,189,248,.35);
  animation: progressSweep 1.15s ease-in-out infinite;
}
@keyframes progressSweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(300%); }
}
.global-loader__status {
  margin: 0;
  color: #64748b;
  font-size: .72rem;
}
@media (prefers-reduced-motion: reduce) {
  .four-square-loader,
  .four-square-loader span,
  .global-loader__progress span { animation: none; }
  .global-loader__progress span { width: 100%; opacity: .65; }
}
