/* ==========================================================================
   AquaSensei (أكوا سينسي) — Water-Glass Dark Ocean (#07141f) + Light Mist Theme
   ========================================================================== */

:root {
  --bg-deep: #07141f;
  --bg-surface: #0d2133;
  --bg-card: rgba(13, 33, 51, 0.72);
  --bg-subcard: rgba(3, 8, 14, 0.42);
  --bg-input: rgba(7, 20, 31, 0.85);
  --border-subtle: rgba(20, 184, 166, 0.16);
  --border-hover: rgba(56, 189, 248, 0.42);
  --text-primary: #e2e8f0;
  --text-heading: #ffffff;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-teal: #14b8a6;
  --accent-sky: #38bdf8;
}

html.theme-light {
  --bg-deep: #eef6fa;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-subcard: #f1f7fb;
  --bg-input: #ffffff;
  --border-subtle: rgba(13, 148, 136, 0.22);
  --border-hover: rgba(14, 116, 144, 0.48);
  --text-primary: #0f2436;
  --text-heading: #07141f;
  --text-secondary: #335066;
  --text-muted: #526e84;
  --accent-teal: #0f766e;
  --accent-sky: #0284c7;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Cairo", "Plus Jakarta Sans", system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Glowing aquatic radial gradient background */
.aquatic-glow {
  background-color: var(--bg-deep);
  background-image: radial-gradient(circle at 50% -20%, rgba(20, 184, 166, 0.25), transparent 60%);
  background-attachment: fixed;
}

html.theme-light .aquatic-glow {
  background-color: #eef6fa;
  background-image: radial-gradient(circle at 50% -20%, rgba(20, 184, 166, 0.16), transparent 60%);
}

/* Water-Glass Glassmorphism */
.water-glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 32px 0 rgba(3, 8, 14, 0.37);
  transition: border-color 0.22s ease, box-shadow 0.22s ease, transform 0.2s ease;
}

.water-glass-hover:hover {
  border-color: var(--border-hover);
  box-shadow: 0 0 22px rgba(20, 184, 166, 0.16);
}

html.theme-light .water-glass {
  box-shadow: 0 8px 26px rgba(7, 20, 31, 0.08);
}

.water-sub {
  background: var(--bg-subcard);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
}

.water-input {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.water-input:focus {
  outline: none;
  border-color: #14b8a6;
  box-shadow: 0 0 0 2px rgba(20, 184, 166, 0.2);
}
.water-input::placeholder { color: var(--text-muted); }

/* Light-mode text contrast safety for dark-first Tailwind utilities */
html.theme-light .text-white { color: #07141f !important; }
html.theme-light .text-slate-100,
html.theme-light .text-slate-200 { color: #0f2436 !important; }
html.theme-light .text-slate-300 { color: #264156 !important; }
html.theme-light .text-slate-400 { color: #47647a !important; }
html.theme-light .text-slate-500 { color: #5b788e !important; }
html.theme-light .bg-navy-800\/60,
html.theme-light .bg-navy-800\/80,
html.theme-light .bg-navy-800\/40,
html.theme-light .bg-navy-900\/40,
html.theme-light .bg-navy-900\/80,
html.theme-light .bg-navy-950\/30 {
  background-color: #f1f7fb !important;
}
html.theme-light .text-teal-400 { color: #0f766e !important; }
html.theme-light .text-sky-400 { color: #0369a1 !important; }
html.theme-light .text-emerald-400 { color: #047857 !important; }
html.theme-light .text-red-400,
html.theme-light .text-red-300 { color: #be123c !important; }
html.theme-light .text-indigo-400 { color: #4338ca !important; }
html.theme-light .keep-white { color: #ffffff !important; }

/* Wave Pulse Animation */
@keyframes wavePulse {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.wave-pulse {
  animation: wavePulse 4s ease-in-out infinite;
}

/* Typing dots */
@keyframes aquaWave {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.aqua-dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: #14b8a6; display: inline-block;
  animation: aquaWave 1.2s infinite ease-in-out;
}
.aqua-dot:nth-child(2) { animation-delay: 0.16s; }
.aqua-dot:nth-child(3) { animation-delay: 0.32s; }

/* Accessible Semantic Badges */
.badge-teal {
  background: rgba(20, 184, 166, 0.16);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.35);
}
html.theme-light .badge-teal { background: #ccfbf1; color: #115e59; border-color: #5eead4; }

.badge-sky {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.32);
}
html.theme-light .badge-sky { background: #e0f2fe; color: #075985; border-color: #7dd3fc; }

.badge-amber {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
html.theme-light .badge-amber { background: #fef3c7; color: #92400e; border-color: #fcd34d; }

.badge-rose {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.38);
}
html.theme-light .badge-rose { background: #ffe4e6; color: #9f1239; border-color: #fda4af; }

/* Markdown Rendering inside Aquabot bubbles */
.aqua-prose h3 {
  font-size: 0.94rem;
  font-weight: 700;
  color: #2dd4bf;
  margin: 0.7rem 0 0.25rem;
}
html.theme-light .aqua-prose h3 { color: #0f766e; }
.aqua-prose h3:first-child { margin-top: 0; }
.aqua-prose p { margin: 0.3rem 0; line-height: 1.75; }
.aqua-prose ul, .aqua-prose ol { margin: 0.3rem 0 0.5rem; padding-inline-start: 1.35rem; }
.aqua-prose li { margin: 0.2rem 0; }
.aqua-prose code {
  background: rgba(20, 184, 166, 0.14);
  color: #2dd4bf;
  padding: 0.05rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.86em;
}
html.theme-light .aqua-prose code { color: #0f766e; }
.aqua-prose strong { font-weight: 700; }

/* Custom Teal Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #14b8a6; border-radius: 10px; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

[x-cloak] { display: none !important; }
