/* IgniteConvo — App Styles */

:root {
  --bg: #FAF8F5;
  --bg-warm: #F5F0EA;
  --text: #1A1A1A;
  --text-secondary: #6B6460;
  --accent: #FF5733;
  --accent-soft: #FF8566;
  --accent-glow: rgba(255, 87, 51, 0.12);
  --purple: #7B61FF;
  --green: #2ECC71;
  --blue: #4A9DFF;
  --card: #FFFFFF;
  --card-border: rgba(0,0,0,0.06);
  --bubble-them: #EEEAE6;
  --bubble-you: #FF5733;
}

* { font-family: 'Outfit', sans-serif; margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }

/* App shell — hidden by default, shown after auth */
#app-shell.visible {
  display: flex !important; flex: 1; flex-direction: column; overflow: hidden;
}

/* ── Animations ─────────────────────────────────────────── */

@keyframes messageSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-animate { animation: messageSlideIn 0.3s ease-out both; }

@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}
.typing-dot { animation: dotBounce 1.4s infinite both; }
.typing-dot:nth-child(2) { animation-delay: 0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0.32s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.6s ease-out both; }
.fade-up-delay { animation: fadeUp 0.6s ease-out 0.15s both; }
.fade-up-delay-2 { animation: fadeUp 0.6s ease-out 0.3s both; }

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,87,51,0.4); }
  50% { box-shadow: 0 0 0 10px rgba(255,87,51,0); }
}
.mic-recording {
  animation: micPulse 1.5s ease-in-out infinite;
  background: var(--accent) !important;
  color: white !important;
}

/* ── Navbar ─────────────────────────────────────────────── */

.app-nav {
  background: var(--text);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.app-nav .logo {
  display: flex; align-items: center; gap: 8px;
  font-weight: 700; font-size: 1.1rem; color: white; text-decoration: none;
}
.logo-icon {
  width: 32px; height: 32px; background: var(--accent); border-radius: 8px;
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.nav-actions { display: flex; align-items: center; gap: 4px; }
.nav-btn {
  background: none; border: none; color: rgba(255,255,255,0.6); cursor: pointer;
  padding: 6px 10px; border-radius: 8px; font-family: 'Outfit', sans-serif;
  font-size: 0.85rem; font-weight: 500; display: flex; align-items: center; gap: 4px;
  transition: all 0.2s;
}
.nav-btn:hover { color: white; background: rgba(255,255,255,0.08); }
.nav-btn svg { width: 18px; height: 18px; }

/* ── Chat Messages ──────────────────────────────────────── */

#chat-container { scroll-behavior: smooth; }

.msg {
  max-width: 80%; padding: 12px 16px; font-size: 0.92rem; line-height: 1.55;
  margin-bottom: 6px;
}
.msg p { margin: 0.25rem 0; }
.msg p:first-child { margin-top: 0; }
.msg p:last-child { margin-bottom: 0; }

.msg-coach {
  background: var(--bubble-them); color: var(--text);
  border-radius: 18px 18px 18px 6px; align-self: flex-start;
}
.msg-user {
  background: var(--bubble-you); color: white;
  border-radius: 18px 18px 6px 18px; align-self: flex-end; margin-left: auto;
}
.msg-tip {
  background: linear-gradient(135deg, #F8F4FF, #EDE6FF);
  border: 1.5px solid rgba(123, 97, 255, 0.2);
  border-radius: 18px; align-self: center; max-width: 88%; text-align: left;
  margin: 8px auto;
}
.tip-label {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 700; color: var(--purple);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px;
}
.msg-time {
  font-size: 0.68rem; color: var(--text-secondary); opacity: 0.5;
  margin-top: 2px; margin-bottom: 8px;
}
.msg-time-right { text-align: right; }

/* ── Welcome / Auth ─────────────────────────────────────── */

.welcome-glow {
  box-shadow: 0 2px 4px rgba(0,0,0,0.02), 0 8px 24px rgba(0,0,0,0.06), 0 32px 80px rgba(0,0,0,0.08);
  padding: 16px;
}

.modal-box {
  padding: 28px 32px;
}
.welcome-icon {
  width: 72px; height: 72px; background: var(--accent); border-radius: 20px;
  display: flex; align-items: center; justify-content: center; font-size: 36px;
  box-shadow: 0 4px 20px rgba(255,87,51,0.3); color: white;
}

/* ── Buttons ────────────────────────────────────────────── */

.btn-accent {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; background: var(--accent); color: white; border: none;
  border-radius: 100px; font-family: 'Outfit', sans-serif; font-weight: 600;
  font-size: 0.95rem; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
  box-shadow: 0 4px 20px rgba(255,87,51,0.3);
}
.btn-accent:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 8px 30px rgba(255,87,51,0.4); }
.btn-accent:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }

/* ── Input Area ─────────────────────────────────────────── */

.input-area {
  background: var(--card); border-top: 1px solid var(--card-border); padding: 12px 16px;
}
.input-row {
  display: flex; gap: 8px; align-items: end; max-width: 800px; margin: 0 auto;
}
.input-row textarea {
  flex: 1; resize: none; overflow-y: auto; min-height: 42px; max-height: 120px;
  border: 2px solid var(--card-border); border-radius: 24px; padding: 10px 18px;
  font-family: 'Outfit', sans-serif; font-size: 0.95rem; line-height: 1.5;
  background: var(--bg); color: var(--text); outline: none; transition: border-color 0.2s;
}
.input-row textarea:focus { border-color: var(--accent); }
.input-row textarea::placeholder { color: var(--text-secondary); }

.send-btn, .mic-btn {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.2s;
  flex-shrink: 0;
}
.send-btn {
  background: var(--accent); color: white;
  box-shadow: 0 2px 10px rgba(255,87,51,0.3);
}
.send-btn:hover { transform: scale(1.05); }
.send-btn:disabled { opacity: 0.4; transform: none; cursor: not-allowed; }
.mic-btn { background: var(--bg-warm); color: var(--text-secondary); }
.mic-btn:hover { background: var(--card-border); }

/* ── Misc Components ────────────────────────────────────── */

.profile-pill {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.15rem 0.5rem; border-radius: 9999px; font-size: 0.75rem;
  background: var(--accent-glow); color: var(--accent); font-weight: 600;
}

.voice-card {
  cursor: pointer; transition: all 0.15s;
  border: 2px solid transparent; border-radius: 12px;
}
.voice-card:hover { border-color: rgba(255,87,51,0.3); }
.voice-card.selected { border-color: var(--accent); background: var(--accent-glow); }

.usage-badge {
  display: flex; align-items: center; gap: 4px;
  font-size: 0.75rem; color: rgba(255,255,255,0.5); padding: 0 8px;
}

[data-dot] { transition: all 0.3s ease; }

/* ── Scenario Cards ────────────────────────────────────────── */

.scenario-card:hover {
  border-color: var(--accent) !important;
  box-shadow: 0 4px 20px rgba(255,87,51,0.1);
  transform: translateY(-1px);
}

/* ── Scrollbar ──────────────────────────────────────────── */

#chat-container::-webkit-scrollbar { width: 6px; }
#chat-container::-webkit-scrollbar-track { background: transparent; }
#chat-container::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }
