/* ═══════════════════════════════════════════════
   David Mwiti Portfolio — Custom Styles
   Layers on top of Chatfolio template
═══════════════════════════════════════════════ */

/* ── Cinematic Rotating Taglines ── */
.cinematic-taglines {
  position: relative;
  height: 28px;
  overflow: hidden;
  margin-bottom: 18px;
  text-align: center;
}

.tagline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  font-family: 'Geist', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-color, #20c9c0);
  opacity: 0;
  white-space: nowrap;
}

/* Stagger: each tagline is visible for 3s out of 9s total cycle */
.tagline-1 {
  animation: taglineCycle 9s ease-in-out infinite 0s;
}
.tagline-2 {
  animation: taglineCycle 9s ease-in-out infinite 3s;
}
.tagline-3 {
  animation: taglineCycle 9s ease-in-out infinite 6s;
}

@keyframes taglineCycle {
  0%   { opacity: 0; transform: translateX(-50%) translateY(10px); }
  8%   { opacity: 1; transform: translateX(-50%) translateY(0); }
  28%  { opacity: 1; transform: translateX(-50%) translateY(0); }
  36%  { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ── 4-Button Intro Grid ── */
.intro-options-quad {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  max-width: 380px;
}

.intro-options-quad .btn {
  width: 100%;
  font-size: 0.78rem;
  padding: 10px 12px;
  text-align: center;
}

/* ── Voice Button in Chat Footer ── */
.voice-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 10px;
  color: var(--text-muted, #888);
  font-size: 1rem;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
}

.voice-btn:hover,
.voice-btn.listening {
  color: var(--primary-color, #20c9c0);
}

.voice-btn.listening i {
  animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(1.2); }
}

/* ── Rate Limit Message ── */
.rate-limit-message {
  border: 1px solid var(--primary-color, #20c9c0);
  border-radius: 12px;
  padding: 14px 18px;
  margin-top: 8px;
  font-size: 0.85rem;
  line-height: 1.6;
  opacity: 0;
  animation: fadeUpAndIn 0.4s ease-out forwards;
}

.rate-limit-message a {
  color: var(--primary-color, #20c9c0);
  text-decoration: none;
  font-weight: 600;
}

.rate-limit-message a:hover {
  text-decoration: underline;
}

/* ── Typing indicator (if not in base CSS) ── */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
  min-width: 52px;
}

.typing-indicator span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-color, #20c9c0);
  opacity: 0.4;
  animation: typingBounce 1.2s ease-in-out infinite;
}

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

@keyframes typingBounce {
  0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
  30%            { opacity: 1;   transform: translateY(-5px); }
}

/* ── AI message action buttons ── */
.ai-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

/* ── Citation Chips ── */
.citation-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.citation-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  padding: 5px 10px;
  border-radius: 14px;
  border: 1px solid rgba(32, 201, 192, 0.35);
  background: rgba(32, 201, 192, 0.07);
  color: var(--primary-color, #20c9c0);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-align: left;
  max-width: 280px;
}

/* icon + label on same row */
.citation-chip > i {
  float: left;
  margin-right: 5px;
  margin-top: 2px;
  font-size: 0.68rem;
}

.citation-chip:hover {
  background: rgba(32, 201, 192, 0.15);
  border-color: rgba(32, 201, 192, 0.6);
}

.citation-snippet {
  display: none;
  font-size: 0.68rem;
  color: var(--text-muted, #aaa);
  font-weight: 400;
  margin-top: 5px;
  padding-top: 5px;
  border-top: 1px solid rgba(32, 201, 192, 0.2);
  line-height: 1.5;
  max-width: 240px;
}

.citation-chip.expanded .citation-snippet {
  display: block;
}

/* ── Voice Mode Toggle active state ── */
#voice-mode-toggle.active {
  color: var(--primary-color, #20c9c0);
}

#voice-mode-toggle.active i {
  animation: voicePulse 2.5s ease-in-out infinite;
}

/* ── Responsive: stack quad buttons on small screens ── */
@media (max-width: 380px) {
  .intro-options-quad {
    grid-template-columns: 1fr;
  }
  .tagline {
    font-size: 0.68rem;
  }
}
