:root {
  /* --- PALETTE: MOZAIK LIGHT --- */

  /* Backgrounds */
  --bg-core: #ffffff;
  /* Pure White */
  --bg-gradient: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  /* Very subtle top-down fade */

  /* Glass Surfaces */
  --glass-surface: rgba(255, 255, 255, 0.7);
  /* Frosty White */
  --glass-border: 1px solid rgba(0, 0, 0, 0.05);
  --glass-highlight: rgba(0, 0, 0, 0.02);
  --glass-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.1);

  /* Accents */
  --brand-gold: #0ea5e9;
  /* Sky Blue 500 (Primary Brand) */
  --brand-glow: #38bdf8;
  /* Sky Blue 400 */
  --brand-red: #ef4444;
  /* Red 500 */
  --brand-emerald: #10b981;
  /* Emerald 500 */

  /* Text */
  --text-primary: #0f172a;
  /* Slate 900 */
  --text-secondary: #475569;
  /* Slate 600 */
  --text-muted: #94a3b8;
  /* Slate 400 */

  /* Spacing & Radius */
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-full: 9999px;

  /* Font */
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  user-select: none;
  /* App-like feel */
}

body {
  margin: 0;
  background-color: var(--bg-core);
  background: var(--bg-gradient);
  background-attachment: fixed;
  /* Prevent scroll jumps */
  color: var(--text-primary);
  font-family: var(--font-main);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* --- LAYOUT SHELL --- */
.shell {
  max-width: 480px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: transparent;
  /* Let body gradient show */
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.05);
  /* Desktop shadow */
}

/* --- TYPOGRAPHY --- */
h1 {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #0ea5e9 0%, #2563eb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  margin: 0;
}

h3 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  margin: 0;
}

p,
.text-sm {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0;
}

.text-xs {
  font-size: 12px;
}

.text-center {
  text-align: center;
}

.text-gold {
  color: var(--brand-gold) !important;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mt-8 {
  margin-top: 2rem;
}

/* --- GLASS UTILITIES --- */
.glass-panel {
  /* Light mode glass correction */
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: var(--glass-shadow);
}

.glass-pill {
  background: rgba(0, 0, 0, 0.03);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-full);
  color: var(--text-primary);
}

/* --- COMPONENTS: BUTTONS --- */
button {
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-primary);
}

button:active {
  transform: scale(0.96);
}

.btn {
  width: 100%;
  height: 54px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
  border: none;
}

.btn-primary:active {
  box-shadow: 0 2px 10px rgba(14, 165, 233, 0.2);
}

.btn-ghost {
  color: var(--text-secondary);
  height: auto;
  padding: 8px;
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.05);
  border-radius: 8px;
}

/* --- INPUTS --- */
.input-field {
  width: 100%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  padding: 16px;
  font-size: 16px;
  color: var(--text-primary);
  transition: border-color 0.2s, background-color 0.2s;
}

.input-field:focus {
  background: white;
  border-color: var(--brand-gold);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.input-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
}

