/* ============================================
        ADONIS AI — Stylesheet
        style.css
   ============================================ */

/* ─── CSS Variables ────────────────────────── */
:root {
  --gold: #f6af51;
  --gold-rgb: 246, 175, 81;
  --gold-light: #f9c989;
  --gold-dark: #be853a;
  --gold-glow: rgba(246, 175, 81, 0.25);
  --black: #101b2f;
  --black-2: #142139;
  --black-3: #172744;
  --black-4: #1c3053;
  --black-5: #223963;
  --white: #f0e8d5;
  --white-dim: rgba(240, 232, 213, 0.65);
  --white-faint: rgba(240, 232, 213, 0.15);
  --danger: #c0392b;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow-gold: 0 0 20px rgba(200, 161, 72, 0.3);
  --shadow-elevated: 0 24px 48px rgba(0, 0, 0, 0.55), 0 0 1px rgba(246, 175, 81, 0.12);
  --border-gold: rgba(200, 161, 72, 0.22);
  --border-gold-strong: rgba(200, 161, 72, 0.38);
  --glass: rgba(20, 33, 57, 0.72);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.12s cubic-bezier(0.4, 0, 0.2, 1);
  --font-ui: 'Tajawal', system-ui, sans-serif;
  --font-display: 'Cinzel Decorative', 'Cinzel', serif;
  --font-welcome: 'Ruwudu', 'Tajawal', system-ui, sans-serif;
  --font-quote: 'Ruwudu', 'Tajawal', serif;
}

html[lang="en"],
html[lang="es"],
html[lang="de"] {
  --font-ui: 'Outfit', system-ui, sans-serif;
  --font-display: 'Cormorant Garamond', 'Cinzel', Georgia, serif;
  --font-welcome: 'Cormorant Garamond', 'Cinzel', Georgia, serif;
  --font-quote: 'Cormorant Garamond', 'Cinzel', Georgia, serif;
}

html[lang="hi"] {
  --font-ui: 'Noto Sans Devanagari', 'Outfit', system-ui, sans-serif;
  --font-display: 'Tiro Devanagari Hindi', 'Cormorant Garamond', Georgia, serif;
  --font-welcome: 'Tiro Devanagari Hindi', 'Noto Sans Devanagari', serif;
  --font-quote: 'Tiro Devanagari Hindi', 'Noto Sans Devanagari', serif;
}

html[lang="en"] .logo-title,
html[lang="es"] .logo-title,
html[lang="hi"] .logo-title,
html[lang="de"] .logo-title {
  letter-spacing: 0.35em;
  margin-inline-end: -0.35em;
}

html[dir="ltr"] #message-input {
  direction: ltr;
}

/* ─── Reset & Base ────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

html,
body {
  height: 100%;
  overflow: hidden;
  font-family: var(--font-ui);
  background: var(--black);
  color: var(--white);
}

html[dir="rtl"] body {
  direction: rtl;
}

html[dir="ltr"] body {
  direction: ltr;
}

/* ─── Touch responsiveness (WebView) ────────
   بدون هذا: أي ضغطة على أي عنصر تُظهر تظليلاً رمادياً افتراضياً من
   WebView نفسه، ولا يوجد أي رد فعل بصري فوري قبل اكتمال أي معالجة —
   فيبدو التطبيق "غير مستجيب" حتى لو كان المنطق البرمجي سريعاً فعلاً. */
html {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
[role="button"] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* شبكة أمان عامة: أي <button> بلا حالة :active خاصة به يحصل تلقائياً على
   استجابة ضغط فورية (100-150ms). :where() تُصفّر خصوصية الشرط بحيث تبقى
   أي قاعدة :active أكثر تحديداً (مثل .feature-card:active) هي الغالبة كالمعتاد */
button:where(:not(:disabled)):active {
  transform: scale(0.96);
  transition: transform var(--transition-fast);
}

/* ─── Language switcher ───────────────────── */
.lang-switcher {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  inset-inline-end: max(12px, env(safe-area-inset-right));
  z-index: 10050;
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(16, 27, 47, 0.72);
  border: 1px solid var(--border-gold);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.lang-opt {
  min-width: 36px;
  height: 32px;
  padding: 0 10px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--white-dim);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.lang-opt:hover {
  color: var(--gold);
  background: rgba(246, 175, 81, 0.08);
}

.lang-opt.active {
  color: var(--black);
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
}

::selection {
  background: rgba(246, 175, 81, 0.35);
  color: var(--white);
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ─── Scrollbar ───────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--gold-dark), var(--gold));
  border-radius: 6px;
  border: 2px solid var(--black-2);
}

/* ─── Screens ─────────────────────────────── */
.screen {
  position: fixed;
  inset: 0;
  display: none;
}

.screen.active {
  display: flex;
  animation: screenEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes screenEnter {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen.active {
    animation: none;
  }
}

/* ============================================
   AUTH SCREEN
   ============================================ */
#auth-screen {
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(246, 175, 81, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 50% 110%, rgba(190, 133, 58, 0.05) 0%, transparent 50%),
    var(--black);
  overflow: hidden;
}

/* Animated particles */
.bg-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--gold);
  border-radius: 50%;
  animation: float-up linear infinite;
  opacity: 0;
}

@keyframes float-up {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }

  10% {
    opacity: 0.6;
  }

  90% {
    opacity: 0.2;
  }

  100% {
    transform: translateY(-10vh) scale(1);
    opacity: 0;
  }
}

/* Eye of Ra background decoration */
.eye-of-ra {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center,
      rgba(200, 161, 72, 0.04) 0%,
      rgba(200, 161, 72, 0.01) 40%,
      transparent 70%);
  pointer-events: none;
  animation: pulse-glow 4s ease-in-out infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }

  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

/* Auth Container */
.auth-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 440px;
  padding: 12px 20px 20px;
  animation: fade-in-up 0.8s ease both;
}

