/* ============================================
   NEPWORKBOT — Chat Interface
   ============================================ */

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

:root {
  --bg: #0A0A0A;
  --bg-card: #151515;
  --bg-user: #1a1f12;
  --text: #E8E8E8;
  --text-bright: #FFFFFF;
  --accent: #BFFF00;
  --muted: #6B6B6B;
  --border: #2A2A2A;
  --font-body: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'Space Mono', 'Courier New', monospace;
}

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Header ── */
.coach-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.coach-wordmark {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
}

.coach-wordmark:hover {
  text-decoration: none;
  opacity: 0.85;
}

.coach-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.coach-nav-link {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s ease;
}

.coach-nav-link:hover {
  color: var(--text);
  text-decoration: none;
}

.coach-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.coach-new-chat {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.coach-new-chat:hover {
  color: var(--text);
  border-color: var(--muted);
}

.coach-new-chat[hidden] {
  display: none;
}

/* ── Main chat area ── */
.coach-main {
  flex: 1;
  overflow-y: auto;
  padding: 0 20px;
  scroll-behavior: smooth;
}

/* ── Welcome state ── */
.coach-welcome {
  max-width: 560px;
  margin: 0 auto;
  padding: 80px 0 40px;
  text-align: center;
}

.coach-label {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 5px;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}

.coach-welcome h1 {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 16px;
  line-height: 1.2;
}

.coach-welcome p {
  font-size: 16px;
  color: var(--muted);
  margin-bottom: 40px;
  line-height: 1.6;
}

.starter-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 400px;
  margin: 0 auto;
}

.starter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  padding: 14px 20px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1.4;
}

.starter-btn:hover {
  border-color: var(--accent);
  color: var(--text-bright);
}

/* ── Messages ── */
.coach-messages {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 0 24px;
}

.message {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.message-label {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.message-user .message-label {
  color: var(--muted);
  text-align: right;
}

.message-assistant .message-label {
  color: var(--accent);
}

.message-content {
  font-size: 16px;
  line-height: 1.65;
  padding: 16px 20px;
}

.message-user .message-content {
  background: var(--bg-user);
  border: 1px solid #2a3318;
  color: var(--text);
  margin-left: 48px;
}

.message-assistant .message-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  margin-right: 48px;
}

.message-content p {
  margin-bottom: 12px;
}

.message-content p:last-child {
  margin-bottom: 0;
}

/* Typing indicator */
.typing-indicator {
  display: inline-flex;
  gap: 4px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  margin-right: 48px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--muted);
  border-radius: 50%;
  animation: typing-bounce 1.2s ease-in-out infinite;
}

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

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-4px); opacity: 1; }
}

/* Streaming cursor */
.streaming .message-content::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* ── Input area ── */
.coach-input-area {
  flex-shrink: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.coach-form {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.coach-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  padding: 12px 16px;
  resize: none;
  max-height: 150px;
  overflow-y: auto;
  transition: border-color 0.2s ease;
}

.coach-input:focus {
  outline: none;
  border-color: var(--accent);
}

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

.coach-download {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  align-self: center;
  transition: all 0.2s ease;
}

.coach-download:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.coach-download[hidden] {
  display: none;
}

.coach-send {
  background: var(--accent);
  border: none;
  color: var(--bg);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.coach-send:hover:not(:disabled) {
  opacity: 0.85;
}

.coach-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.coach-disclaimer {
  max-width: 680px;
  margin: 8px auto 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

/* ── Resume prompt ── */
.resume-prompt {
  max-width: 400px;
  margin: 80px auto 0;
  text-align: center;
}

.resume-prompt p {
  font-size: 16px;
  color: var(--text);
  margin-bottom: 20px;
}

.resume-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Error state ── */
.message-error .message-content {
  background: rgba(255, 68, 68, 0.08);
  border-color: #FF4444;
  color: #FF8888;
  margin-right: 48px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .coach-welcome {
    padding: 48px 0 32px;
  }

  .coach-welcome h1 {
    font-size: 26px;
  }

  .message-user .message-content {
    margin-left: 24px;
  }

  .message-assistant .message-content,
  .typing-indicator {
    margin-right: 24px;
  }
}

@media (max-width: 480px) {
  .coach-header {
    padding: 0 16px;
  }

  .coach-main {
    padding: 0 16px;
  }

  .coach-input-area {
    padding: 10px 16px 14px;
  }

  .coach-welcome h1 {
    font-size: 24px;
  }

  .starter-btn {
    font-size: 14px;
    padding: 12px 16px;
  }

  .message-user .message-content {
    margin-left: 12px;
  }

  .message-assistant .message-content,
  .typing-indicator {
    margin-right: 12px;
  }

  .message-content {
    padding: 12px 16px;
    font-size: 15px;
  }

  .coach-nav {
    display: none;
  }
}
