/*
  GreenVale Society — AI Chat Interface
  Matches the societysubidha.netlify.app theme
*/

@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=DM+Sans:wght@300;400;500;600&display=swap");

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

:root {
  --sage: #5a7a5e;
  --sage-light: #eef4ee;
  --sage-mid: #c8dbc9;
  --cream: #faf8f4;
  --cream-dark: #f2ede4;
  --ink: #1c2320;
  --ink-mid: #3d4f43;
  --ink-light: #7a8c7e;
  --white: #ffffff;
  --border: #e4ebe4;
  --shadow-sm: 0 1px 4px rgba(28, 35, 32, 0.07);
  --shadow-md: 0 4px 20px rgba(28, 35, 32, 0.1);
  --shadow-lg: 0 12px 40px rgba(28, 35, 32, 0.13);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
}

html,
body {
  height: 100%;
  font-family: "DM Sans", sans-serif;
  background: var(--cream);
  color: var(--ink);
  overflow: hidden;
}

/* ── Ambient orbs ─────────────────────────────── */
.orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}
.orb-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #c8dbc9 0%, transparent 70%);
  top: -150px;
  left: -150px;
}
.orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #e8dfd0 0%, transparent 70%);
  bottom: -100px;
  right: -100px;
}

/* ── App layout ───────────────────────────────── */
.app-layout {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  gap: 16px;
}

/* ── Sidebar ──────────────────────────────────── */
.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.logo-gem {
  width: 34px;
  height: 34px;
  background: var(--ink);
  color: var(--white);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-logo span {
  font-family: "Playfair Display", serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  letter-spacing: -0.3px;
}

.back-home {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-light);
  text-decoration: none;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  transition: all 0.2s;
  margin-bottom: 4px;
}
.back-home:hover {
  background: var(--sage-light);
  color: var(--sage);
}

.sidebar-divider {
  height: 1px;
  background: var(--border);
  margin: 14px 0;
}

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-light);
  margin-bottom: 10px;
  padding: 0 2px;
}

.quick-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 9px 10px;
  border-radius: var(--radius-xs);
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-mid);
  text-align: left;
  transition: all 0.18s;
  width: 100%;
}
.quick-btn:hover {
  background: var(--sage-light);
  color: var(--sage);
  transform: translateX(3px);
}
.quick-icon {
  font-size: 15px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.info-card {
  background: var(--ink);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-top: auto;
}
.info-card-title {
  font-family: "Playfair Display", serif;
  font-size: 13px;
  color: var(--white);
  margin-bottom: 4px;
}
.info-card-text {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}
.info-card-number {
  font-size: 13px;
  font-weight: 600;
  color: var(--sage-mid);
  text-decoration: none;
  letter-spacing: 0.02em;
}

/* ── Chat Main ────────────────────────────────── */
.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  min-width: 0;
}

/* Header */
.chat-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  flex-shrink: 0;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.assistant-avatar {
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--white);
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-title {
  font-family: "Playfair Display", serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.status-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
}

.status-dot {
  width: 7px;
  height: 7px;
  background: #4caf72;
  border-radius: 50%;
  animation: pulse-dot 2.5s infinite;
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.status-text {
  font-size: 12px;
  color: var(--ink-light);
}

.mobile-back {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  color: var(--ink-light);
  text-decoration: none;
  padding: 7px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  transition: all 0.2s;
}
.mobile-back:hover {
  background: var(--sage-light);
  color: var(--sage);
}

/* Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
  background: var(--cream);
}

.chat-messages::-webkit-scrollbar {
  width: 5px;
}
.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}
.chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Message base */
.message {
  display: flex;
  gap: 10px;
  animation: msgIn 0.3s ease-out both;
}

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

.msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.ai-message .msg-avatar {
  background: var(--ink);
  color: var(--white);
}

.msg-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 75%;
}

.msg-bubble {
  padding: 13px 16px;
  border-radius: 0 14px 14px 14px;
  font-size: 14px;
  line-height: 1.6;
  word-wrap: break-word;
}