.auth-card {
  position: relative;
  padding: 28px 26px 26px;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.auth-card::before {
  display: none !important;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Logo */
.logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 24px;
}

.anubis-symbol-img {
  width: min(280px, 65vw);
  height: min(280px, 65vw);
  object-fit: contain;
  margin-bottom: 12px;
  mix-blend-mode: screen;
  transition: transform 0.65s cubic-bezier(0.25, 1, 0.5, 1);
}

.anubis-symbol-img.spinning {
  animation: logo-spin-transition 1.25s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.anubis-symbol-img.spinning-fast {
  animation: logo-spin-loop 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.anubis-symbol-img.spinning-slow {
  animation: logo-spin-loop 8s linear infinite;
}

@keyframes logo-spin-once {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes logo-spin-loop {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes logo-spin-transition {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(720deg);
  }
}

.logo-title {
  max-width: 92vw;
  font-family: 'Orbitron', sans-serif;
  font-size: clamp(28px, 7vw, 38px);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.28em;
  margin-inline-end: -0.28em;
  text-shadow: 0 0 30px var(--gold-glow), 0 2px 4px rgba(0, 0, 0, 0.5);
  line-height: 1.15;
}

.logo-sub {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--white-dim);
  letter-spacing: 0.12em;
  margin-top: 8px;
  font-weight: 400;
}

/* Tabs */
.auth-tabs {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 4px;
  margin-bottom: 22px;
  gap: 4px;
}

.tab-btn {
  flex: 1;
  padding: 11px 10px;
  border: none;
  background: transparent;
  color: var(--white-dim);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 500;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover:not(.active) {
  color: var(--white);
  background: rgba(246, 175, 81, 0.06);
}

.tab-btn.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--black);
  font-weight: 700;
  box-shadow: 0 2px 12px var(--gold-glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

/* Forms */
.auth-form {
  display: none;
}

.auth-form.active {
  display: block;
  animation: fade-in 0.3s ease;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.input-group {
  margin-bottom: 16px;
}

.input-group label {
  display: block;
  font-size: 12px;
  color: var(--gold-light);
  letter-spacing: 0.04em;
  margin-bottom: 7px;
  font-weight: 500;
}

.input-group input {
  width: 100%;
  padding: 13px 16px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 15px;
  outline: none;
  transition: var(--transition);
  direction: ltr;
  text-align: right;
}

.input-group input:hover {
  border-color: var(--border-gold-strong);
}

.input-group input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
  background: var(--black-4);
}

.input-group input::placeholder {
  color: rgba(240, 232, 213, 0.3);
}

/* ─── intl-tel-input Dark Theme Overrides ─── */
.iti { width: 100%; direction: ltr; }

.iti__tel-input,
.input-group .iti input[type="tel"] {
  width: 100%;
  padding: 12px 16px 12px 52px;
  background: var(--black-3);
  border: 1px solid rgba(246, 175, 81, 0.2) !important;
  border-radius: var(--radius) !important;
  color: var(--white) !important;
  font-family: var(--font-ui);
  font-size: 14px;
  outline: none;
  transition: var(--transition);
  box-shadow: none !important;
  direction: ltr;
  text-align: left;
}

.iti__tel-input:focus,
.input-group .iti input[type="tel"]:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 3px var(--gold-glow) !important;
  background: var(--black-4) !important;
}

.iti__flag-container { left: 0; right: auto; }

.iti__selected-flag {
  background: transparent !important;
  border-radius: var(--radius) 0 0 var(--radius);
  padding: 0 10px 0 8px;
  border-right: 1px solid rgba(246, 175, 81, 0.15);
}
.iti__selected-flag:hover { background: rgba(246, 175, 81, 0.07) !important; }

.iti__selected-dial-code { color: var(--gold) !important; font-weight: 700; font-size: 13px; }

.iti__arrow { border-top-color: var(--white-dim) !important; }
.iti__arrow--up { border-bottom-color: var(--white-dim) !important; }

.iti__country-list {
  background: var(--black-3) !important;
  border: 1px solid rgba(246, 175, 81, 0.25) !important;
  border-radius: var(--radius) !important;
  box-shadow: 0 10px 40px rgba(0,0,0,0.7) !important;
  color: var(--white) !important;
  max-height: 240px;
  direction: ltr;
}

.iti__country {
  padding: 9px 14px !important;
  transition: background 0.15s;
}
.iti__country:hover,
.iti__country.iti__highlight { background: rgba(246, 175, 81, 0.1) !important; }

.iti__country-name { color: var(--white) !important; }
.iti__dial-code { color: var(--gold) !important; font-weight: 600; }

.iti__divider { border-bottom-color: rgba(246, 175, 81, 0.15) !important; }

.iti__search-input {
  background: var(--black-4) !important;
  border-bottom: 1px solid rgba(246, 175, 81, 0.15) !important;
  color: var(--white) !important;
  font-family: var(--font-ui);
  padding: 8px 12px !important;
  direction: ltr;
}
.iti__search-input::placeholder { color: rgba(240, 232, 213, 0.35) !important; }
.iti__search-input:focus { outline: none !important; box-shadow: none !important; }

.btn-primary {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
  color: var(--black);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 1px;
  position: relative;
  overflow: hidden;
  margin-top: 8px;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: 0.5s;
}

.btn-primary:hover::before {
  left: 100%;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--gold-glow), 0 0 40px rgba(200, 161, 72, 0.2);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

.auth-error {
  color: #e74c3c;
  font-size: 13px;
  text-align: center;
  margin-top: 10px;
  padding: 8px;
  background: rgba(231, 76, 60, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(231, 76, 60, 0.2);
}

.hidden {
  display: none !important;
}

/* ============================================
   CHAT SCREEN
   ============================================ */
#chat-screen {
  justify-content: center;
  align-items: center;
  background: var(--black);
  position: relative;
}

/* ─── Chat Main ───────────────────────────── */
.chat-main.portrait-mode {
  position: relative;
  z-index: 3;
  width: 100%;
  max-width: 720px;
  height: 100vh;
  height: 100dvh;
  background: transparent;
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(200, 161, 72, 0.12);
  border-left: 1px solid rgba(200, 161, 72, 0.12);
  box-shadow:
    0 0 80px rgba(0, 0, 0, 0.65),
    inset 0 1px 0 rgba(246, 175, 81, 0.06);
}

/* Subtle background texture */
.chat-main.portrait-mode::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 80% 20%, rgba(200, 161, 72, 0.03) 0%, transparent 60%),
    radial-gradient(ellipse at 20% 80%, rgba(200, 161, 72, 0.02) 0%, transparent 60%);
  pointer-events: none;
}

/* Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  padding-top: max(14px, env(safe-area-inset-top));
  background: rgba(17, 17, 17, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}



.header-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-logo-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-symbol-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  mix-blend-mode: screen;
}

.online-indicator {
  position: absolute;
  bottom: 0;
  right: -2px;
  width: 10px;
  height: 10px;
  background-color: #2ecc71;
  border-radius: 50%;
  border: 2px solid var(--black-2);
  animation: pulse-green 2s infinite;
}

@keyframes pulse-green {
  0% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(46, 204, 113, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
  }
}

.header-title h2 {
  font-family: var(--font-display);
  font-size: 17px;
  color: var(--gold);
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.header-status {
  font-size: 12px;
  color: var(--white-dim);
  margin-top: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Toast: تم نسخ رقم الحساب */
.account-copy-toast {
  position: fixed;
  z-index: 10050;
  padding: 8px 14px;
  background: var(--black-2);
  border: 1px solid var(--border-gold-strong);
  border-radius: 10px;
  color: var(--gold-light);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 16px var(--gold-glow);
  opacity: 0;
  transform: translateY(6px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}

.account-copy-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.action-icon {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-gold);
  color: var(--white);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
}

.action-icon:hover {
  background: rgba(200, 161, 72, 0.12);
  border-color: var(--gold);
  transform: translateY(-1px);
}

.action-icon:active {
  transform: translateY(0);
}

.action-icon.danger {
  border-color: rgba(192, 57, 43, 0.3);
}

.action-icon.danger:hover {
  background: rgba(192, 57, 43, 0.1);
  border-color: #e74c3c;
}

/* Messages Area */
.chat-messages-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  flex-direction: column;
}

.messages-area {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: transparent;
  position: relative;
  z-index: 9;
  scroll-behavior: smooth;
}

.chat-scroll-down {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 15;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(200, 161, 72, 0.45);
  background: rgba(12, 12, 12, 0.92);
  color: var(--gold);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45), 0 0 16px rgba(200, 161, 72, 0.12);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease, box-shadow 0.2s ease;
}

.chat-scroll-down.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.chat-scroll-down:hover {
  border-color: var(--gold);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.5), 0 0 22px rgba(200, 161, 72, 0.22);
}

.chat-scroll-down:active {
  transform: translateX(-50%) scale(0.96);
}

.chat-scroll-down-icon {
  width: 22px;
  height: 22px;
}

.chat-scroll-down-badge {
  position: absolute;
  top: -6px;
  inset-inline-end: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--black);
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Welcome Message */
.messages-area:not(:has(.message)) {
  justify-content: center;
}

.welcome-msg {
  text-align: center;
  padding: 16px 4px 20px;
  animation: fade-in-up 0.8s ease both;
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: none;
  margin: 0 auto;
  flex-shrink: 0;
}

/* توهج داكن خفيف خلف نص الترحيب فقط — يحسّن التباين فوق الشعار من غير ما يخفيه */
.welcome-msg::before {
  content: "";
  position: absolute;
  inset: -24px -12px;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.28) 55%, transparent 80%);
  z-index: -1;
  pointer-events: none;
}

.logo-shimmer-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 500px;
  height: 500px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.13;

  /* نقلنا الماسك هنا حتى يبقى شكل اللوجو ثابتاً ولا يتحرك مع حركة الإضاءة */
  -webkit-mask: url("anubisauthlogo.png") center/contain no-repeat;
  mask: url("anubisauthlogo.png") center/contain no-repeat;
}

/* الصورة نفسها */
.chat-bg-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* اللمعة المعدنية فقط على اللوجو */
.logo-shimmer-wrap::after {
  content: "";
  position: absolute;
  inset: -20%;
  /* تكبير المساحة قليلاً لتجنب القص عند الانحراف */

  /* استخدام تأثير الإضاءة والتباين فقط بدون أي ألوان */
  backdrop-filter: brightness(1.8) contrast(3.2);
  -webkit-backdrop-filter: brightness(1.8) contrast(1.2);

  /* تحويل التدرج اللوني إلى ماسك لكي يظهر الفلتر على شكل خط مائل */
  -webkit-mask: linear-gradient(120deg,
      transparent 0%,
      transparent 45%,
      black 50%,
      transparent 55%,
      transparent 100%);
  mask: linear-gradient(120deg,
      transparent 0%,
      transparent 45%,
      black 50%,
      transparent 55%,
      transparent 100%);

  transform: translateX(-120%) skewX(-20deg);
  /* جعلنا الحركة أبطأ بتغيير المدة إلى 6 ثواني */
  animation: metal-scan 7s linear infinite;
}

/* حركة الإضاءة فقط */
@keyframes metal-scan {
  0% {
    transform: translateX(-140%) skewX(-25deg);
  }

  100% {
    transform: translateX(140%) skewX(-25deg);
  }
}

.welcome-msg h3 {
  font-family: var(--font-welcome);
  font-size: clamp(18px, 4.5vw, 26px);
  font-weight: 600;
  color: var(--gold);
  margin-bottom: 10px;
  letter-spacing: 0.02em;
  line-height: 1.35;
  white-space: nowrap;
}

.welcome-subtitle {
  font-family: var(--font-quote);
  color: var(--gold-light);
  font-size: clamp(11px, 2.8vw, 19px);
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-shadow: 0 0 28px rgba(246, 175, 81, 0.18);
  margin-top: 0;
  white-space: normal;
  overflow-wrap: break-word;
  width: 100%;
  max-width: 100%;
  padding: 0 16px;
  overflow: visible;
}

html[lang="ar"] .welcome-subtitle {
  font-weight: 600;
  font-size: clamp(13px, 3.4vw, 20px);
  letter-spacing: 0.01em;
}

html[lang="en"] .welcome-subtitle {
  font-style: italic;
  font-weight: 500;
  font-size: clamp(9px, 2.35vw, 17px);
  letter-spacing: 0.02em;
}

html[lang="en"] .welcome-msg h3 {
  font-size: clamp(15px, 3.8vw, 24px);
  letter-spacing: 0.03em;
}

/* Message Bubbles */
.message {
  display: flex;
  gap: 12px;
  animation: msg-appear 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  max-width: 75%;
}

