/* loader.css - Session-cookie loader */

.loader-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s ease, background-color 0.3s ease;
}

.loader-overlay.hide {
  opacity: 0;
  pointer-events: none;
}

.site-hidden {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.site-hidden.show {
  opacity: 1;
}

/* Skip loader if cookie exists */
body.loader-done .loader-overlay {
  display: none;
}
body.loader-done .site-hidden {
  opacity: 1;
}

.loader-logo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.loader-logo-img {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 0 12px rgba(0, 229, 255, 0.3)) drop-shadow(0 0 24px rgba(255, 45, 107, 0.2));
}

.loader-wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 5px;
  color: #00e5ff;
  text-transform: uppercase;
  text-shadow: 0 0 7px rgba(0, 229, 255, 0.6), 0 0 20px rgba(0, 229, 255, 0.3);
}

.loader-wordmark span {
  color: #ff2d6b;
  text-shadow: 0 0 7px rgba(255, 45, 107, 0.6), 0 0 20px rgba(255, 45, 107, 0.3);
}

.loader-subtitle {
  font-family: var(--font-body);
  font-size: 10px;
  color: #555;
  letter-spacing: 0.5px;
}

.loader-heading {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: #444;
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.chats {
  display: flex;
  gap: 16px;
}

.chat-box {
  width: 300px;
  background: #0a0a0a;
  border: 1px solid #1a1a1a;
  border-radius: 8px;
  overflow: hidden;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.chat-header {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: #333;
  border-bottom: 1px solid #1a1a1a;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

.tag {
  font-size: 9px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 600;
  background: #111;
  color: #333;
  border: 1px solid #1a1a1a;
}

.chat-body {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  opacity: 0;
  transform: translateY(6px);
}

.msg.visible {
  animation: fadeIn 0.3s ease forwards;
}

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

.user-msg {
  background: #0d0d0d;
  border: 1px solid #1a1a1a;
  color: #e8e8e8;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.user-msg svg { flex-shrink: 0; margin-top: 2px; }

.user-msg mark {
  background: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.ai-msg {
  background: #080808;
  border: 1px solid #1a1a1a;
  color: #e0e0e0;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.ai-msg svg { flex-shrink: 0; margin-top: 2px; }

.ai-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #2a2a2a;
  margin-bottom: 3px;
}

.msg-text { flex: 1; }

.typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 4px 0;
}

.typing-dots span {
  width: 5px; height: 5px;
  background: #2a2a2a;
  border-radius: 50%;
  animation: bounce 1s ease-in-out infinite;
}

.typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.3; }
  50% { transform: translateY(-5px); opacity: 1; }
}

.cursor {
  display: inline-block;
  width: 1.5px;
  height: 12px;
  background: #555;
  vertical-align: text-bottom;
  animation: blink 0.5s step-end infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.bottom-text {
  margin-top: 24px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 0 20px rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.6s ease;
}

.bottom-text.visible { opacity: 1; }

@media (max-width: 700px) {
  .chats { flex-direction: column; gap: 12px; }
  .chat-box { width: 90vw; }
}

/* ── Light Theme Overrides ──────────────────────────── */
[data-theme="light"] .loader-overlay {
  background: #f5f0e8;
}

[data-theme="light"] .loader-wordmark {
  color: #0a7a9e;
  text-shadow: 0 0 7px rgba(10, 122, 158, 0.4), 0 0 20px rgba(10, 122, 158, 0.15);
}

[data-theme="light"] .loader-wordmark span {
  color: #c42050;
  text-shadow: 0 0 7px rgba(196, 32, 80, 0.4), 0 0 20px rgba(196, 32, 80, 0.15);
}

[data-theme="light"] .loader-subtitle {
  color: #6b5d4a;
}

[data-theme="light"] .loader-heading {
  color: #6b5d4a;
}

[data-theme="light"] .chat-box {
  background: #ebe4d0;
  border-color: #c9bda4;
}

[data-theme="light"] .chat-header {
  color: #6b5d4a;
  border-bottom-color: #c9bda4;
}

[data-theme="light"] .chat-header svg {
  stroke: #6b5d4a;
}

[data-theme="light"] .tag {
  background: #e5dcc6;
  color: #6b5d4a;
  border-color: #c9bda4;
}

[data-theme="light"] .user-msg {
  background: #e5dcc6;
  border-color: #c9bda4;
  color: #2c2416;
}

[data-theme="light"] .user-msg mark {
  color: #2c2416;
}

[data-theme="light"] .user-msg svg {
  stroke: #6b5d4a;
}

[data-theme="light"] .ai-msg {
  background: #f0ead6;
  border-color: #c9bda4;
  color: #2c2416;
}

[data-theme="light"] .ai-msg svg {
  stroke: #6b5d4a;
}

[data-theme="light"] .ai-label {
  color: #9a8b74;
}

[data-theme="light"] .typing-dots span {
  background: #9a8b74;
}

[data-theme="light"] .cursor {
  background: #6b5d4a;
}

[data-theme="light"] .bottom-text {
  color: #2c2416;
  text-shadow: none;
}

[data-theme="light"] .loader-logo-img {
  filter: drop-shadow(0 0 12px rgba(10, 122, 158, 0.2)) drop-shadow(0 0 24px rgba(196, 32, 80, 0.1));
}