.ai-message .msg-bubble {
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.user-message {
  flex-direction: row-reverse;
}

.user-message .msg-body {
  align-items: flex-end;
}

.user-message .msg-bubble {
  background: var(--ink);
  color: var(--white);
  border-radius: 14px 0 14px 14px;
  border: none;
}

.msg-time {
  font-size: 11px;
  color: var(--ink-light);
  padding: 0 4px;
}

/* Welcome chips */
.welcome-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.welcome-chips span {
  background: var(--sage-light);
  color: var(--sage);
  border: 1px solid var(--sage-mid);
  border-radius: 20px;
  padding: 4px 11px;
  font-size: 12px;
  font-weight: 500;
}

/* Typing indicator */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 12px;
  flex-shrink: 0;
}

.typing-avatar {
  width: 32px;
  height: 32px;
  background: var(--ink);
  color: var(--white);
  border-radius: 10px;
}

.typing-dots {
  display: flex;
  gap: 5px;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 0 14px 14px 14px;
  box-shadow: var(--shadow-sm);
}

.typing-dots span {
  width: 7px;
  height: 7px;
  background: var(--ink-light);
  border-radius: 50%;
  animation: bounce 0.9s infinite;
}
.typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes bounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-7px);
  }
}

/* Input */
.chat-input-area {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--white);
  flex-shrink: 0;
}

.input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input {
  flex: 1;
  padding: 13px 18px;
  border: 1.5px solid var(--border);
  border-radius: 30px;
  font-family: "DM Sans", sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--cream);
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}
.chat-input::placeholder {
  color: var(--ink-light);
}
.chat-input:focus {
  border-color: var(--sage);
  background: var(--white);
}

.voice-btn,
.send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.voice-btn {
  background: var(--cream-dark);
  color: var(--ink-mid);
  border: 1.5px solid var(--border);
}
.voice-btn:hover {
  background: var(--sage-light);
  color: var(--sage);
  border-color: var(--sage-mid);
}
.voice-btn.listening {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
  animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.3);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(220, 38, 38, 0);
  }
}

.send-btn {
  background: var(--ink);
  color: var(--white);
}
.send-btn:hover {
  background: var(--sage);
  transform: scale(1.05);
}
.send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.input-hint {
  font-size: 11px;
  color: var(--ink-light);
  text-align: center;
  margin-top: 8px;
}

.input-hint kbd {
  background: var(--cream-dark);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  font-family: inherit;
}

/* ── Event Cards ───────────────────────────────── */
.event-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.event-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.event-card:hover {
  box-shadow: var(--shadow-md);
}

.event-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.event-name {
  font-family: "Playfair Display", serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.event-spots {
  background: var(--sage-light);
  color: var(--sage);
  border: 1px solid var(--sage-mid);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 500;
}

.event-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.event-meta span {
  font-size: 12px;
  color: var(--ink-light);
}

.book-btn {
  background: var(--ink);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  width: 100%;
}
.book-btn:hover {
  background: var(--sage);
  transform: translateY(-1px);
}

/* ── Booking form ───────────────────────────────── */
.booking-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.book-input {
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  color: var(--ink);
  background: var(--cream);
  outline: none;
  transition: border-color 0.2s;
}
.book-input:focus {
  border-color: var(--sage);
  background: var(--white);
}
.book-input::placeholder {
  color: var(--ink-light);
}

.confirm-btn {
  background: var(--sage);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 4px;
}
.confirm-btn:hover {
  background: var(--ink);
}

/* ── Responsive ────────────────────────────────── */
@media (max-width: 768px) {
  .app-layout {
    padding: 0;
    gap: 0;
  }
  .sidebar {
    display: none;
  }
  .chat-main {
    border-radius: 0;
    border: none;
    height: 100vh;
  }
  .mobile-back {
    display: flex;
  }
  .msg-body {
    max-width: 85%;
  }
}
