/* AI Chat Tester — style.css v2.0.0 */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600&family=Syne:wght@700;800&display=swap');

.aict-widget.aict-theme-dark {
  --bg:       #0d0d14;
  --surface:  #13131e;
  --surface2: #1a1a28;
  --border:   #272738;
  --accent:   #7c6aff;
  --accent2:  #00d4aa;
  --accent3:  #ff5f5f;
  --text:     #e4e4f0;
  --muted:    #5a5a78;
  --user-bg:  #1c183a;
  --user-bd:  #2e2858;
  --ai-bg:    #0e1a26;
  --ai-bd:    #112233;
  --err-bg:   #1c0a0a;
  --err-bd:   #3d1515;
  --err-text: #ff5f5f;
}

.aict-widget.aict-theme-light {
  --bg:       #f5f5fa;
  --surface:  #ffffff;
  --surface2: #ededf5;
  --border:   #d8d8e8;
  --accent:   #6352e8;
  --accent2:  #00a88a;
  --accent3:  #d63030;
  --text:     #1a1a30;
  --muted:    #8080a0;
  --user-bg:  #ece8ff;
  --user-bd:  #c4b8ff;
  --ai-bg:    #e6f5f1;
  --ai-bd:    #b3ddd4;
  --err-bg:   #fff0f0;
  --err-bd:   #ffcccc;
  --err-text: #d63030;
}

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

.aict-widget {
  font-family:'JetBrains Mono','Courier New',monospace;
  font-size:13px;
  background:var(--bg);
  color:var(--text);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border-radius:14px;
  border:1px solid var(--border);
  position:relative;
}

/* TOPBAR */
.aict-topbar {
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 16px; background:var(--surface);
  border-bottom:1px solid var(--border); flex-shrink:0; gap:10px;
}
.aict-topbar-left { display:flex; align-items:center; gap:10px; min-width:0; }

.aict-logo-dot {
  width:9px; height:9px; border-radius:50%;
  background:var(--accent2); box-shadow:0 0 7px var(--accent2);
  flex-shrink:0; animation:aictPulse 2.4s ease-in-out infinite;
}
@keyframes aictPulse {
  0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.3;transform:scale(.85)}
}

.aict-model-info { display:flex; flex-direction:column; gap:1px; min-width:0; }
.aict-provider-name {
  font-family:'Syne',sans-serif; font-weight:800; font-size:13.5px;
  color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
.aict-model-name {
  font-size:10.5px; color:var(--muted); white-space:nowrap;
  overflow:hidden; text-overflow:ellipsis;
}
.aict-topbar-actions { display:flex; gap:6px; flex-shrink:0; }
.aict-icon-btn {
  background:var(--surface2); border:1px solid var(--border);
  border-radius:7px; color:var(--muted); cursor:pointer;
  font-size:13px; padding:6px 9px; line-height:1;
  transition:border-color .18s, color .18s;
}
.aict-icon-btn:hover { border-color:var(--accent); color:var(--text); }

/* MESSAGES */
.aict-messages {
  flex:1; overflow-y:auto; padding:16px;
  display:flex; flex-direction:column; gap:12px;
}
.aict-messages::-webkit-scrollbar { width:4px; }
.aict-messages::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }

.aict-empty-state {
  display:flex; flex-direction:column; align-items:center;
  justify-content:center; gap:8px; color:var(--muted);
  text-align:center; padding:30px 20px; flex:1; min-height:160px;
}
.aict-empty-icon { font-size:32px; opacity:.25; }
.aict-empty-state h3 {
  font-family:'Syne',sans-serif; font-size:15px; font-weight:700;
  color:var(--text); opacity:.35; margin:0;
}
.aict-empty-state p { font-size:11.5px; max-width:240px; line-height:1.6; margin:0; }

.aict-msg { display:flex; flex-direction:column; gap:4px; animation:aictMsgIn .22s ease; }
@keyframes aictMsgIn { from{opacity:0;transform:translateY(7px)} to{opacity:1;transform:translateY(0)} }

.aict-msg-meta { display:flex; align-items:center; gap:7px; font-size:9.5px; color:var(--muted); }
.aict-msg.aict-user .aict-msg-meta { flex-direction:row-reverse; }
.aict-msg-role { font-weight:700; font-size:9px; letter-spacing:1.5px; text-transform:uppercase; }
.aict-msg.aict-user      .aict-msg-role { color:var(--accent); }
.aict-msg.aict-assistant .aict-msg-role { color:var(--accent2); }
.aict-msg.aict-error     .aict-msg-role { color:var(--accent3); }

