/* ============================================================
   IAMANOS.COM — Dark Chat Interface
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --gold: #f5c842;
  --gold-light: #ffe680;
  --blue: #2563eb;
  --blue-light: #60a5fa;
  --bg-main: #111111;
  --bg-ai-bubble: #1e1e2e;
  --bg-header: #0a0a0f;
  --text-primary: #f0f0f0;
  --text-muted: #888;
  --border-subtle: rgba(245, 200, 66, 0.15);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  overflow: hidden;
}

/* ============================================================
   LAYOUT — Sticky header/footer, flex main
   ============================================================ */

body {
  display: flex;
  flex-direction: column;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  position: relative;
  height: 130px;
  flex-shrink: 0;
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}

.particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.header-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  pointer-events: none;
}

.logo-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.logo-img {
  height: 100px;
  width: auto;
  display: block;
  animation: logoFloat 4s ease-in-out infinite, logoGlow 3s ease-in-out infinite;
  transform-origin: center bottom;
  will-change: transform, filter;
}

.logo-img:hover {
  animation: logoFloatHover 0.4s ease forwards, logoGlowBurst 0.4s ease forwards;
}

@keyframes logoFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-9px) scale(1.04);
  }
}

@keyframes logoFloatHover {
  to {
    transform: translateY(-12px) scale(1.08);
  }
}

@keyframes logoGlow {
  0%, 100% {
    filter:
      drop-shadow(0 4px 18px rgba(37, 99, 235, 0.55))
      drop-shadow(0 0 8px rgba(180, 210, 255, 0.25));
  }
  50% {
    filter:
      drop-shadow(0 10px 34px rgba(37, 99, 235, 0.95))
      drop-shadow(0 0 22px rgba(180, 210, 255, 0.55))
      drop-shadow(0 0 50px rgba(37, 99, 235, 0.3));
  }
}

@keyframes logoGlowBurst {
  to {
    filter:
      drop-shadow(0 12px 40px rgba(37, 99, 235, 1))
      drop-shadow(0 0 30px rgba(180, 210, 255, 0.8))
      drop-shadow(0 0 60px rgba(37, 99, 235, 0.5));
  }
}

/* ============================================================
   MAIN — CHAT
   ============================================================ */

.chat-main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

/* ============================================================
   MESSAGES
   ============================================================ */

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 0 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.messages-area::-webkit-scrollbar {
  width: 6px;
}
.messages-area::-webkit-scrollbar-track {
  background: transparent;
}
.messages-area::-webkit-scrollbar-thumb {
  background: rgba(245, 200, 66, 0.2);
  border-radius: 3px;
}

/* Message row */
.message {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  animation: fadeSlideUp 0.3s ease forwards;
  opacity: 0;
}

.message-user {
  flex-direction: row-reverse;
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Avatar */
.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), #b8860b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  color: #0a0a0f;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.message-user .message-avatar {
  background: linear-gradient(135deg, var(--blue), #1e40af);
  color: #fff;
  font-size: 0.6rem;
}

/* Bubbles */
.message-bubble {
  max-width: 70%;
  padding: 12px 16px;
  border-radius: 18px;
  line-height: 1.6;
  font-size: 0.92rem;
}

.message-ai .message-bubble {
  background: var(--bg-ai-bubble);
  border: 1px solid var(--border-subtle);
  border-top-left-radius: 4px;
  color: var(--text-primary);
}

.message-user .message-bubble {
  background: var(--blue);
  border-top-right-radius: 4px;
  color: #fff;
}

.message-bubble p { margin: 0; }
.message-bubble p + p { margin-top: 8px; }
.message-bubble strong { color: var(--gold-light); }

.message-user .message-bubble strong {
  color: #d1e8ff;
}

/* ============================================================
   TYPING INDICATOR
   ============================================================ */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 8px;
  animation: fadeSlideUp 0.2s ease forwards;
  opacity: 0;
}

.typing-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-ai-bubble);
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: 18px;
  border-top-left-radius: 4px;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.4;
  animation: dotBounce 1.2s ease-in-out infinite;
}

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

@keyframes dotBounce {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  40% {
    transform: translateY(-7px);
    opacity: 1;
  }
}

/* ============================================================
   INPUT AREA
   ============================================================ */

.input-area {
  padding: 12px 0 16px;
  flex-shrink: 0;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: #1a1a2a;
  border: 1px solid rgba(245, 200, 66, 0.2);
  border-radius: 16px;
  padding: 10px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrapper:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245, 200, 66, 0.1), 0 0 20px rgba(245, 200, 66, 0.05);
  animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
  0%, 100% { box-shadow: 0 0 0 3px rgba(245, 200, 66, 0.1), 0 0 20px rgba(245, 200, 66, 0.05); }
  50%       { box-shadow: 0 0 0 3px rgba(245, 200, 66, 0.2), 0 0 30px rgba(245, 200, 66, 0.12); }
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
  resize: none;
  max-height: 140px;
  overflow-y: auto;
  font-family: inherit;
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-input::-webkit-scrollbar { width: 4px; }
.chat-input::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold), #d4a017);
  border: none;
  color: #0a0a0f;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.send-btn:hover {
  transform: scale(1.07);
  box-shadow: 0 4px 14px rgba(245, 200, 66, 0.4);
}

.send-btn:active {
  transform: scale(0.95);
}

.send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.input-hint {
  margin-top: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
}

.input-hint kbd {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: inherit;
  font-size: 0.68rem;
}

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  position: relative;
  height: 70px;
  flex-shrink: 0;
  background: var(--bg-header);
  border-top: 1px solid var(--border-subtle);
  overflow: hidden;
}

.footer-content {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 2px;
  pointer-events: none;
}

.footer-text {
  font-size: 0.73rem;
  color: var(--text-muted);
}

.footer-powered {
  font-size: 0.68rem;
  color: rgba(136, 136, 136, 0.7);
}

.footer-link {
  pointer-events: all;
  color: var(--gold);
  text-decoration: none;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-link:hover { opacity: 1; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
  .logo-img { height: 72px; }
  .site-header { height: 100px; }
  .site-footer { height: 60px; }
  .message-bubble { max-width: 85%; font-size: 0.88rem; }
  .chat-container { padding: 0 10px; }
  .input-hint { display: none; }
}
