/* ===================================================
   প্রেমের কথা 💕 - Romantic Chat App Styles
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&display=swap');

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-dark:       #0d0d1a;
  --bg-card:       #16162a;
  --bg-surface:    #1e1e35;
  --bg-input:      #252540;
  --accent-pink:   #ff6eb4;
  --accent-purple: #9b59b6;
  --accent-rose:   #ff4081;
  --accent-lavender: #c77dff;
  --user-bubble:   linear-gradient(135deg, #ff6eb4, #c44de8);
  --ai-bubble:     #252545;
  --text-primary:  #f0e6ff;
  --text-secondary:#a89bc2;
  --text-muted:    #6b5f80;
  --border:        rgba(155, 89, 182, 0.25);
  --shadow-glow:   0 0 30px rgba(255, 110, 180, 0.3);
  --radius-bubble: 18px;
  --font:          'Hind Siliguri', 'Noto Sans Bengali', sans-serif;
  --transition:    0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  font-family: var(--font);
  background: var(--bg-dark);
  color: var(--text-primary);
  overflow: hidden;
  user-select: none;
}

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

/* ===================================================
   FLOATING HEARTS BACKGROUND
   =================================================== */
.hearts-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.heart-particle {
  position: absolute;
  bottom: -60px;
  font-size: 1.2rem;
  animation: floatHeart linear infinite;
  opacity: 0;
}

@keyframes floatHeart {
  0%   { transform: translateY(0) rotate(0deg) scale(0.5); opacity: 0; }
  10%  { opacity: 0.7; }
  90%  { opacity: 0.3; }
  100% { transform: translateY(-110vh) rotate(360deg) scale(1.2); opacity: 0; }
}

/* ===================================================
   SETUP SCREEN
   =================================================== */
.setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 30% 20%, rgba(155,89,182,0.25) 0%, transparent 60%),
              radial-gradient(ellipse at 70% 80%, rgba(255,64,129,0.2) 0%, transparent 60%),
              var(--bg-dark);
  padding: 20px;
  overflow-y: auto;
}

.setup-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 40px 36px;
  width: 100%;
  max-width: 460px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6), var(--shadow-glow);
  animation: slideUp 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.setup-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-pink), var(--accent-lavender), transparent);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.setup-logo {
  text-align: center;
  margin-bottom: 32px;
}

.logo-heart {
  font-size: 3.5rem;
  animation: heartbeat 2s ease-in-out infinite;
  display: inline-block;
  margin-bottom: 10px;
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  14%       { transform: scale(1.2); }
  28%       { transform: scale(1); }
  42%       { transform: scale(1.15); }
  56%       { transform: scale(1); }
}

.setup-logo h1 {
  font-size: 2rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-lavender));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.setup-subtitle {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* Input Groups */
.setup-form { display: flex; flex-direction: column; gap: 20px; }

.input-group { display: flex; flex-direction: column; gap: 8px; }

.input-group label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.label-icon { font-size: 1rem; }

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-group input,
.input-wrapper input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 18px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: var(--transition);
  outline: none;
}

.input-group input:focus,
.input-wrapper input:focus {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(255, 110, 180, 0.15);
}

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

.eye-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  opacity: 0.6;
  transition: opacity 0.2s;
  padding: 4px;
}
.eye-btn:hover { opacity: 1; }

.hint-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Gender Selection */
.gender-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.gender-card {
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.gender-card:hover {
  border-color: var(--accent-purple);
  transform: translateY(-2px);
}

.gender-card.selected {
  border-color: var(--accent-pink);
  background: linear-gradient(135deg, rgba(255,110,180,0.12), rgba(155,89,182,0.12));
  box-shadow: 0 0 20px rgba(255, 110, 180, 0.2);
}

.gender-card.selected::after {
  content: '✓';
  position: absolute;
  top: 8px; right: 10px;
  font-size: 0.75rem;
  background: var(--accent-pink);
  color: white;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.gender-icon { font-size: 2rem; margin-bottom: 6px; }

.gender-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.gender-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}
/* Advanced Settings Accordion */
.advanced-settings-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px dashed var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: var(--transition);
}

.advanced-settings-toggle:hover {
  border-color: var(--accent-pink);
  color: var(--text-primary);
}

.advanced-settings {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  background: rgba(30, 30, 53, 0.6);
  border: 1px solid var(--border);
  border-radius: 14px;
  animation: fadeIn 0.3s ease;
}

/* Start Button */
.start-btn {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-pink), var(--accent-lavender));
  background-size: 200% 200%;
  border: none;
  border-radius: 16px;
  color: white;
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  animation: gradientShift 3s ease infinite;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-top: 4px;
}

.start-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 64, 129, 0.4);
}

.start-btn:active { transform: translateY(0); }

.btn-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.start-btn:hover .btn-shine { transform: translateX(100%); }

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50%       { background-position: 100% 50%; }
}

.privacy-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
}

/* ===================================================
   CHAT APP SCREEN
   =================================================== */
