/* Meshag Voice Chat — Dark minimal theme */

:root {
  --bg: #0f172a;
  --card: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --text-muted: #94a3b8;
  --accent: #3b82f6;
  --green: #22c55e;
  --red: #ef4444;
  --bubble-user: #1d4ed8;
  --bubble-assistant: #334155;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  height: 100dvh;
}

/* ── Header ── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

header h1 {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: .3px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-dot.connected  { background: var(--green); box-shadow: 0 0 6px var(--green); }
.status-dot.disconnected { background: var(--red); box-shadow: 0 0 6px var(--red); }

/* ── Messages ── */
#messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: .925rem;
  animation: fadeIn .3s ease;
}

.msg.user {
  align-self: flex-end;
  background: var(--bubble-user);
  border-bottom-right-radius: 4px;
}

.msg.assistant {
  align-self: flex-start;
  background: var(--bubble-assistant);
  border-bottom-left-radius: 4px;
  color: var(--text);
}

.msg .meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ── Footer ── */
footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: var(--card);
}

#text-input {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  font-size: .9rem;
  outline: none;
  transition: border-color .2s;
}

#text-input::placeholder { color: var(--text-muted); }
#text-input:focus { border-color: var(--accent); }

/* ── Buttons ── */
footer button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .15s;
  flex-shrink: 0;
}

footer button:hover { background: rgba(59, 130, 246, .12); }
footer button:active { transform: scale(.93); }

/* Mic button */
#mic-btn {
  width: 48px;
  height: 48px;
  border-color: var(--accent);
}

#mic-btn.recording {
  border-color: var(--red);
  color: var(--red);
  background: rgba(239, 68, 68, .15);
  animation: pulse 1.2s ease-in-out infinite;
}

/* Send button */
#send-btn { border-color: var(--accent); }

/* ── Scrollbar ── */
#messages::-webkit-scrollbar { width: 4px; }
#messages::-webkit-scrollbar-track { background: transparent; }
#messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Animations ── */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .45); }
  50%      { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

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

/* ── Responsive ── */
@media (max-width: 480px) {
  header, footer { padding: 10px 12px; }
  #messages { padding: 12px; }
  .msg { font-size: .875rem; }
}
