/* ============================================
   AI HELPER STYLES
   ============================================ */

/* ── Progress bar ── */
.aih-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255,255,255,0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 16px;
}
.aih-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
  width: 0%;
}
@keyframes aih-spin {
  to { transform: rotate(360deg); }
}

/* ── Results grid ── */
.aih-results-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.aih-result-field {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
}
.aih-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.aih-result-label {
  font-family: var(--mono);
  font-size: 0.625rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  font-weight: 600;
}
.aih-result-value {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--mid);
  line-height: 1.6;
}

/* ── Checkbox ── */
.aih-result-check {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.aih-result-check input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.aih-check-mark {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-mid);
  border-radius: 3px;
  background: transparent;
  display: inline-block;
  position: relative;
  transition: all 0.15s;
}
.aih-result-check input:checked + .aih-check-mark {
  background: var(--accent);
  border-color: var(--accent);
}
.aih-result-check input:checked + .aih-check-mark::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid var(--bg);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ── Tags ── */
.aih-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  background: rgba(255,215,0,0.1);
  color: var(--accent);
  padding: 3px 10px;
  margin: 2px 4px 2px 0;
  border-radius: 3px;
}

/* ── Voice chat container ── */
.aih-voice-chat {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

/* ── Chat messages ── */
.aih-chat-messages {
  max-height: 400px;
  min-height: 200px;
  overflow-y: auto;
  padding: 16px;
  background: rgba(0,0,0,0.15);
}
.aih-chat-placeholder {
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  padding: 60px 20px;
  line-height: 1.6;
}
.aih-chat-msg {
  margin-bottom: 16px;
}
.aih-chat-msg:last-child {
  margin-bottom: 0;
}
.aih-chat-label {
  font-family: var(--mono);
  font-size: 0.5625rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 4px;
}
.aih-chat-text {
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--mid);
}
.aih-chat-user .aih-chat-text {
  color: var(--white);
  background: rgba(255,215,0,0.06);
  border-left: 2px solid var(--accent);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
}
.aih-chat-assistant .aih-chat-text {
  background: rgba(255,255,255,0.03);
  border-left: 2px solid rgba(255,255,255,0.15);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
}
.aih-chat-assistant .aih-chat-label {
  color: var(--accent);
}

/* ── Typing dots ── */
.aih-typing-dots span {
  animation: aih-blink 1.4s infinite;
  font-size: 1.25rem;
  line-height: 1;
}
.aih-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.aih-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aih-blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

/* ── Input area ── */
.aih-chat-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.08);
}
.aih-text-input {
  flex: 1;
  font-family: var(--sans);
  font-size: 0.875rem;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  color: var(--white);
  padding: 10px 14px;
  border-radius: 6px;
  outline: none;
  transition: border-color 0.15s;
}
.aih-text-input:focus {
  border-color: var(--accent);
}
.aih-text-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Mic button ── */
.aih-mic-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid var(--border-mid);
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.aih-mic-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.aih-mic-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.aih-mic-btn.aih-mic-active {
  border-color: #ff4444;
  color: #ff4444;
  background: rgba(255,68,68,0.1);
  animation: aih-pulse 1.5s ease infinite;
}
@keyframes aih-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,68,68,0.3); }
  50% { box-shadow: 0 0 0 8px rgba(255,68,68,0); }
}

/* ── Send button ── */
.aih-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.aih-send-btn:hover:not(:disabled) {
  background: var(--accent);
  color: var(--bg);
}
.aih-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Voice controls ── */
.aih-voice-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

/* ── Status dot ── */
.aih-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
  transition: background 0.2s;
}
.aih-status-dot.aih-status-active {
  background: #4caf50;
}
.aih-status-dot.aih-status-listening {
  background: #ff4444;
  animation: aih-pulse-dot 1s ease infinite;
}
@keyframes aih-pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .aih-chat-input-area {
    padding: 8px 12px;
  }
  .aih-voice-controls {
    flex-wrap: wrap;
    gap: 8px;
  }
  .aih-chat-messages {
    min-height: 160px;
    max-height: 300px;
  }
}