/* --- CARDS & LISTS --- */
.card-action {
  background: white;
  border: 1px solid #f1f5f9;
  padding: 24px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.card-action:hover {
  background: white;
  border-color: var(--brand-gold);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -5px rgba(14, 165, 233, 0.15);
}

.card-action .icon {
  font-size: 32px;
  filter: grayscale(1) opacity(0.5);
  transition: 0.3s;
}

.card-action:hover .icon {
  filter: none;
  transform: scale(1.1);
}

/* --- NAVORA HERO VISUALIZER (Mutawif) --- */
.vis-container {
  width: 100%;
  height: 180px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-btn-hero {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: white;
  border: 4px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  cursor: pointer;
}

/* Active State */
.mic-btn-hero.active {
  background: white;
  border-color: var(--brand-red);
  color: var(--brand-red);
  box-shadow: 0 10px 40px rgba(239, 68, 68, 0.3);
}

.pulse-ring {
  position: absolute;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 2px solid var(--brand-red);
  opacity: 0;
  pointer-events: none;
}

.active .pulse-ring {
  animation: ripple 2s infinite cubic-bezier(0, 0.2, 0.8, 1);
}

@keyframes ripple {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }

  100% {
    transform: scale(3);
    opacity: 0;
  }
}

/* --- JAMAAH RING VISUALIZER --- */
.kaaba-ring-container {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.kaaba-icon {
  font-size: 64px;
  z-index: 5;
  filter: drop-shadow(0 0 20px rgba(0, 0, 0, 0.1));
}

.ring-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --- REACTIONS (Floating) --- */
.reaction-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 50;
  /* Above most things */
}

.floating-emoji {
  position: absolute;
  bottom: 100px;
  font-size: 24px;
  animation: floatUp 3s ease-in forwards;
  opacity: 0;
}

@keyframes floatUp {
  0% {
    transform: translateY(0) scale(0.5);
    opacity: 0;
  }

  10% {
    opacity: 1;
    transform: translateY(-20px) scale(1.2);
  }

  100% {
    transform: translateY(-300px) scale(1);
    opacity: 0;
  }
}

/* FAB for Reactions */
.fab-reaction {
  position: absolute;
  bottom: 110px;
  /* Above nav/controls */
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ec4899 0%, #be185d 100%);
  /* Pink/Rose */
  color: white;
  box-shadow: 0 4px 20px rgba(190, 24, 93, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  border: 2px solid white;
  z-index: 40;
  transition: transform 0.2s;
}

.fab-reaction:active {
  transform: scale(0.9);
}

/* --- NAVIGATION --- */
.nav-dock {
  position: absolute;
  bottom: 24px;
  left: 20px;
  right: 20px;
  height: 72px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  display: flex;
  justify-content: space-around;
  /* Distribute evenly */
  align-items: center;
  padding: 0 10px;
  box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.5);
  /* Full border */
}

.nav-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 100%;
  color: var(--text-muted);
  gap: 4px;
}

.nav-btn .ico {
  font-size: 24px;
  transition: 0.2s;
}

.nav-btn.active {
  color: var(--brand-gold);
}

.nav-btn.active .ico {
  transform: translateY(-2px);
  filter: drop-shadow(0 4px 6px rgba(14, 165, 233, 0.2));
}

.nav-lbl {
  font-size: 10px;
  font-weight: 600;
}

/* --- OVERLAY SHEETS --- */
.overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: none;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s;
}

.overlay.active {
  display: flex;
  opacity: 1;
}

.sheet-content {
  width: 90%;
  max-width: 400px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-radius: 24px;
  padding: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.overlay.active .sheet-content {
  transform: scale(1);
}

/* --- CHAT --- */
.chat-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  /* Force full width */
  height: 100%;
  position: relative;
}

.chat-header {
  height: 70px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  font-weight: 600;
  font-size: 18px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
  z-index: 10;
  color: var(--text-primary);
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  padding-bottom: 180px;
  /* More space for input + nav */
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.msg-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 20px;
  font-size: 14px;
  line-height: 1.5;
  position: relative;
  word-wrap: break-word;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.msg-bubble.inc {
  align-self: flex-start;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.msg-bubble.out {
  align-self: flex-end;
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(14, 165, 233, 0.2);
}

.msg-meta {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
  display: block;
  text-align: right;
}

.chat-input-bar {
  position: absolute;
  bottom: 110px;
  /* Above nav dock (72px + 24px + space) */
  left: 20px;
  right: 20px;
  width: calc(100% - 40px);
  /* Explicit width to prevent shrinking */
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: 30px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  padding: 0 8px 0 24px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  z-index: 50;
  transition: transform 0.3s;
}

.chat-input-bar:focus-within {
  border-color: var(--brand-gold);
  box-shadow: 0 10px 50px rgba(56, 189, 248, 0.2);
  transform: translateY(-2px);
}

.chat-input-bar input {
  flex: 1;
  min-width: 0;
  /* Critical for flex shrinking */
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  height: 100%;
}

.chat-input-bar input::placeholder {
  color: var(--text-muted);
}

.chat-input-bar button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand-glow);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-left: 8px;
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.4);
}

/* --- UTILS --- */
.hidden {
  display: none !important;
}

.fade-enter {
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* --- PARTICIPANT LIST ITEMS --- */
.user-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid #f1f5f9;
  gap: 12px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.user-info {
  flex: 1;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-status {
  font-size: 11px;
  color: var(--text-secondary);
}