@keyframes msg-appear {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* User right (avatar outer); assistant left (avatar outer). */
.message.user {
  flex-direction: row-reverse;
  margin-left: auto;
  margin-right: 0;
}

.message.assistant {
  flex-direction: row;
  margin-left: 0;
  margin-right: auto;
}

.message.assistant.burst-msg {
  margin-top: 6px;
}

.message.assistant.burst-msg .msg-avatar {
  visibility: hidden;
}

.message.assistant.burst-msg .msg-bubble {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.msg-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  margin-top: 4px;
}

.message.user .msg-avatar {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--black);
  box-shadow: 0 0 10px var(--gold-glow);
}

.message.assistant .msg-avatar {
  color: var(--gold);
  border: 1px solid rgba(200, 161, 72, 0.3);
  font-size: 18px;
}

.message.assistant .msg-avatar.anubis-avatar,
.typing-indicator .msg-avatar.anubis-avatar {
  background-color: var(--black-4);
  background-image: url("anubisauthlogo.png");
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.msg-bubble {
  padding: 13px 17px;
  border-radius: var(--radius);
  line-height: 1.72;
  font-size: 15px;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.message.user .msg-bubble {
  background: linear-gradient(145deg, rgba(200, 161, 72, 0.14), rgba(200, 161, 72, 0.06));
  border: 1px solid rgba(200, 161, 72, 0.28);
  color: var(--white);
  border-radius: var(--radius) var(--radius) 4px var(--radius);
}

.message.assistant .msg-bubble {
  background: rgba(24, 24, 24, 0.92);
  border: 1px solid rgba(200, 161, 72, 0.14);
  color: var(--white);
  border-radius: var(--radius) var(--radius) var(--radius) 4px;
}

.message.library {
  flex-direction: row;
  margin-left: 0;
  margin-right: auto;
  max-width: 92%;
}

.message.library .library-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 40, 24, 0.85);
  border: 1px solid rgba(0, 255, 120, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(0, 255, 130, 0.92);
  flex-shrink: 0;
}

.message.library .library-avatar .overseer-scale-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.message.library .library-bubble {
  background: rgba(8, 22, 16, 0.94);
  border: 1px solid rgba(0, 200, 100, 0.22);
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  color: rgba(220, 245, 230, 0.95);
}

.library-label {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(0, 255, 130, 0.65);
  margin-bottom: 8px;
}

.overseer-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: rgba(0, 255, 150, 0.85);
  margin-bottom: 10px;
}

.overseer-body.overseer-text {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(230, 250, 238, 0.92);
}

.overseer-archive {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid rgba(0, 255, 120, 0.18);
  font-size: 11px;
  color: rgba(0, 255, 130, 0.55);
  letter-spacing: 0.03em;
}

.library-quote {
  margin: 0 0 10px;
  padding: 0 0 0 12px;
  border-left: 2px solid rgba(0, 255, 120, 0.45);
  font-size: 14px;
  line-height: 1.65;
  font-style: italic;
  color: rgba(230, 250, 238, 0.92);
}

.library-source {
  display: inline-block;
  font-size: 13px;
  font-style: normal;
  color: #5dffb0;
  text-decoration: none;
  border-bottom: 1px solid rgba(93, 255, 176, 0.35);
  word-break: break-word;
}

.library-source:hover {
  color: #9fffcc;
  border-bottom-color: rgba(159, 255, 204, 0.6);
}

.msg-time {
  font-size: 10px;
  color: rgba(240, 232, 213, 0.3);
  margin-top: 4px;
  text-align: left;
}

.msg-time.synch-time {
  animation: anubis-synch-flash 420ms ease-out 1;
}

@keyframes anubis-synch-flash {
  0% {
    opacity: 0.45;
    transform: translateZ(0) scale(1);
    color: rgba(240, 232, 213, 0.35);
    text-shadow: none;
  }
  35% {
    opacity: 0.95;
    transform: translateZ(0) scale(1.07);
    color: rgba(120, 255, 190, 0.9);
    text-shadow: 0 0 12px rgba(0, 255, 150, 0.35);
  }
  100% {
    opacity: 0.55;
    transform: translateZ(0) scale(1);
    color: rgba(240, 232, 213, 0.3);
    text-shadow: none;
  }
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  animation: fade-in 0.3s ease;
  flex-direction: row;
  margin-left: 0;
  margin-right: auto;
}

.typing-dots {
  display: flex;
  gap: 5px;
  padding: 12px 16px;
  background: var(--black-3);
  border-radius: var(--radius);
  border: 1px solid rgba(200, 161, 72, 0.1);
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: typing-bounce 1.4s ease infinite;
  opacity: 0.6;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  30% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Interests Panel */
.interests-panel {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  animation: fade-in 0.3s ease;
}

.panel-title {
  font-family: 'Cinzel', serif;
  color: var(--gold);
  font-size: 18px;
  margin-bottom: 6px;
}

.panel-sub {
  color: var(--white-dim);
  font-size: 13px;
  margin-bottom: 24px;
}

.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.interest-card {
  background: var(--black-3);
  border: 1px solid rgba(200, 161, 72, 0.15);
  border-radius: var(--radius);
  padding: 14px;
  transition: var(--transition);
  animation: fade-in-up 0.4s ease both;
}

.interest-card:hover {
  border-color: rgba(200, 161, 72, 0.4);
  background: var(--black-4);
  transform: translateY(-2px);
}

.interest-topic {
  font-weight: 700;
  color: var(--white);
  font-size: 14px;
  margin-bottom: 4px;
}

.interest-category {
  font-size: 11px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.interest-bar {
  height: 3px;
  background: var(--black-5);
  border-radius: 2px;
  overflow: hidden;
}

.interest-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 2px;
  transition: width 0.8s ease;
}

.no-interests {
  text-align: center;
  padding: 40px;
  color: var(--white-dim);
}

.no-interests p {
  font-size: 14px;
  line-height: 1.8;
}

/* Input Area */
.account-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-bottom: 8px;
  padding: 6px 12px;
  background: transparent;
  border: 1px solid rgba(var(--gold-rgb), 0.12);
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-ui);
}

.account-strip:hover:not(:disabled) {
  background: rgba(246, 175, 81, 0.05);
  border-color: rgba(246, 175, 81, 0.28);
}

.account-strip.copied {
  border-color: rgba(246, 175, 81, 0.35);
}

