/* Historeal shared stylesheet */

body {
  font-family: 'Nunito', sans-serif;
  background-color: #f5f3ff;
  background-image: url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="2" fill="%23ddd6fe" /></svg>');
}

.font-display {
  font-family: 'Fredoka One', cursive;
}

/* HistoReal Banner Header */
.site-header-banner {
  background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 50%, #ede9fe 100%);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.1);
}

.site-header-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(139, 92, 246, 0.18) 1px, transparent 1px);
  background-size: 22px 22px;
  pointer-events: none;
}

.site-header-banner::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #f97316, #facc15, #4ade80, #38bdf8, #a78bfa, #f97316);
  background-size: 200% 100%;
  animation: rainbowSlide 4s linear infinite;
}

@keyframes rainbowSlide {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 0%; }
}

.banner-logo {
  display: block;
  max-width: min(400px, 72vw);
  height: auto;
  margin: 10px 0;
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .banner-logo {
    max-width: 75vw;
    margin: 8px 0;
  }
}

/* Card hover effects */
.character-card {
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  cursor: pointer;
}
.character-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* Full-screen chat interface */
.chat-interface {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  background: white;
  z-index: 1000;
  flex-direction: column;
}

/* Chat bubbles */
.chat-bubble {
  position: relative;
  border-radius: 1.5rem;
  padding: 1.5rem;
  font-size: 1.25rem;
  max-width: 80%;
  min-width: 100px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  margin-bottom: 1.5rem;
  word-wrap: break-word;
  white-space: pre-wrap;
  line-height: 1.5;
}

.chat-bubble-figure {
  background-color: #ffd84d;
  color: #1f2937;
  border-bottom-left-radius: 0.25rem;
  margin-left: 0.25rem;
  max-width: 95% !important;
  min-width: 200px;
}

.chat-bubble-figure::before {
  content: "";
  position: absolute;
  bottom: 0.5rem;
  left: -0.75rem;
  border-width: 0.75rem 0.75rem 0 0;
  border-style: solid;
  border-color: #ffd84d transparent transparent transparent;
  transform: rotate(180deg);
}

.chat-bubble-user {
  background-color: #a7cbf8;
  color: #1f2937;
  border-bottom-right-radius: 0.25rem;
  margin-right: 1rem;
}

.chat-bubble-user::after {
  content: "";
  position: absolute;
  bottom: 0.5rem;
  right: -0.75rem;
  border-width: 0.75rem 0 0 0.75rem;
  border-style: solid;
  border-color: transparent transparent transparent #a7cbf8;
  transform: rotate(90deg);
}

.chat-bubble-system {
  background-color: #f1f5f9;
  color: #64748b;
  font-style: italic;
  text-align: center;
  max-width: 100%;
  margin: 1rem auto;
}

/* Chat background pattern */
.bg-pattern {
  background-image: url(https://lh3.googleusercontent.com/aida-public/AB6AXuBGcqd0VM3ilVa3xuuAV2kIkSW8GfxQle7YUGleXgGwz9QO2hFEt55ZIAjiYHYD0sWvieDI_VTsI4rVj2qXw14qC5n5z7TW3ROE4nCTPgRd35q6SlA1wJHEjSp_do0WSJ4kFzCWTprHhz_LqoQiX7pd6D01bISH54GmnqH_qNBlT8LpJtO3ghor3C14YrQxjDoVWAquQPhfA-5Q-AF0o-AG975VNdd-5Re6dflmgMMxwiKDoaZtqnOeCaH8eSyWhrFszf47BVC7-08);
  background-repeat: repeat;
  background-size: 150px;
  opacity: 0.6;
}

.chat-content {
  position: relative;
  z-index: 1;
}

/* Speak button */
.speak-btn {
  transition: all 0.2s ease;
}
.speak-btn.active {
  background: #dc2626 !important;
  transform: scale(1.05);
}

/* Connection status dot indicator */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.status-connected {
  background-color: #4ade80;
  box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
}
.status-dot.status-connecting {
  background-color: #facc15;
  animation: statusPulse 1.2s ease-in-out infinite;
}
.status-dot.status-disconnected {
  background-color: #f87171;
}
@keyframes statusPulse {
  0%   { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.7); }
  70%  { box-shadow: 0 0 0 6px rgba(250, 204, 21, 0); }
  100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0); }
}

/* Navigation button */
.nav-category-btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.nav-category-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s ease;
}

.nav-category-btn:hover::before {
  left: 100%;
  transition-delay: 0.15s;
}

.nav-category-btn.nav-active {
  box-shadow: 0 0 0 3px rgba(255,255,255,0.7), 0 4px 12px rgba(0,0,0,0.2);
  transform: scale(1.06);
}

@media (max-width: 768px) {
  .nav-category-btn {
    padding: 0.75rem;
    font-size: 0.75rem;
  }
  .nav-category-btn div {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
  }
  #categoryNav {
    gap: 0.5rem;
  }
}

/* Search bar */
.character-search {
  width: 100%;
  max-width: 400px;
  padding: 0.6rem 1.2rem;
  border-radius: 9999px;
  border: 2px solid #ddd6fe;
  background: white;
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  color: #374151;
  margin-bottom: 1.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.character-search:focus {
  outline: none;
  border-color: #8b5cf6;
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
}
.character-search::placeholder {
  color: #9ca3af;
}
