/* EmpathyQ Training UI — Brand Tokens */
:root {
  --eq-primary: #0D7377;
  --eq-primary-light: #14a3a8;
  --eq-primary-dark: #0a5c5f;
  --eq-secondary: #FF6B5B;
  --eq-text: #2D3436;
  --eq-bg: #F7F5F2;
  --eq-font-heading: 'Plus Jakarta Sans', system-ui, sans-serif;
  --eq-font-body: 'Inter', system-ui, sans-serif;
}

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

body {
  font-family: var(--eq-font-body);
  color: var(--eq-text);
  background: var(--eq-bg);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: white;
  border-bottom: 1px solid #e5e5e5;
}

.brand {
  font-family: var(--eq-font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--eq-text);
}

.brand-monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--eq-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  vertical-align: middle;
  margin-right: 0.4rem;
}

.status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #666;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ccc;
  transition: background 0.3s;
}

.status-dot.connected { background: #22c55e; }
.status-dot.error { background: #ef4444; }

.end-btn {
  padding: 0.4rem 1rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  background: white;
  font-size: 0.85rem;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
}

.end-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* 3-Column Layout */
.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 200px 1fr 340px;
  overflow: hidden;
}

/* Column 1: Agent */
.col-agent {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  gap: 1rem;
  border-right: 1px solid #e5e5e5;
  background: white;
}

.avatar-placeholder {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--eq-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--eq-font-heading);
  font-size: 1.5rem;
  font-weight: 700;
}

.agent-name {
  font-family: var(--eq-font-heading);
  font-weight: 600;
  font-size: 0.95rem;
}

.session-timer {
  font-size: 0.85rem;
  color: #999;
  font-variant-numeric: tabular-nums;
}

/* Column 2: Center / Mirror */
.col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
}

.mirror-area {
  width: 100%;
  max-width: 480px;
  aspect-ratio: 4 / 3;
  border-radius: 1rem;
  overflow: hidden;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mirror-placeholder {
  color: #666;
  font-size: 0.9rem;
}

.mirror-area video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

/* Controls bar — Google Meet style */
.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 480px;
  padding: 0.6rem 1rem;
  background: #202124;
  border-radius: 2rem;
}

.controls-left {
  display: flex;
  gap: 0.5rem;
}

.ctrl-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: #3c4043;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.ctrl-btn:hover { background: #4a4d51; }

/* ON state — white circle */
.ctrl-btn.on {
  background: white;
  color: #202124;
}

.ctrl-btn.on:hover { background: #e8eaed; }

/* OFF state — red circle */
.ctrl-btn.off {
  background: #ea4335;
  color: white;
}

.ctrl-btn.off:hover { background: #d33426; }

.ctrl-icon { font-size: 1.3rem; line-height: 1; }

/* End session — wide red pill */
.end-call-btn {
  padding: 0.6rem 1.5rem;
  border-radius: 1.5rem;
  border: none;
  background: #ea4335;
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--eq-font-body);
  cursor: pointer;
  transition: background 0.2s;
  letter-spacing: 0.02em;
}

.end-call-btn:hover { background: #d33426; }

/* Column 3: Transcript */
.col-transcript {
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e5e5e5;
  background: white;
}

.transcript-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Message bubbles */
.message {
  display: flex;
  flex-direction: column;
  max-width: 90%;
}

.message.user { align-self: flex-end; }
.message.agent { align-self: flex-start; }

.bubble {
  padding: 0.6rem 0.9rem;
  border-radius: 1rem;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.message.user .bubble {
  background: var(--eq-primary);
  color: white;
  border-bottom-right-radius: 0.25rem;
}

.message.agent .bubble {
  background: #f0f0f0;
  color: var(--eq-text);
  border-bottom-left-radius: 0.25rem;
}

.system-message {
  text-align: center;
  font-size: 0.8rem;
  color: #999;
  padding: 0.25rem 0;
}

.typing-indicator::after {
  content: '...';
  animation: blink 1s infinite;
}

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

/* Transcript input */
.transcript-input {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid #e5e5e5;
}

.transcript-input input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-family: var(--eq-font-body);
  outline: none;
  transition: border-color 0.2s;
}

.transcript-input input:focus { border-color: var(--eq-primary); }

.transcript-input button {
  padding: 0.5rem 1rem;
  background: var(--eq-primary);
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.transcript-input button:hover { background: var(--eq-primary-dark); }
.transcript-input button:disabled { opacity: 0.5; cursor: not-allowed; }

/* Mobile: tabbed layout */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }

  .col-agent { display: none; }
  .col-center { display: none; }

  .col-transcript {
    border-left: none;
  }
}