.account-strip:disabled,
.account-strip.is-empty {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

.account-strip-label {
  font-size: 11px;
  color: rgba(240, 232, 213, 0.4);
  flex-shrink: 0;
}

.account-strip-value {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: rgba(246, 175, 81, 0.85);
  letter-spacing: 0.05em;
  direction: ltr;
  unicode-bidi: plaintext;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 55vw;
}

.account-strip-icon {
  width: 13px;
  height: 13px;
  color: rgba(246, 175, 81, 0.55);
  flex-shrink: 0;
}

.account-strip:hover:not(:disabled) .account-strip-icon {
  color: var(--gold);
}

.input-area {
  padding: 10px 18px max(12px, env(safe-area-inset-bottom));
  background: rgba(17, 17, 17, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-gold);
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

.input-wrapper {
  display: flex;
  flex-direction: row !important;
  direction: ltr !important;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(246, 175, 81, 0.25);
  border-radius: 18px;
  padding: 6px 10px;
  min-height: 48px;
  transition: all var(--transition);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 4px 12px rgba(0, 0, 0, 0.2);
  box-sizing: border-box;
}

.input-wrapper:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow), 0 8px 24px rgba(0, 0, 0, 0.3);
  background: rgba(0, 0, 0, 0.65);
}

/* Hidden while a photo-selection flow (palm scan / soulmate slot picker)
   is in progress — see the MutationObserver in app.js. */
body.photo-flow-active #chat-input-wrapper {
  display: none;
}

#message-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 14.5px;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  overflow-y: auto;
  line-height: 1.5;
  direction: rtl;
  text-align: right;
  padding: 6px 8px;
  box-sizing: border-box;
}

#message-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  font-weight: 300;
}

.send-btn {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  outline: none;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
  color: var(--black);
  box-shadow: 0 2px 8px rgba(246, 175, 81, 0.2);
}

.send-btn svg {
  width: 16px;
  height: 16px;
}

.send-btn:hover:not(:disabled) {
  transform: scale(1.05) translateY(-1px);
  box-shadow: 0 4px 15px var(--gold-glow);
}

.send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.input-action-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(246, 175, 81, 0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  outline: none;
  color: var(--gold);
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.input-action-btn:hover {
  background: rgba(246, 175, 81, 0.18);
  border-color: var(--gold);
  color: var(--white);
  transform: translateY(-1px);
}

.input-action-btn .cat-icon {
  margin-inline-end: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.input-hint {
  text-align: center;
  font-size: 10px;
  color: rgba(240, 232, 213, 0.2);
  margin-top: 4px;
  line-height: 1.5;
}

.input-hint-adonis {
  color: var(--gold-light);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(246, 175, 81, 0.45);
  transition: color var(--transition), border-color var(--transition);
}

.input-hint-adonis:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}

.input-hint-adonis:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 27, 47, 0.88);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(200, 161, 72, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-overlay p {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 2px;
}

/* ─── Responsive ──────────────────────────── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    right: 0;
    transform: translateX(100%);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: block;
  }

  .message {
    max-width: 90%;
  }

  .chat-header {
    padding: 14px 16px;
    padding-top: max(14px, env(safe-area-inset-top));
  }

  /* An infinite backdrop-filter animation over a large area is expensive to
     composite every frame — weaker mobile GPUs drop frames under it, which
     reads as the whole screen judder/shake. Desktop GPUs handle it fine, so
     this is scoped to small screens only rather than removed everywhere. */
  .logo-shimmer-wrap::after {
    animation: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    display: none;
  }

  .account-strip-value {
    max-width: 48vw;
    font-size: 11px;
  }

  .messages-area {
    padding: 16px;
  }

  .input-area {
    padding: 8px 14px max(10px, env(safe-area-inset-bottom));
  }

  /* ─── Auth Screen Mobile ─── */
  .auth-container {
    padding: 16px;
    max-width: 100%;
  }

  .logo-area {
    margin-bottom: 16px;
  }

  .anubis-symbol-img {
    width: min(160px, 45vw);
    height: min(160px, 45vw);
  }

  .logo-title {
    font-size: 26px;
    letter-spacing: 5px;
    margin-inline-end: -5px;
  }

  .logo-sub {
    font-size: 11px;
  }
}

@media (max-width: 480px) {
  .anubis-symbol-img {
    width: min(130px, 40vw);
    height: min(130px, 40vw);
  }

  .logo-title {
    font-size: 22px;
    letter-spacing: 4px;
    margin-inline-end: -4px;
  }

  .logo-area {
    margin-bottom: 12px;
  }
}

/* ============================================
   CUSTOM MODAL
   ============================================ */
.custom-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fade-in 0.3s ease;
  padding: 20px;
}

.custom-modal {
  background: var(--black-2);
  border: 1px solid rgba(200, 161, 72, 0.3);
  border-radius: var(--radius-lg);
  padding: 30px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(200, 161, 72, 0.1);
  animation: modal-scale-up 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-scale-up {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.custom-modal h3 {
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 24px;
  line-height: 1.5;
}

.custom-modal-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.custom-modal-actions button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius);
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-cancel {
  background: var(--black-4);
  color: var(--white);
  border: 1px solid rgba(240, 232, 213, 0.2);
}

.btn-cancel:hover {
  background: var(--black-5);
}

.btn-confirm {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  color: var(--black);
  border: none;
  box-shadow: 0 4px 15px var(--gold-glow);
}

.btn-confirm:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--gold-glow);
}

/* ─── Credits Badge ───────────────────────── */
.credits-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(200, 161, 72, 0.12), rgba(200, 161, 72, 0.04));
  border: 1px solid var(--border-gold-strong);
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  font-variant-numeric: tabular-nums;
}

.credits-label {
  font-size: 12px;
  color: var(--gold-light);
  font-family: 'Cinzel', serif;
  margin-left: 4px;
}

.add-credits-btn {
  background: var(--gold);
  color: var(--black);
  border: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  cursor: pointer;
  margin-left: 4px;
  transition: var(--transition);
  font-weight: bold;
}

.add-credits-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--gold-glow);
}