.aict-bubble {
  padding:11px 14px; border-radius:11px; font-size:13px;
  line-height:1.65; white-space:pre-wrap; word-break:break-word; max-width:88%;
}
.aict-msg.aict-user { align-items:flex-end; }
.aict-msg.aict-user .aict-bubble {
  background:var(--user-bg); border:1px solid var(--user-bd); border-bottom-right-radius:3px;
}
.aict-msg.aict-assistant .aict-bubble {
  background:var(--ai-bg); border:1px solid var(--ai-bd); border-bottom-left-radius:3px;
}
.aict-msg.aict-error .aict-bubble {
  background:var(--err-bg); border:1px solid var(--err-bd); color:var(--err-text);
}
.aict-msg.aict-sysinfo .aict-bubble {
  background:transparent; border:1px dashed var(--border); color:var(--muted);
  font-size:11px; max-width:100%; text-align:center; margin:0 auto;
}

.aict-typing-dots { display:flex; gap:4px; align-items:center; padding:2px; }
.aict-typing-dot {
  width:6px; height:6px; border-radius:50%; background:var(--accent2);
  animation:aictBlink 1.2s ease-in-out infinite;
}
.aict-typing-dot:nth-child(2){animation-delay:.2s}
.aict-typing-dot:nth-child(3){animation-delay:.4s}
@keyframes aictBlink {
  0%,80%,100%{opacity:.15;transform:scale(.75)} 40%{opacity:1;transform:scale(1)}
}

/* INPUT */
.aict-input-area {
  border-top:1px solid var(--border); padding:12px 14px;
  background:var(--surface); display:flex; flex-direction:column;
  gap:7px; flex-shrink:0;
}
.aict-input-row { display:flex; gap:8px; align-items:flex-end; }
.aict-user-input {
  flex:1 !important; width:auto !important;
  background:var(--surface2) !important; border:1px solid var(--border) !important;
  border-radius:10px !important; color:var(--text) !important;
  font-family:'JetBrains Mono',monospace !important; font-size:13px !important;
  padding:10px 13px !important; outline:none !important; resize:none !important;
  min-height:42px !important; max-height:120px !important;
  line-height:1.5 !important; transition:border-color .18s !important;
}
.aict-user-input:focus { border-color:var(--accent) !important; }

.aict-send-btn {
  background:linear-gradient(135deg,var(--accent) 0%,#5040c8 100%);
  border:none; border-radius:10px; color:#fff; cursor:pointer;
  font-size:16px; width:42px; height:42px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  transition:opacity .18s, transform .1s;
}
.aict-send-btn:hover  { opacity:.88; }
.aict-send-btn:active { transform:scale(.94); }
.aict-send-btn:disabled { opacity:.38; cursor:not-allowed; }

.aict-input-hints { font-size:9.5px; color:var(--muted); display:flex; align-items:center; gap:10px; }
.aict-widget kbd {
  background:var(--surface2); border:1px solid var(--border);
  border-radius:3px; padding:1px 5px; font-size:9px;
  font-family:'JetBrains Mono',monospace;
}
.aict-token-info { margin-left:auto; }

/* RAW MODAL */
.aict-raw-modal {
  position:absolute; inset:0; background:rgba(0,0,0,.88);
  z-index:30; padding:20px; border-radius:14px; overflow:auto;
}
.aict-raw-inner {
  background:var(--surface); border:1px solid var(--border);
  border-radius:10px; overflow:hidden; display:flex;
  flex-direction:column; max-height:100%;
}
.aict-raw-header {
  padding:12px 16px; border-bottom:1px solid var(--border);
  display:flex; justify-content:space-between; align-items:center;
  font-family:'Syne',sans-serif; font-weight:700; font-size:13px;
}
.aict-raw-close {
  background:none; border:none; color:var(--muted);
  cursor:pointer; font-size:16px; padding:2px 6px; border-radius:4px;
}
.aict-raw-close:hover { color:var(--text); }
.aict-raw-content {
  padding:14px 16px; font-size:11px; line-height:1.6;
  color:var(--accent2); white-space:pre-wrap; word-break:break-all;
  overflow-y:auto; max-height:380px; margin:0;
}
