/*
Theme Name: EYEEA Chat Theme
Theme URI: https://www.eyeaapp.com
Author: EYEA
Description: Custom WordPress theme for the EYEA chat interface.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: eyeea-chat-theme
*/

:root {
  --bg-a: #edf2ea;
  --bg-b: #dfe7dc;
  --panel: #f4f5f4;
  --ink: #10201a;
  --muted: #4e5e56;
  --accent: #3a7a4d;
  --accent-2: #245535;
  --line: #c9d2c5;
  --tag-ink: #253a32;
  --tag-bg-1: #d9e9dd;
  --tag-br-1: #b8d0bf;
  --tag-bg-2: #dbece5;
  --tag-br-2: #bdd7cb;
  --input-bg: #f4f5f4;
  --msg-user: #bed7c3;
  --msg-ai: #d9dfda;
  --food-bg: #ecf1ed;
  --ascii-bg: #f1f3f0;
  --ascii-ink: #1a2420;
  --btn-grad-a: #3f8653;
  --btn-grad-b: #255737;
}

body.dark-theme {
  --bg-a: #060611;
  --bg-b: #0e1235;
  --panel: rgba(7, 10, 28, 0.76);
  --ink: #f4f5ff;
  --muted: #b4b9df;
  --accent: #ff2ec6;
  --accent-2: #26c4ff;
  --line: rgba(146, 164, 255, 0.35);
  --tag-ink: #ffe6fb;
  --tag-bg-1: rgba(255, 46, 198, 0.2);
  --tag-br-1: rgba(255, 46, 198, 0.45);
  --tag-bg-2: rgba(38, 196, 255, 0.16);
  --tag-br-2: rgba(38, 196, 255, 0.5);
  --input-bg: rgba(10, 14, 35, 0.82);
  --msg-user: linear-gradient(145deg, rgba(255, 46, 198, 0.28), rgba(140, 68, 255, 0.23));
  --msg-ai: rgba(35, 43, 88, 0.72);
  --food-bg: rgba(11, 15, 42, 0.7);
  --ascii-bg: rgba(4, 7, 21, 0.85);
  --ascii-ink: #f3f6ff;
  --btn-grad-a: #26c4ff;
  --btn-grad-b: #ff2ec6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at 14% 10%, rgba(255, 46, 198, 0.25), transparent 35%),
              radial-gradient(circle at 85% 78%, rgba(38, 196, 255, 0.22), transparent 36%),
              linear-gradient(145deg, var(--bg-a), var(--bg-b));
  min-height: 100vh;
  position: relative;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: none;
  background-size: cover;
  background-position: center;
  opacity: 0.2;
  mix-blend-mode: screen;
  pointer-events: none;
  z-index: -1;
}

body.no-art::before {
  opacity: 0;
}

.app {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 18px 40px;
}

.site-footer {
  text-align: center;
  padding: 10px 12px 16px;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.hero h1 {
  margin: 8px 0;
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  text-shadow: 0 0 22px rgba(255, 46, 198, 0.32);
}

.brand-row {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  display: block;
}

.brand {
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tag-ink);
  margin: 0;
}

.codex-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--tag-ink);
  background: var(--tag-bg-1);
  border: 1px solid var(--tag-br-1);
  border-radius: 999px;
  padding: 4px 8px;
}

.proto-tag {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--tag-ink);
  background: var(--tag-bg-2);
  border: 1px solid var(--tag-br-2);
  border-radius: 999px;
  padding: 4px 8px;
}

.art-toggle {
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #e9edff;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 4px 8px;
  cursor: pointer;
}

.sub {
  margin: 0;
  color: var(--muted);
}

.chat-shell {
  margin-top: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(7px);
}

.status {
  font-size: 0.88rem;
  color: var(--muted);
  padding: 4px 6px 10px;
}

.messages {
  height: 55vh;
  min-height: 320px;
  overflow-y: auto;
  padding: 8px;
  display: grid;
  gap: 10px;
}

.msg {
  padding: 10px 12px;
  border-radius: 12px;
  max-width: 85%;
  line-height: 1.4;
  white-space: pre-wrap;
}

.msg.typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 92px;
}

.typing-label {
  font-weight: 600;
  opacity: 0.9;
}

.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.25;
  animation: dotPulse 1s infinite ease-in-out;
}

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

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

.user {
  margin-left: auto;
  background: var(--msg-user);
  border: 1px solid var(--line);
}

.ai {
  background: var(--msg-ai);
  border: 1px solid var(--line);
}

.chat-form {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.food-lab {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: var(--food-bg);
}

.food-head {
  margin-bottom: 8px;
}

.food-title {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.food-sub {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.food-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.food-controls input[type="file"] {
  max-width: 100%;
  padding: 8px;
}

.ascii-output {
  margin: 0;
  padding: 10px;
  overflow: auto;
  max-height: 280px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ascii-bg);
  color: var(--ascii-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 8px;
  line-height: 8px;
}

.ascii-canvas {
  width: 100%;
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ascii-bg);
}

input, button {
  font: inherit;
}

input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: var(--input-bg);
  color: var(--ink);
}

button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--btn-grad-a), var(--btn-grad-b));
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}

body.dark-theme #send {
  background: linear-gradient(180deg, var(--btn-grad-b), var(--btn-grad-a));
}

button:disabled {
  opacity: 0.7;
  cursor: wait;
}

@media (max-width: 640px) {
  .brand-logo {
    width: 30px;
    height: 30px;
  }

  .messages {
    height: 50vh;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .food-controls {
    flex-direction: column;
  }

  button {
    padding: 12px;
  }
}
