/* ============================
   chat.css - vFixed (UI, Dots, Timer & Mobile)
   ============================ */

/* CHAT HEADER */
.chat-header {
  height: 60px;
  padding: 0 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(10, 11, 20, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  z-index: 50;
}

.chat-title h2 { margin: 0; font-size: 16px; color: var(--text-main); }
.chat-title small { font-size: 11px; color: #10b981; }

/* ✅ FIXED: MAGIC TIMER (Bright Green & Visible) */
.timer-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399; /* Bright Green Text */
  padding: 4px 10px;
  border-radius: 20px;
  font-family: monospace;
  font-size: 14px;
  font-weight: bold;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
  margin-right: 8px;
  min-width: 60px;
  justify-content: center;
}

/* ✅ FIXED: STATUS DOTS (White = Offline, Green = Online) */
.status-group { display: flex; gap: 8px; }
.status-item { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--text-muted); }

/* Default: WHITE (Offline/Inactive) */
.status-dot { 
  width: 8px; 
  height: 8px; 
  border-radius: 50%; 
  background: #ffffff; 
  opacity: 0.3; 
  transition: 0.3s all ease;
}

/* Active: GREEN (Online/Connected) */
.status-dot.active { 
  background: #22c55e; 
  opacity: 1; 
  box-shadow: 0 0 8px #22c55e; 
}

/* MOTIVATION BAR */
#sticky-motivation {
  position: relative;
  background: linear-gradient(90deg, #1e1b4b, #312e81);
  color: #c7d2fe;
  padding: 8px 12px;
  font-size: 12px;
  text-align: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 40;
}

/* SELECTION TOOLBAR */
#selection-toolbar {
  background: #3f6212;
  color: white;
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
#selection-toolbar button { 
    cursor: pointer; color:white; font-weight:bold; 
    padding: 6px 14px; border: 1px solid rgba(255,255,255,0.3); 
    background: rgba(0,0,0,0.2); border-radius: 8px; 
}

/* CHAT AREA layout */
.chat-box {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px; 
  padding-bottom: 90px; 
}

/* MESSAGES COMMON STYLE */
.message {
  max-width: 90%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 16px;
  line-height: 1.6;
  word-wrap: break-word;
}

/* ✅ FIXED: AI MESSAGE (Transparent, Clean, Full Width) */
.ai-message {
  align-self: flex-start;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #e2e8f0;
  padding: 4px 2px; /* Minimal padding */
  margin-left: 0;
  width: 100%;
  max-width: 100% !important; /* Force full width */
}

/* AI Text Typography */
.ai-message strong { color: #22d3ee; font-weight: 700; } 
.ai-message p { margin: 8px 0; font-size: 16px; line-height: 1.7; color: #cbd5e1; }
.ai-message ul { padding-left: 20px; color: #cbd5e1; margin: 8px 0; }
.ai-message li { margin-bottom: 6px; }

/* USER MESSAGE (Bubble) */
.user-message {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--accent), #0891b2);
  color: #000;
  font-weight: 500;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.2);
}

/* SELECTION VISUALS */
.message.selected {
  border: 2px solid #bef264 !important;
  background: rgba(190, 242, 100, 0.1) !important;
  border-radius: 12px;
}

/* ✅ FIXED: COMPOSER (Mobile Fit) */
.composer-area {
  position: sticky;
  bottom: 0;
  background: rgba(10, 11, 20, 0.98);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 10px;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 12px);
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: rgba(255,255,255,0.05);
  padding: 8px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  width: 100%;
  box-sizing: border-box; /* Ensures padding doesn't overflow width */
}

.composer textarea {
  flex: 1; /* Fills remaining space */
  background: transparent;
  border: none;
  color: white;
  padding: 8px 4px;
  max-height: 120px;
  font-size: 16px;
  font-family: inherit;
  min-width: 0; /* Prevents overflow in flexbox */
}
.composer textarea:focus { outline: none; }

.icon-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0; /* Prevents squishing on small screens */
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: transparent;
  font-size: 18px;
  color: #94a3b8;
  cursor: pointer;
}
.icon-btn:hover { background: rgba(255,255,255,0.1); color: white; }
.icon-btn.primary { background: var(--accent); color: #000; box-shadow: 0 0 10px var(--accent-glow); }

#file-preview {
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(30, 41, 59, 0.8);
  padding: 8px 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  font-size: 12px; border: 1px solid rgba(255,255,255,0.1);
}
