/* Agent - House | AI Agents Page Styles
   Dark Mode: Holographic Voice Stage & 4 Luminous Agent Cards (Design 1)
   Light Mode: Precision Orbital Radar Wheel & Hard-Bordered Inspector (Design 2)
*/

.agents-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  align-items: flex-end;
  padding: 28px 32px;
  margin-bottom: 22px;
  border: 1px solid var(--border-strong);
  box-shadow: var(--card-shadow);
}

html[data-theme="light"] .agents-banner {
  border-width: 2px;
  box-shadow: 6px 6px 0 #0F172A;
}

.agents-banner img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.55) contrast(1.06);
}

.agents-banner-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  color: #F8FAFC;
}

.agents-banner-inner h1 {
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 850;
  letter-spacing: -0.03em;
  line-height: 1.06;
  margin: 8px 0 4px;
}

.agents-banner-inner p {
  font-size: 15px;
  color: #CBD5E1;
}

.lang-switch {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  border-radius: 10px;
  background: rgba(5, 8, 17, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.lang-btn {
  border: 0;
  background: transparent;
  color: #CBD5E1;
  padding: 7px 13px;
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.lang-btn.active {
  background: #38BDF8;
  color: #04121D;
}

/* Main Stage Grid */
.agents-workspace {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: center;
  margin-bottom: 24px;
}

/* Dark Mode: 4 Luminous Cards */
.orb-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

html[data-theme="light"] .orb-cards-grid {
  display: none;
}

.agent-card {
  position: relative;
  border-radius: 18px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--card-shadow);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, background-color 0.18s;
}

.agent-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-strong);
}

.agent-card.active {
  border-color: #38BDF8;
  background: rgba(14, 165, 233, 0.14);
}

.agent-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.orb-badge {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 850;
  font-size: 17px;
}

.orb-badge .orb-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  pointer-events: none;
}

.orb-sami { background: rgba(16, 185, 129, 0.18); color: #34D399; border: 2px solid #10B981; }
.orb-nour { background: rgba(56, 189, 248, 0.18); color: #38BDF8; border: 2px solid #38BDF8; }
.orb-omar { background: rgba(129, 140, 248, 0.18); color: #A5B4FC; border: 2px solid #818CF8; }
.orb-layla { background: rgba(245, 158, 11, 0.18); color: #FBBF24; border: 2px solid #F59E0B; }

.voice-tag {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  color: #34D399;
}

.agent-card h2 {
  font-size: 20px;
  font-weight: 800;
}

.agent-card p.agent-spec {
  font-size: 12.5px;
  color: var(--muted);
}

.agent-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.card-preview-btn {
  flex: 1;
  border-radius: 9px;
  padding: 8px 10px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #CBD5E1;
  cursor: pointer;
}

.card-launch-btn {
  flex: 1.4;
  border-radius: 9px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 800;
  border: 0;
  background: var(--cta-bg);
  color: #04121D;
  cursor: pointer;
}

/* Light Mode: Orbital Radar Stage (Design 2) */
.radar-panel {
  display: none;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
}

html[data-theme="light"] .radar-panel {
  display: flex;
}

.radar-stage {
  position: relative;
  width: min(410px, 84vw);
  aspect-ratio: 1;
  background: #0F172A;
  border-radius: 50%;
  border: 2.5px solid #0F172A;
  box-shadow: 0 22px 54px rgba(29, 78, 216, 0.24);
  display: grid;
  place-items: center;
}

.radar-core {
  width: 34%;
  height: 34%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #38BDF8;
  position: relative;
  z-index: 3;
}

.radar-core img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.orbit-node {
  position: absolute;
  z-index: 4;
  background: #FFFFFF;
  color: #0F172A;
  border: 2px solid #0F172A;
  box-shadow: 3px 3px 0 #2563EB;
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s, color 0.16s;
}

.orbit-node.active {
  background: #2563EB;
  color: #FFFFFF;
  box-shadow: 3px 3px 0 #10B981;
}

.on-top { top: 14px; left: 50%; transform: translateX(-50%); }
.on-right { right: -14px; top: 50%; transform: translateY(-50%); }
.on-bottom { bottom: 14px; left: 50%; transform: translateX(-50%); }
.on-left { left: -14px; top: 50%; transform: translateY(-50%); }

/* Agent Live Stage / Inspector Panel (shared visual focus in both modes) */
.agent-inspector {
  border-radius: 20px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
}

html[data-theme="dark"] .agent-inspector {
  background: var(--surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-strong);
  box-shadow: var(--card-shadow);
}

html[data-theme="light"] .agent-inspector {
  background: #F8FAFC;
  border: 2px solid #0F172A;
  box-shadow: 6px 6px 0 #0F172A;
}

.insp-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.insp-name {
  font-size: clamp(26px, 2.8vw, 34px);
  font-weight: 850;
  letter-spacing: -0.025em;
  line-height: 1.1;
}

.insp-role {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
}

.insp-quote {
  border-radius: 14px;
  padding: 18px;
  font-size: 16px;
  font-weight: 500;
  min-height: 92px;
}

html[data-theme="dark"] .insp-quote {
  background: rgba(5, 8, 17, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.25);
  color: #E2E8F0;
}

html[data-theme="light"] .insp-quote {
  background: #FFFFFF;
  border: 1.5px solid #0F172A;
  color: #0F172A;
}

.quick-launch-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.mini-agent-btn {
  padding: 9px 10px;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-hi);
  color: var(--ink);
}

html[data-theme="light"] .mini-agent-btn {
  border: 1.5px solid #0F172A;
  background: #FFFFFF;
}

.mini-agent-btn:hover {
  border-color: var(--accent-strong);
}

/* ============================================================
   REAL CHAT & VOICE MODAL (<dialog id="agent-dialog">)
   Top-layer animation per Modern Web Guidance
   ============================================================ */
dialog#agent-dialog {
  margin: auto;
  width: min(740px, calc(100vw - 24px));
  max-height: min(88vh, 820px);
  border-radius: 20px;
  padding: 0;
  overflow: auto;
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  dialog#agent-dialog {
    transform: scale(0.96);
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog#agent-dialog {
    transition-duration: 0.1s;
  }
}

dialog#agent-dialog[open] {
  opacity: 1;
}