/* ─── Credits Modal ───────────────────────── */
.credits-modal-content {
  max-width: 500px;
  width: 90%;
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.modal-header h3 {
  font-family: 'Cinzel Decorative', serif;
  color: var(--gold);
  font-size: 20px;
  margin-bottom: 0;
}

.close-modal-btn {
  background: transparent;
  border: none;
  color: var(--white-dim);
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
  padding: 4px;
}

.close-modal-btn:hover {
  color: var(--danger);
}

.modal-sub {
  color: var(--white-dim);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ─── Reading Menu Modal (hamburger) ───────────────────────── */
.reading-menu-modal-content {
  max-width: 380px;
  width: 90%;
  padding: 22px;
}

.reading-menu-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.reading-menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  border: 1px solid rgba(200, 161, 72, 0.2);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(22, 22, 22, 0.95), rgba(14, 14, 14, 0.98));
  color: var(--white);
  cursor: pointer;
  text-align: right;
  font-family: var(--font-ui);
  font-size: 15px;
  font-weight: 600;
  transition: var(--transition);
}

.reading-menu-item:hover {
  border-color: rgba(200, 161, 72, 0.45);
  background: var(--black-4);
  transform: translateY(-1px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
}

.reading-menu-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  color: var(--gold);
}

.account-number-card {
  background: linear-gradient(135deg, rgba(246, 175, 81, 0.1), rgba(246, 175, 81, 0.03));
  border: 1px solid var(--border-gold-strong);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 20px;
  text-align: center;
}

.account-number-label {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--gold-light);
  letter-spacing: 0.06em;
}

.account-number-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.account-number-value {
  font-family: 'Courier New', Consolas, monospace;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.08em;
  direction: ltr;
  unicode-bidi: plaintext;
}

.account-copy-btn {
  padding: 8px 14px;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
  color: var(--gold);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.account-copy-btn:hover {
  background: rgba(246, 175, 81, 0.12);
  border-color: var(--gold);
}

.account-number-hint {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--white-dim);
  line-height: 1.55;
}

.packages-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: right;
}

.credit-package {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 4px 16px;
  align-items: center;
  background: var(--black-3);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 16px 18px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.credit-package .pkg-amount {
  grid-column: 1;
  grid-row: 1;
}

.credit-package .pkg-desc {
  grid-column: 1;
  grid-row: 2;
}

.credit-package .pkg-price {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.credit-package:hover {
  background: var(--black-4);
  border-color: var(--gold);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.pkg-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pkg-amount {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Cinzel', serif;
}

.pkg-label {
  font-size: 12px;
  color: var(--white-dim);
}

.pkg-desc {
  font-size: 12px;
  color: var(--white-dim);
}

.pkg-price {
  background: var(--gold);
  color: var(--black);
  padding: 6px 12px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
}

.credit-package.popular {
  border-color: var(--gold);
  background: rgba(200, 161, 72, 0.05);
}

.pkg-badge {
  position: absolute;
  top: 0;
  inset-inline-end: 0;
  background: var(--gold);
  color: var(--black);
  font-size: 10px;
  font-weight: bold;
  padding: 4px 8px;
  border-end-start-radius: 8px;
  white-space: nowrap;
}

.credit-package.premium {
  background: linear-gradient(135deg, rgba(200, 161, 72, 0.1), rgba(190, 133, 58, 0.2));
  border-color: var(--gold-dark);
}

/* ─── OTP Modal (theme-aligned) ───────────── */
.otp-modal .custom-modal {
  max-width: 400px;
}

.otp-icon-wrap {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--gold-dark), var(--gold));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  font-size: 28px;
  box-shadow: 0 0 24px var(--gold-glow);
}

.otp-modal h3 {
  color: var(--gold) !important;
  margin-bottom: 8px !important;
  font-size: 20px !important;
  font-family: var(--font-display) !important;
}

.otp-modal .otp-desc {
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--white-dim);
  line-height: 1.65;
}

.otp-input-field {
  width: 100%;
  text-align: center;
  letter-spacing: 12px;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
  direction: ltr;
  border: 1px solid var(--border-gold-strong);
  background: rgba(246, 175, 81, 0.06);
  color: var(--gold);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--font-ui);
  outline: none;
  transition: var(--transition);
}

.otp-input-field:focus {
  box-shadow: 0 0 0 3px var(--gold-glow);
  border-color: var(--gold);
}

.otp-verify-btn {
  width: 100%;
  border-radius: var(--radius) !important;
  padding: 14px !important;
  font-size: 15px !important;
  margin-bottom: 10px;
  height: auto !important;
}

.otp-cancel-btn {
  width: 100%;
  border-radius: var(--radius);
  padding: 12px;
  font-size: 13px;
  background: transparent;
  border: 1px solid var(--white-faint);
  color: var(--white-dim);
  cursor: pointer;
  font-family: var(--font-ui);
  transition: var(--transition);
}

.otp-cancel-btn:hover {
  border-color: var(--border-gold);
  color: var(--white);
}

.otp-footnote {
  margin-top: 16px;
  font-size: 11px;
  color: rgba(240, 232, 213, 0.35);
}


/* ============================================
        ADONIS AI — Palm Scanning Styles
   ============================================ */

/* Category Selector Controls */
.category-selector-wrapper {
  position: relative;
  width: auto;
  margin-bottom: 0;
}

