/* ═══════════════════════════════════════════════
   Alexander Daza Portfolio — Custom Styles
   Layers on top of Chatfolio template
═══════════════════════════════════════════════ */

:root {
  --primary-color: #45e77b;
}

/* ── 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, #45e77b);
  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%;
  min-width: 0;
  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, #45e77b);
}

.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, #45e77b);
  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, #45e77b);
  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, #45e77b);
  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(69, 231, 123, 0.35);
  background: rgba(69, 231, 123, 0.07);
  color: var(--primary-color, #45e77b);
  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(69, 231, 123, 0.15);
  border-color: rgba(69, 231, 123, 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(69, 231, 123, 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, #45e77b);
}

#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;
  }
}

/* ── Mobile hardening for the customized 4-button/voice layout ── */
@media (max-width: 767px) {
  .intro-screen .intro-content {
    width: auto;
    max-width: 100%;
    padding-inline: 16px;
  }

  .intro-screen .intro-text {
    width: 100%;
    max-width: calc(100vw - 32px);
    text-align: center;
  }

  .intro-screen .intro-text h1,
  .intro-screen .intro-text h2 {
    max-width: 100%;
    overflow-wrap: normal;
    text-wrap: balance;
  }

  .intro-screen .intro-text h1 {
    font-size: clamp(1.45rem, 8vw, 1.9rem);
    line-height: 1.25;
  }

  .intro-screen .intro-text h2 {
    font-size: clamp(1.35rem, 7vw, 1.7rem);
    line-height: 1.25;
  }

  .intro-options-quad {
    grid-template-columns: 1fr;
    width: min(260px, calc(100vw - 32px)) !important;
    max-width: min(260px, calc(100vw - 32px));
    gap: 8px;
  }

  .intro-options-quad .btn {
    margin: 0 !important;
    padding: 10px 6px;
    min-height: 42px;
    line-height: 1.15;
    max-width: 100%;
    overflow: hidden;
    font-size: 0.72rem;
  }

  .chat-footer .input-area-visual {
    min-width: 0;
  }

  .chat-footer .input-area-visual input {
    min-width: 0;
  }

  .chat-footer .input-nav-wrapper .input-area-visual input {
    padding-right: 92px;
  }

  .chat-footer .input-area-visual #voice-button {
    position: absolute;
    right: 48px;
    width: 34px;
    height: 34px;
    justify-content: center;
    padding: 0;
    z-index: 2;
  }

  #voice-mode-toggle {
    display: none;
  }
}

@media (max-width: 360px) {
  .intro-options-quad {
    grid-template-columns: 1fr;
  }
}

/* ── Chat scroll + keep intro reachable after conversation starts ── */
.chat-container {
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
  height: auto;
}

.chat-area-content {
  min-height: 100vh;
  height: auto;
}

.chat-window {
  flex-grow: 1;
  height: auto;
  min-height: calc(100vh - 180px);
  max-height: none;
  overflow: visible;
  padding-bottom: 180px;
}

/* After first message: collapse intro into the scroll flow (not removed) */
.intro-screen.conversation-started {
  position: relative;
  top: auto;
  left: auto;
  right: auto;
  bottom: auto;
  height: auto;
  min-height: 0;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  z-index: 0;
  padding: 24px 20px 8px;
  justify-content: flex-start;
  background: transparent;
}

.intro-screen.conversation-started.fade-out {
  /* Override template fade-out so the header stays visible when scrolling up */
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.intro-screen.conversation-started .intro-options,
.intro-screen.conversation-started .intro-bottom-content {
  display: none;
}

.intro-screen.conversation-started .intro-text h1,
.intro-screen.conversation-started .intro-text h2 {
  font-size: clamp(1.4rem, 4vw, 2rem);
}

.intro-screen.conversation-started .image-container {
  transform: scale(0.85);
  margin-bottom: 8px;
}

/* ── Language Switcher + Cases link ── */
.lang-switch,
.casos-link {
  position: fixed;
  top: 16px;
  z-index: 1000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-color, #f5f5f5);
  font-family: 'Geist', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-decoration: none;
  backdrop-filter: blur(4px);
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.lang-switch {
  right: 16px;
  width: 36px;
  border-radius: 50%;
}

.casos-link {
  right: 60px;
  padding: 0 12px;
  border-radius: 999px;
}

.lang-switch:hover,
.casos-link:hover {
  border-color: var(--primary-color, #45e77b);
  color: var(--primary-color, #45e77b);
  background: rgba(0, 0, 0, 0.4);
}

@media (max-width: 767px) {
  .lang-switch,
  .casos-link {
    top: 10px;
    height: 32px;
    font-size: 0.7rem;
  }

  .lang-switch {
    right: 10px;
    width: 32px;
  }

  .casos-link {
    right: 48px;
    padding: 0 10px;
  }
}

/* ── Static content pages (/casos/) ── */
body.content-page {
  margin: 0;
  min-height: 100vh;
  background: #0b0f0c;
  color: #e8ece9;
  font-family: 'Geist', system-ui, sans-serif;
  line-height: 1.65;
}

.content-page .content-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}

.content-page .content-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  margin-bottom: 2rem;
  font-size: 0.9rem;
}

.content-page .content-nav a {
  color: var(--primary-color, #45e77b);
  text-decoration: none;
}

.content-page .content-nav a:hover {
  text-decoration: underline;
}

.content-page .content-nav .sep {
  color: #5a635c;
}

.content-page h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.75rem;
  color: #fff;
}

.content-page h2 {
  font-family: 'Unbounded', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  margin: 2rem 0 0.75rem;
  color: #fff;
}

.content-page .lede {
  font-size: 1.05rem;
  color: #b8c0ba;
  margin: 0 0 1.5rem;
}

.content-page .case-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
}

.content-page .case-list li {
  border: 1px solid rgba(69, 231, 123, 0.2);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  background: rgba(69, 231, 123, 0.04);
}

.content-page .case-list a {
  color: var(--primary-color, #45e77b);
  font-weight: 600;
  text-decoration: none;
}

.content-page .case-list a:hover {
  text-decoration: underline;
}

.content-page .case-list p {
  margin: 0.4rem 0 0;
  color: #a8b0ab;
  font-size: 0.95rem;
}

.content-page .tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 1.5rem;
}

.content-page .tags span {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid rgba(69, 231, 123, 0.35);
  color: var(--primary-color, #45e77b);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.content-page ul.bullets {
  padding-left: 1.2rem;
  margin: 0.5rem 0 1rem;
}

.content-page ul.bullets li {
  margin-bottom: 0.45rem;
}

.content-page .planned {
  border-left: 3px solid var(--primary-color, #45e77b);
  padding: 0.75rem 0 0.75rem 1rem;
  margin: 1.5rem 0;
  background: rgba(69, 231, 123, 0.05);
}

.content-page footer.content-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.9rem;
  color: #8a938c;
}

.content-page footer.content-footer a {
  color: var(--primary-color, #45e77b);
  text-decoration: none;
}

