/* Shared avatar-session UI — fetched/injected by shared/avatar-session.js */

/* Loader shown while a session is connecting */
.avatar-loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999999;
}

.avatar-loader-overlay.active {
  display: flex;
}

.avatar-loader-overlay .loader-content {
  text-align: center;
  color: white;
}

.avatar-loader-overlay .spinner {
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #d32f2f;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  animation: avatar-spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes avatar-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== Session Overlay (two-panel layout) ===== */
.session-overlay {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999998;
  font-family: Arial, sans-serif;
}

.session-overlay.active {
  display: flex;
}

/* Left: matches avatar dark background — 70% */
.session-left {
  width: 70%;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: #1e1e1e;
  position: relative;
  min-width: 0;
  border-right: 1px solid #333;
}

.session-left-title {
  padding: 1.5rem 2rem;
  color: #ffffff;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Avatar video container — centered in the left panel */
.session-avatar-wrap {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

#uneeqContainedLayout {
  width: 100%;
  height: 100%;
  position: relative;
  background: #1e1e1e;
}

/* UneeQ injects its video/iframe here — force it to fill the container */
#uneeqContainedLayout > * {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

.session-controls {
  padding: 1.5rem 2rem;
  display: flex;
  gap: 3rem;
  align-items: center;
  justify-content: center;
  background: #1e1e1e;
  border-top: 1px solid #333;
}

.session-ctrl-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: #374151;
  padding: 0;
}

.session-ctrl-btn .ctrl-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #2a2a2a;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.session-ctrl-btn .ctrl-circle svg {
  fill: #ffffff;
}

.session-ctrl-btn.active .ctrl-circle {
  background: #dc2626;
  border-color: rgba(255, 255, 255, 0.2);
}

.session-ctrl-btn.active .ctrl-circle svg {
  fill: #ffffff;
}

.session-ctrl-btn:hover,
.session-ctrl-btn:hover .ctrl-circle {
  background: unset;
}

.session-ctrl-btn .ctrl-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  text-align: center;
  white-space: nowrap;
}

/* Right: white chat panel — 30% */
.session-right {
  width: 30%;
  flex-shrink: 0;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #e5e7eb;
}

.session-chat-header {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
  background: #ffffff;
}

.session-chat-header .disclaimer {
  flex: 1;
  font-size: 0.8rem;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.session-chat-header .disclaimer svg {
  opacity: 0.5;
  fill: #6b7280;
}

.session-chat-header .end-btn {
  background: #dc2626;
  color: white;
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
  min-width: fit-content;
}

.session-chat-header .end-btn:hover {
  background: #b91c1c;
}

.session-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}

.session-msg {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.session-msg-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.session-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dc2626;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.session-msg-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #111827;
}

.session-msg-bubble {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0 12px 12px 12px;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #374151;
  line-height: 1.55;
  margin-left: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.session-msg.user .session-msg-bubble {
  background: #fef2f2;
  border-color: #fecaca;
  border-radius: 12px 12px 0 12px;
  margin-left: 0;
  margin-right: 0;
  align-self: flex-end;
  color: #374151;
}

.session-msg.user .session-msg-header {
  flex-direction: row-reverse;
}

.session-msg.user .session-msg-avatar {
  background: #6b7280;
}

.session-feedback-row {
  display: flex;
  gap: 0.4rem;
  margin-left: 2rem;
  margin-top: 0.1rem;
}

.session-feedback-btn {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: #9ca3af;
  font-size: 0.8rem;
  transition: background 0.15s;
}

.session-feedback-btn:hover {
  background: #e5e7eb;
}

.session-input-area {
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid #e5e7eb;
  flex-shrink: 0;
  background: #ffffff;
}

.session-input-label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.4rem;
  font-weight: 500;
}

.session-input-row {
  display: flex;
  align-items: center;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  padding: 0.15rem 0.15rem 0.15rem 0.9rem;
  gap: 0.5rem;
}

.session-input-row:focus-within {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.session-input-row input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #111827;
  font-size: 0.9rem;
  padding: 0.55rem 0;
}

.session-input-row input::placeholder {
  color: #9ca3af;
}

.session-send-btn {
  height: 34px;
  padding: 0 0.85rem;
  border-radius: 8px;
  background: #dc2626;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
  transition: background 0.2s;
  color: white;
  font-size: 0.82rem;
  font-weight: 600;
}

.session-send-btn:hover {
  background: #b91c1c;
}