.btn-category-selector {
  width: 100%;
  padding: 10px 14px;
  background: rgba(24, 24, 24, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  color: var(--white);
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.btn-category-selector:hover {
  border-color: var(--gold);
  background: rgba(246, 175, 81, 0.06);
  box-shadow: 0 0 10px var(--gold-glow);
}

.cat-icon {
  margin-inline-end: 8px;
  font-size: 14px;
}

.cat-arrow {
  font-size: 10px;
  color: var(--gold);
  transition: transform var(--transition);
}

.category-selector-wrapper.active .cat-arrow {
  transform: rotate(180deg);
}

.category-dropdown {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  background: rgba(17, 17, 17, 0.95);
  border: 1px solid var(--border-gold-strong);
  border-radius: 12px;
  box-shadow: var(--shadow-elevated);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  z-index: 1500;
  animation: dropdown-fade-in 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

@keyframes dropdown-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.category-item {
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--white-dim);
  font-family: var(--font-ui);
  font-size: 13px;
  text-align: start;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
}

.category-item span:not(.item-icon) {
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-item-span2 {
  grid-column: 1 / -1;
}

.category-item-soulmate {
  border-top: 1px solid rgba(246, 175, 81, 0.18);
}

.category-item:hover {
  background: rgba(246, 175, 81, 0.08);
  color: var(--white);
}

.category-item.active {
  background: rgba(246, 175, 81, 0.12);
  color: var(--gold);
  font-weight: 700;
  border-inline-start: 3px solid var(--gold);
}

.item-icon {
  font-size: 15px;
  flex-shrink: 0;
}

/* Scan Controls (Upload & Camera Options) */
.scan-controls-container {
  display: flex;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
}

.btn-scan-option {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: rgba(24, 24, 24, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  color: var(--gold-light);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.btn-scan-option:hover {
  background: linear-gradient(135deg, rgba(246, 175, 81, 0.12), rgba(246, 175, 81, 0.04));
  border-color: var(--gold);
  color: var(--white);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.5), 0 0 10px var(--gold-glow);
}

.scan-icon {
  width: 18px;
  height: 18px;
  color: var(--gold);
  transition: var(--transition);
}

.btn-scan-option:hover .scan-icon {
  transform: scale(1.1);
  color: var(--white);
}

/* Camera Modal overlay styles */
.camera-modal {
  position: fixed;
  inset: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.25s ease;
}

.camera-modal-container {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 640px;
  max-height: 850px;
  background: #050505;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  flex-grow: 1;
  background: #000;
}

#camera-video.mirrored {
  transform: scaleX(-1);
}

.palm-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.palm-overlay.mirrored {
  transform: scaleX(-1);
}

.hand-silhouette {
  width: 92%;
  height: 92%;
  max-width: 480px;
  max-height: 480px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(246, 175, 81, 0.5));
  animation: hand-outline-pulse 2s infinite ease-in-out;
}

@keyframes hand-outline-pulse {
  0%, 100% {
    opacity: 0.4;
    transform: scale(1);
  }
  50% {
    opacity: 0.85;
    transform: scale(1.01);
  }
}

.camera-status-prompt {
  position: absolute;
  bottom: 110px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 27, 47, 0.85);
  border: 1px solid rgba(246, 175, 81, 0.22);
  color: #fff;
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 13px;
  font-family: var(--font-ui);
  pointer-events: none;
  z-index: 10;
  text-align: center;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  transition: var(--transition);
}

.camera-status-prompt.ready {
  border-color: rgba(0, 255, 102, 0.4);
  color: #00ff66;
  box-shadow: 0 0 15px rgba(0, 255, 102, 0.15);
}

.btn-camera-capture:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  filter: grayscale(1);
}

.camera-actions {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 30px 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.4) 60%, transparent 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
}

.btn-camera-cancel {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 30px;
  color: var(--white);
  padding: 10px 24px;
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.btn-camera-cancel:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.btn-camera-capture {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  border: 4px solid var(--white);
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-camera-capture:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.3);
}

.btn-capture-inner {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--white);
  transition: var(--transition);
}

.btn-camera-capture:active .btn-capture-inner {
  transform: scale(0.9);
  background: var(--gold);
}

/* Chat bubble scanning graphics */
.scan-bubble-card {
  width: 100%;
  max-width: 320px;
  background: rgba(16, 27, 47, 0.95);
  border: 1px solid var(--border-gold-strong);
  border-radius: 14px;
  padding: 12px;
  margin: 8px 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.scan-canvas-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  background: #000;
  border-radius: 8px;
  border: 1px solid rgba(246, 175, 81, 0.15);
  overflow: hidden;
}

.scan-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Moving scan line */
.scan-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), #ffffff, var(--gold), transparent);
  box-shadow: 0 0 12px var(--gold), 0 0 4px #ffffff;
  pointer-events: none;
  z-index: 5;
  animation: laser-scan-anim 2.5s infinite ease-in-out;
}

@keyframes laser-scan-anim {
  0% {
    top: 0%;
  }
  50% {
    top: 100%;
  }
  100% {
    top: 0%;
  }
}

.scan-meta-info {
  margin-top: 10px;
  font-size: 11px;
  color: var(--gold-light);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(246, 175, 81, 0.1);
  padding-top: 8px;
}

.scan-status-text {
  font-family: var(--font-ui);
  animation: text-pulse-opacity 1.5s infinite ease-in-out;
}