@starting-style {
  dialog#agent-dialog[open] {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  dialog#agent-dialog[open] {
    transform: scale(1);
  }

  @starting-style {
    dialog#agent-dialog[open] {
      transform: scale(0.96);
    }
  }
}

html[data-theme="dark"] dialog#agent-dialog {
  background: #0B1220;
  color: #F8FAFC;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.72);
}

html[data-theme="light"] dialog#agent-dialog {
  background: #FFFFFF;
  color: #0F172A;
  border: 2.5px solid #0F172A;
  box-shadow: 8px 8px 0 #0F172A;
}

dialog#agent-dialog::backdrop {
  background-color: rgba(5, 8, 17, 0);
  transition-property: background-color, display, overlay;
  transition-duration: 0.24s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog#agent-dialog[open]::backdrop {
  background-color: rgba(5, 8, 17, 0.72);
}

@starting-style {
  dialog#agent-dialog[open]::backdrop {
    background-color: rgba(5, 8, 17, 0);
  }
}

.dialog-shell {
  padding: 24px;
  display: grid;
  gap: 14px;
}

.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
}

.dialog-heading h2 {
  font-size: 26px;
  font-weight: 850;
  margin-top: 2px;
}

.close-dialog {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface-hi);
  color: var(--ink);
}

.dialog-notice,
.chat-pending {
  font-size: 12px;
  color: var(--muted);
}

.agent-greeting {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  border-left: 3px solid var(--accent);
  background: var(--surface-hi);
}

#chat-suggestions summary {
  cursor: pointer;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 8px;
}

.sample-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.sample-prompts button {
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-hi);
  border: 1px solid var(--border);
  color: var(--ink);
  text-align: left;
}

.chat-history {
  display: grid;
  gap: 10px;
  max-height: 250px;
  overflow-y: auto;
}

.chat-message {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
}

.chat-message strong {
  display: block;
  font-family: var(--mono);
  font-size: 11px;
  margin-bottom: 4px;
  color: var(--accent);
}

.chat-message.user {
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.chat-message.assistant {
  background: var(--surface-hi);
  border: 1px solid var(--border);
}

.chat-status {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent-2);
  min-height: 18px;
}

.voice-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-hi);
  border: 1px solid var(--border);
}

.voice-controls select {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  font-size: 12.5px;
}

#voice-start {
  padding: 9px 14px;
  border-radius: 9px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  background: var(--cta-bg);
  color: var(--cta-ink);
  border: 1.5px solid var(--border);
}

#voice-status {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--accent-2);
}

#chat-form {
  display: grid;
  gap: 8px;
}

#chat-form label {
  font-size: 13px;
  font-weight: 700;
}

#chat-message {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  font-family: inherit;
  font-size: 14px;
  resize: vertical;
  background: var(--bg);
  color: var(--ink);
  border: 1.5px solid var(--border);
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#chat-remaining {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

#chat-send {
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  background: var(--cta-bg);
  color: var(--cta-ink);
  border: 1.5px solid var(--border);
}

@media (max-width: 980px) {
  .agents-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .orb-cards-grid {
    grid-template-columns: 1fr;
  }

  .quick-launch-row {
    grid-template-columns: 1fr 1fr;
  }

  .on-left {
    left: 6px;
  }

  .on-right {
    right: 6px;
  }
}