.chat-app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-dark);
  z-index: 10;
}

/* Chat Header */
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: rgba(22, 22, 42, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 20;
}

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

.ai-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-lavender));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  position: relative;
  box-shadow: 0 0 15px rgba(255, 110, 180, 0.4);
  flex-shrink: 0;
}

.online-dot {
  position: absolute;
  bottom: 2px; right: 2px;
  width: 11px; height: 11px;
  background: #4ade80;
  border-radius: 50%;
  border: 2px solid var(--bg-dark);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

.header-info h2 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.status-text {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: #4ade80;
  font-weight: 500;
}

.status-dot {
  width: 7px; height: 7px;
  background: #4ade80;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.header-actions { display: flex; gap: 8px; }

.header-btn {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 38px; height: 38px;
  cursor: pointer;
  font-size: 1rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-btn:hover {
  background: var(--bg-surface);
  border-color: var(--accent-pink);
  transform: scale(1.1);
}

/* Messages Area */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  scroll-behavior: smooth;
}

/* Date separator */
.date-sep {
  text-align: center;
  margin: 12px 0;
}

.date-sep span {
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

/* Message Rows */
.msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: msgPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin-bottom: 2px;
}

@keyframes msgPop {
  from { opacity: 0; transform: scale(0.8) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

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

.msg-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-lavender));
}

.msg-avatar.user-av {
  background: linear-gradient(135deg, #6c63ff, #9b59b6);
}

.msg-content { max-width: 72%; display: flex; flex-direction: column; }
.user-row .msg-content { align-items: flex-end; }

.msg-bubble {
  padding: 11px 16px;
  border-radius: var(--radius-bubble);
  font-size: 0.95rem;
  line-height: 1.55;
  word-break: break-word;
  position: relative;
  white-space: pre-wrap;
}

/* AI Bubble */
.ai-bubble {
  background: var(--ai-bubble);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(155,89,182,0.2);
}

/* User Bubble */
.user-bubble {
  background: var(--user-bubble);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(255, 64, 129, 0.3);
}

.msg-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
  padding: 0 4px;
}

/* Read ticks */
.msg-ticks {
  font-size: 0.75rem;
  color: var(--accent-lavender);
  margin-left: 4px;
}

/* Typing Indicator */
.typing-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 4px;
  flex-shrink: 0;
}

.typing-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-lavender));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.typing-bubble {
  background: var(--ai-bubble);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  border: 1px solid rgba(155,89,182,0.2);
}

.typing-dots {
  display: flex;
  gap: 5px;
  align-items: center;
}

.typing-dots span {
  width: 8px; height: 8px;
  background: var(--accent-pink);
  border-radius: 50%;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.8); opacity: 0.5; }
  40%            { transform: scale(1.2); opacity: 1; }
}

/* Input Area */
.input-area {
  flex-shrink: 0;
  background: rgba(22, 22, 42, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 12px 16px 14px;
}

.input-container {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 28px;
  padding: 8px 8px 8px 14px;
  transition: border-color 0.3s;
}

.input-container:focus-within {
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(255, 110, 180, 0.12);
}

.emoji-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  flex-shrink: 0;
  padding: 2px;
  transition: transform 0.2s;
  line-height: 1;
}
.emoji-btn:hover { transform: scale(1.2) rotate(15deg); }

.text-input-wrapper { flex: 1; }

#messageInput {
  width: 100%;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: none;
  max-height: 120px;
  overflow-y: auto;
}

#messageInput::placeholder { color: var(--text-muted); }

.send-btn {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-rose), var(--accent-pink));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition);
  box-shadow: 0 4px 15px rgba(255, 64, 129, 0.4);
}

.send-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 20px rgba(255, 64, 129, 0.5);
}

.send-btn:disabled {
  opacity: 0.5;
  transform: none;
  cursor: not-allowed;
}

.send-btn svg { width: 18px; height: 18px; }

/* Emoji Panel */
.emoji-panel {
  padding: 8px 0 2px;
  animation: fadeIn 0.2s ease;
}

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

.emoji-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
}

.emoji-grid span, .emoji-cell {
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
  transition: transform 0.15s;
}

.emoji-cell:hover { transform: scale(1.3); background: var(--bg-surface); }

/* Welcome Banner */
.welcome-banner {
  text-align: center;
  padding: 30px 20px;
  animation: fadeIn 0.8s ease;
}

.wb-emoji { font-size: 3rem; margin-bottom: 10px; animation: heartbeat 2s ease-in-out infinite; }

.wb-title {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-pink), var(--accent-lavender));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
}

.wb-sub { font-size: 0.85rem; color: var(--text-muted); }

/* Responsive */
@media (max-width: 480px) {
  .setup-card { padding: 28px 20px; }
  .setup-logo h1 { font-size: 1.7rem; }
  .msg-content { max-width: 82%; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #ef4444;
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 0.85rem;
  z-index: 999;
  opacity: 0;
  transition: all 0.3s;
  font-family: var(--font);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