@keyframes text-pulse-opacity {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Suspense wait logs styled like chat messages */
.message.assistant.wait-bubble .msg-bubble {
  background: rgba(24, 24, 24, 0.85);
  border: 1px solid rgba(246, 175, 81, 0.2);
  color: var(--gold-light);
  font-style: italic;
  font-family: var(--font-quote);
}

.message.assistant.wait-bubble .msg-avatar {
  background: rgba(246, 175, 81, 0.05);
  border: 1px solid rgba(246, 175, 81, 0.2);
}

/* Scanner Modal Overlay styling */
.scanner-modal {
  position: fixed;
  inset: 0;
  background: rgba(16, 27, 47, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fade-in 0.25s ease;
}

.scanner-modal-container {
  width: 90%;
  max-width: 440px;
  background: var(--black-2);
  border: 1px solid var(--border-gold-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-elevated);
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.scan-card-header {
  margin-bottom: 4px;
}

.scan-card-header h3 {
  font-family: var(--font-display);
  color: var(--gold);
  font-size: 18px;
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.scan-card-header p {
  font-size: 12px;
  color: var(--white-dim);
  font-family: var(--font-ui);
}

.scanner-modal-container .scan-canvas-container {
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: var(--radius);
  border: 1px solid rgba(246, 175, 81, 0.22);
  background: #000;
  position: relative;
  overflow: hidden;
}

.scanner-modal-container .scan-canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.scanner-modal-container .scan-meta-info {
  border-top: 1px solid rgba(246, 175, 81, 0.15);
  padding-top: 12px;
  margin-top: 4px;
  justify-content: center;
}

.scanner-modal-container .scan-status-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─── RTL Flex Direction Fixes for Avatars ─── */
html[dir="rtl"] .message.user {
  flex-direction: row;
}
html[dir="rtl"] .message.assistant {
  flex-direction: row-reverse;
}
html[dir="rtl"] .message.library {
  flex-direction: row-reverse;
}
html[dir="rtl"] .typing-indicator {
  flex-direction: row-reverse;
}

/* Progressive Signup Animations - Ferris Wheel rotation */
@keyframes wheel-exit-left {
  0% {
    transform: rotate(0deg) translate3d(0, 0, 0);
    opacity: 1;
    filter: blur(0);
  }
  100% {
    transform: rotate(-35deg) translate3d(-150px, 80px, 0);
    opacity: 0;
    filter: blur(2px);
  }
}

@keyframes wheel-enter-right {
  0% {
    transform: rotate(35deg) translate3d(150px, 80px, 0);
    opacity: 0;
    filter: blur(2px);
  }
  100% {
    transform: rotate(0deg) translate3d(0, 0, 0);
    opacity: 1;
    filter: blur(0);
  }
}

.animate-wheel-exit {
  transform-origin: center 360px;
  animation: wheel-exit-left 0.65s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.animate-wheel-enter {
  transform-origin: center 360px;
  animation: wheel-enter-right 0.65s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.register-step {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.register-step.hidden {
  display: none !important;
  opacity: 0;
}

.register-step.active {
  display: block !important;
}

/* Disabled input action buttons and camera cancel/upload buttons when credits are insufficient */
.input-action-btn:disabled,
.input-action-btn.disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.25) !important;
  background: rgba(255, 255, 255, 0.01) !important;
}

.btn-camera-cancel:disabled,
.btn-camera-cancel.disabled {
  opacity: 0.35 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.25) !important;
  background: rgba(255, 255, 255, 0.03) !important;
}

/* ─── Modern OTP Verification Styles ────────────────── */
.otp-icon-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 20px;
  background: radial-gradient(circle, rgba(246, 175, 81, 0.15) 0%, rgba(246, 175, 81, 0.02) 70%);
  border: 1.5px solid rgba(246, 175, 81, 0.3);
  border-radius: 50%;
  box-shadow: 0 0 25px rgba(246, 175, 81, 0.12), inset 0 0 12px rgba(246, 175, 81, 0.08);
  animation: otp-pulse-border 3s ease-in-out infinite;
  color: var(--gold);
}

.otp-svg-icon {
  width: 32px;
  height: 32px;
  filter: drop-shadow(0 2px 8px rgba(246, 175, 81, 0.3));
}

.otp-description {
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
  color: var(--white-dim);
  margin-bottom: 24px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
}

.otp-input-group {
  margin-bottom: 22px;
}

.otp-input-field {
  direction: ltr !important;
  text-align: center !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  letter-spacing: 12px !important;
  padding: 14px 16px 14px 28px !important; /* Extra padding-left/right to perfectly center letter-spaced characters */
  color: var(--gold) !important;
  background: rgba(16, 27, 47, 0.6) !important;
  border: 1.5px solid var(--border-gold) !important;
  border-radius: var(--radius) !important;
  text-shadow: 0 0 10px rgba(246, 175, 81, 0.2);
  font-family: 'Courier New', Courier, monospace !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.otp-input-field:focus {
  border-color: var(--gold) !important;
  box-shadow: 0 0 20px rgba(246, 175, 81, 0.25) !important;
  background: var(--black-3) !important;
}

.otp-input-field::placeholder {
  color: rgba(246, 175, 81, 0.22) !important;
  letter-spacing: 10px !important;
  opacity: 0.8;
}

.btn-otp-verify {
  margin-top: 4px;
}

@keyframes otp-pulse-border {
  0%, 100% {
    border-color: rgba(246, 175, 81, 0.3);
    box-shadow: 0 0 25px rgba(246, 175, 81, 0.12), inset 0 0 12px rgba(246, 175, 81, 0.08);
  }
  50% {
    border-color: rgba(246, 175, 81, 0.6);
    box-shadow: 0 0 35px rgba(246, 175, 81, 0.25), inset 0 0 18px rgba(246, 175, 81, 0.15);
  }
}
/* ═══════════════════════════════════════════
   DEEP-SCAN EXPERIENCE — تجربة المسح العميق
   ═══════════════════════════════════════════ */
.scanner-modal-container.scanner-pro {
  --scan-accent: #00d2ff;
  gap: 12px;
  max-width: 460px;
}

.scanner-pro .scan-canvas-container {
  border-color: rgba(246, 175, 81, 0.28);
  transition: border-color 0.5s, box-shadow 0.5s;
}

.scan-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  z-index: 7;
  pointer-events: none;
  border: 0 solid var(--scan-accent);
  filter: drop-shadow(0 0 6px var(--scan-accent));
  transition: border-color 0.6s;
}

.scan-corner.tl { top: 8px; left: 8px; border-top-width: 2px; border-left-width: 2px; }
.scan-corner.tr { top: 8px; right: 8px; border-top-width: 2px; border-right-width: 2px; }
.scan-corner.bl { bottom: 8px; left: 8px; border-bottom-width: 2px; border-left-width: 2px; }
.scan-corner.br { bottom: 8px; right: 8px; border-bottom-width: 2px; border-right-width: 2px; }

.scan-phase-chip {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  z-index: 8;
  font-family: 'Courier New', monospace;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--scan-accent);
  color: var(--scan-accent);
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: color 0.6s, border-color 0.6s;
  animation: text-pulse-opacity 2.2s infinite ease-in-out;
}

.scan-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.scan-metric {
  border: 1px solid rgba(246, 175, 81, 0.16);
  background: rgba(255, 255, 255, 0.02);
  padding: 7px 6px 6px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.metric-label {
  font-size: 10px;
  color: var(--white-dim);
  letter-spacing: 0.04em;
}

.metric-value {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--gold-light);
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.scan-progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scan-progress-bar {
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: rgba(246, 175, 81, 0.12);
  overflow: hidden;
}

.scan-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #00d2ff, var(--gold));
  box-shadow: 0 0 10px rgba(246, 175, 81, 0.5);
  transition: width 0.45s ease;
}

.scan-progress-pct {
  font-size: 12px;
  font-weight: 800;
  color: var(--gold);
  min-width: 40px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  direction: ltr;
}

.scan-datastream {
  height: 30px;
  overflow: hidden;
  font-family: 'Courier New', monospace;
  font-size: 9.5px;
  line-height: 15px;
  color: rgba(0, 229, 255, 0.5);
  text-align: left;
  direction: ltr;
  white-space: pre-line;
  opacity: 0.9;
  user-select: none;
}

.scanner-modal-container.scan-complete {
  --scan-accent: #7ddf9a;
}

.scanner-modal-container.scan-complete .scan-canvas-container {
  border-color: rgba(125, 223, 154, 0.55);
  box-shadow: 0 0 28px rgba(125, 223, 154, 0.3);
}

.scanner-modal-container.scan-complete .scan-progress-fill {
  background: linear-gradient(90deg, #7ddf9a, var(--gold));
}
