/* ========== GLOBAL ========== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #191a1f; /* darker background */
  color: #e5e7eb;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
}

/* Reusable card container (login, register, some home layouts) */
.app-container {
  width: 100%;
  max-width: 420px;
  padding: 2rem;
  background: #181818;
  border-radius: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid #111827;
}

/* ========== HEADER / BRAND ========== */

header {
  text-align: center;
  margin-bottom: 1.5rem;
}

header h1 {
  margin: 0;
  font-size: 1.9rem;
  letter-spacing: 0.04em;
}

.subtitle {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: #9ca3af;
}

/* Small logo on auth pages */
.auth-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  margin-bottom: 0.6rem;
}

/* ========== FORM ========== */

h2 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

input {
  padding: 0.7rem 0.9rem;
  border-radius: 0.7rem;
  border: 1px solid #111827;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.95rem;
}

input::placeholder {
  color: #6b7280;
}

/* Submit button only (avoid styling eye buttons) */
.form button.submit-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.7rem;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  background: #22c55e;
  color: #022c22;
}

.form button.submit-btn:hover,
.danger-btn:hover {
  filter: brightness(1.05);
}

/* Text under forms */
.switch-text {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  color: #9ca3af;
  text-align: center;
}

.link-btn {
  background: none;
  border: none;
  color: #38bdf8;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0;
}

.link-btn:hover {
  text-decoration: underline;
}

/* Messages */
.message {
  min-height: 1.2rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  text-align: center;
}

.message.error {
  color: #fca5a5;
}

.message.success {
  color: #6ee7b7;
}

/* Danger button (logout, etc.) */
.danger-btn {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.7rem;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  background: #ef4444;
  color: #fee2e2;
}

/* Long description text (home / verify) */
.home-text {
  font-size: 0.9rem;
  color: #9ca3af;
  margin: 1rem 0 1.5rem 0;
}

/* Two inputs in one row – first/second name */
.two-cols {
  display: flex;
  gap: 0.6rem;
  width: 100%;
}

.two-cols input {
  flex: 1 1 0;
  min-width: 0;
}

/* ========== PASSWORD FIELD (eye + strength) ========== */

/* Password field with eye icon inside */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}

.password-field input {
  width: 100%;
  padding-right: 2.5rem; /* space for eye icon */
}

/* Eye icon – small button inside input */
.password-toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #e5e7eb;
}

/* Password strength – thin colored line under password */
.pw-strength {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: #111827; /* base */
  margin-top: 4px;
  margin-bottom: 6px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.pw-strength.visible {
  opacity: 1;
}

.pw-weak {
  background: #f97373;
}

.pw-medium {
  background: #facc15;
}

.pw-strong {
  background: #4ade80;
}

/* ========== HOME PAGE LAYOUT (MindAce AI dashboard) ========== */

.home-wrapper {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #191a1f;
}

.home-card {
  max-width: 480px;
}

/* top bar */

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 600;
}

.top-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.credits {
  font-size: 0.9rem;
}

.credits-label {
  color: #9ca3af;
  margin-right: 0.15rem;
}

.credits-value {
  font-weight: 600;
}

/* avatar / profile icon used as logout button */

.avatar-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid #111827;
  background: #020617;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #e5e7eb;        /* ✅ icon / text colour clear */
  font-size: 0.9rem;     /* default size */
}

.avatar-btn span {
  line-height: 1;
}

/* user info text under top bar */

.user-info {
  font-size: 0.85rem;
  color: #9ca3af;
  margin-top: -0.3rem;
  margin-bottom: 1.2rem;
  text-align: left;
}

/* logo area */

.home-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}

.home-logo {
  width: 160px;
  height: auto;
  object-fit: contain;
}

/* main buttons */

.home-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* pill buttons shared */

.pill-btn {
  width: 100%;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: center;
}

/* primary (blue) buttons */

.primary-pill {
  background: #60a5fa;
  color: #020617;
}

/* secondary style (for Last Chat, etc.) */
.secondary-pill {
  background: #60a5fa;
  color: #020617;
}

/* locked buttons */

.locked-pill {
  background: #374151;
  color: #d1d5db;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: default;
}

.lock-icon {
  font-size: 1rem;
}

.pill-block {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
}

.coming-soon {
  margin: 0;
  font-size: 0.8rem;
  color: #9ca3af;
}

/* --- OR divider under login button --- */
.or-divider {
  margin: 1rem 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.or-divider span {
  flex: 1;
  height: 1px;
  background: #111827;
}

.or-divider p {
  margin: 0;
}

/* --- Google login button --- */
.google-btn {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.65rem 1rem;
  border-radius: 0.7rem;
  border: 1px solid #111827;
  background: #020617;
  color: #e5e7eb;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
}

.google-btn:hover {
  background: #030712;
}

.google-logo {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #ffffff;
  color: #1f2933;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8rem;
}

/* ========== CHAT PAGE ========== */

.chat-page {
  width: 100%;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #191a1f;
}

.chat-card {
  max-width: 720px;
  height: 80vh;
  display: flex;
  flex-direction: column;
}

/* header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.chat-logo {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: contain;
}

.chat-app-name {
  font-size: 0.9rem;
  font-weight: 600;
}

.chat-subject {
  font-size: 0.8rem;
  color: #9ca3af;
}

/* messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.8rem 0.3rem;
  margin-bottom: 0.8rem;
}

/* each message row */
.chat-message-row {
  display: flex;
  align-items: flex-end;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

/* user right, bot left */
.chat-message-row.user {
  justify-content: flex-end;
}
.chat-message-row.bot {
  justify-content: flex-start;
}

/* avatar circles inside chat */
.chat-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  overflow: hidden;
  background: #020617;
  border: 1px solid #111827;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #e5e7eb;
}

.chat-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* bubble styles */
.chat-bubble {
  max-width: 80%;
  padding: 0.6rem 0.8rem;
  border-radius: 0.9rem;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre-line;   /* respect \n as line breaks */
}

.chat-bubble.user {
  background: #3b82f6;
  color: #020617;
  border-bottom-right-radius: 0.2rem;
}

.chat-bubble.bot {
  background: #111827;
  color: #e5e7eb;
  border-bottom-left-radius: 0.2rem;
}

/* input bar */

.chat-input-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid #111827;
  background: #020617;
  padding: 0.4rem 0.6rem;
}

.chat-input-bar input[type="text"] {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: #e5e7eb;
  font-size: 0.9rem;
  padding: 0.4rem 0.5rem;
}

.chat-input-bar input::placeholder {
  color: #6b7280;
}

.chat-icon-btn,
.chat-send-btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
}

.chat-send-btn {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #22c55e;
  color: #022c22;
  font-size: 0.9rem;
  font-weight: 600;
}

.chat-send-btn:hover {
  filter: brightness(1.05);
}

/* ====== MODAL (confirm clear) ====== */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}

.modal-overlay.hidden {
  display: none;
}

.modal-card {
  background: #020617;
  border-radius: 1rem;
  border: 1px solid #111827;
  padding: 1.5rem 1.7rem;
  max-width: 380px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.modal-card h3 {
  margin: 0 0 0.4rem 0;
  font-size: 1.05rem;
}

.modal-card p {
  margin: 0 0 1.1rem 0;
  font-size: 0.9rem;
  color: #9ca3af;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

.modal-btn {
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 0.45rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
}

.modal-btn.secondary {
  background: #111827;
  color: #e5e7eb;
}

.modal-btn.danger {
  background: #ef4444;
  color: #fee2e2;
}

.modal-btn:hover {
  filter: brightness(1.05);
}

/* --------- Typing / loading indicator (Just a sec...) ---------- */

.typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.typing-loader {
  position: relative;
  width: 26px;
  height: 26px;
}

/* rotating arc (yellow / orange line) */
.typing-orbit {
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: #facc15;   /* yellow */
  border-right-color: #f97316; /* orange */
  transform-origin: 50% 50%;
  animation: typing-orbit-spin 1s linear infinite;
}

/* inner “star” dot */
.typing-core {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffffff, #60a5fa);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.typing-label {
  font-weight: 500;
  letter-spacing: 0.01em;
}

@keyframes typing-orbit-spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
