/* ============================================================
   SignalMatrix AI — Agent Suite CSS (WordPress)
   ============================================================ */

/* ── AGENT PAGE VARIABLES ─────────────────────────────────── */
.page-template-page-agents {
  --ag-bg-primary:   #050508;
  --ag-bg-surface:   #0c0c14;
  --ag-bg-card:      #111120;
  --ag-bg-card-hover:#161628;
  --ag-border:       rgba(255,255,255,0.06);
  --ag-border-hover: rgba(255,255,255,0.12);
  --ag-text-primary: #e8e8f4;
  --ag-text-secondary:#8888a8;
  --ag-text-muted:   #55556a;
  --ag-green:        #00ff88;
  --ag-radius:       14px;
  --ag-radius-sm:    8px;
  --ag-shadow-card:  0 4px 24px rgba(0,0,0,0.4);
}

/* Map to generic names used in templates */
.page-template-page-agents {
  --bg-primary:   var(--ag-bg-primary);
  --bg-surface:   var(--ag-bg-surface);
  --bg-card:      var(--ag-bg-card);
  --bg-card-hover:var(--ag-bg-card-hover);
  --border:       var(--ag-border);
  --border-hover: var(--ag-border-hover);
  --text-primary: var(--ag-text-primary);
  --text-secondary:var(--ag-text-secondary);
  --text-muted:   var(--ag-text-muted);
  --green:        var(--ag-green);
  --radius:       var(--ag-radius);
  --radius-sm:    var(--ag-radius-sm);
  --shadow-card:  var(--ag-shadow-card);
}

/* ── HERO ────────────────────────────────────────────────────── */
.ag-hero {
  position: relative;
  overflow: hidden;
  padding: 140px 24px 80px;
  text-align: center;
  background: var(--bg-primary);
}

.ag-hero-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ag-hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.12;
}

.ag-hero-blob-1 {
  width: 600px; height: 600px;
  background: var(--green);
  top: -200px; left: -150px;
  animation: ag-blob-drift 12s ease-in-out infinite alternate;
}

.ag-hero-blob-2 {
  width: 400px; height: 400px;
  background: #7c3aed;
  top: -100px; right: -100px;
  animation: ag-blob-drift 16s ease-in-out infinite alternate-reverse;
}

.ag-hero-blob-3 {
  width: 300px; height: 300px;
  background: #3b82f6;
  bottom: -100px; left: 40%;
  animation: ag-blob-drift 10s ease-in-out infinite alternate;
}

@keyframes ag-blob-drift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(30px,20px) scale(1.08); }
}

.ag-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,255,136,0.08);
  border: 1px solid rgba(0,255,136,0.2);
  color: var(--green);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 24px;
}

.ag-logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
  animation: ag-pulse-dot 2s ease-in-out infinite;
}

@keyframes ag-pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.8); }
}

.ag-hero h1 {
  font-size: clamp(36px, 6vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.ag-hero h1 .highlight {
  background: linear-gradient(135deg, var(--green) 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.ag-hero-sub {
  font-size: clamp(16px, 2vw, 20px);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.ag-hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 60px;
}

.ag-btn-primary {
  background: var(--green);
  color: #050508;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 28px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.ag-btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,255,136,0.25); color: #050508; }

.ag-btn-outline {
  background: transparent;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 15px;
  padding: 13px 28px;
  border-radius: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.ag-btn-outline:hover { border-color: var(--border-hover); background: rgba(255,255,255,0.03); color: var(--text-primary); }

/* ── STATS BAR ───────────────────────────────────────────────── */
.ag-stats-bar {
  display: flex;
  justify-content: center;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 700px;
  margin: 0 auto;
}

.ag-stat-item {
  flex: 1;
  text-align: center;
  padding: 20px 16px;
  border-right: 1px solid var(--border);
}
.ag-stat-item:last-child { border-right: none; }

.ag-stat-num {
  font-size: 28px;
  font-weight: 800;
  color: var(--green);
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 4px;
}

.ag-stat-lbl {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── CONTAINER ───────────────────────────────────────────────── */
.ag-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── SECTION ─────────────────────────────────────────────────── */
.ag-section {
  padding: 80px 0;
  background: var(--bg-primary);
}

.ag-section-title {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.ag-section-sub {
  color: var(--text-secondary);
  font-size: 16px;
  margin-bottom: 48px;
}

/* ── CATEGORY FILTER TABS ────────────────────────────────────── */
.ag-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.ag-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.ag-tab:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.ag-tab.active {
  background: rgba(0,255,136,0.1);
  border-color: rgba(0,255,136,0.3);
  color: var(--green);
}

.ag-tab-count {
  background: rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
}

/* ── AGENT GRID ──────────────────────────────────────────────── */
.ag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* ── AGENT CARD ──────────────────────────────────────────────── */
.ag-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-decoration: none;
  color: inherit;
}

.ag-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--card-color, var(--green));
  opacity: 0;
  transition: opacity 0.25s;
}

.ag-card:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.ag-card:hover::before { opacity: 1; }

.ag-card-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.ag-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.ag-card-meta { flex: 1; min-width: 0; }

.ag-card-specialty {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.8;
}

.ag-card-name {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

.ag-card-tagline {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.ag-card-channels {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.ag-channel-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.ag-card-stats {
  display: flex;
  gap: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.ag-mini-stat { text-align: center; flex: 1; }

.ag-mini-stat-num {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 2px;
}

.ag-mini-stat-lbl {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.2;
}

.ag-card-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.ag-card:hover .ag-card-cta { color: var(--text-primary); }

.ag-card-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.2s;
}
.ag-card:hover .ag-card-arrow {
  background: rgba(255,255,255,0.06);
  border-color: var(--border-hover);
  transform: translateX(2px);
}

/* ── MODAL ───────────────────────────────────────────────────── */
.ag-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  overflow-y: auto;
}

.ag-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(8px);
}

.ag-modal-content {
  position: relative;
  max-width: 1000px;
  margin: 40px auto;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 60vh;
}

.ag-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.ag-modal-close:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
}

/* ── AGENT DETAIL (inside modal) ─────────────────────────────── */
.ag-detail-hero {
  padding: 40px 0 30px;
  border-bottom: 1px solid var(--border);
}

.ag-detail-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin-bottom: 20px;
}

.ag-detail-title {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.ag-detail-tagline {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.ag-detail-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.ag-detail-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.ag-detail-stat-row {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.ag-detail-stat {
  text-align: center;
  padding: 20px 28px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex: 1;
  min-width: 120px;
}

.ag-detail-stat-num {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 6px;
}

.ag-detail-stat-lbl {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── TWO-COLUMN LAYOUT ───────────────────────────────────────── */
.ag-two-col {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 40px;
  align-items: flex-start;
  padding: 40px 0;
}

/* ── INFO PANEL ──────────────────────────────────────────────── */
.ag-info-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}

.ag-info-block h3 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.ag-result-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.ag-result-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.ag-result-list li::before {
  content: '\2713';
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--green);
}

.ag-trigger-box {
  background: rgba(0,255,136,0.04);
  border: 1px solid rgba(0,255,136,0.15);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-secondary);
}

.ag-trigger-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 4px;
}

/* ── CHAT WIDGET ─────────────────────────────────────────────── */
.ag-chat-widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.ag-chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.ag-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.ag-chat-practice {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 2px;
  color: var(--text-primary);
}

.ag-chat-status {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 5px;
}

.ag-chat-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  animation: ag-pulse-dot 2s ease-in-out infinite;
}

.ag-chat-badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(0,255,136,0.1);
  color: var(--green);
  border: 1px solid rgba(0,255,136,0.2);
  padding: 3px 8px;
  border-radius: 6px;
}

.ag-chat-messages {
  height: 380px;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ag-chat-messages::-webkit-scrollbar { width: 4px; }
.ag-chat-messages::-webkit-scrollbar-track { background: transparent; }
.ag-chat-messages::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.ag-msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 88%;
  animation: ag-msg-in 0.3s ease;
}

@keyframes ag-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ag-msg-bot { align-self: flex-start; }
.ag-msg-user { align-self: flex-end; flex-direction: row-reverse; }

.ag-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.ag-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.ag-msg-bot .ag-msg-bubble {
  background: #1c1c30;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text-primary);
}

.ag-msg-user .ag-msg-bubble {
  background: var(--user-color, var(--green));
  color: #050508;
  font-weight: 600;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.ag-typing {
  display: none;
  align-items: flex-end;
  gap: 8px;
  align-self: flex-start;
}
.ag-typing.show { display: flex; }

.ag-typing-bubble {
  background: #1c1c30;
  border: 1px solid var(--border);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  padding: 12px 16px;
  display: flex;
  gap: 5px;
  align-items: center;
}

.ag-typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ag-text-muted);
  animation: ag-typing-bounce 1.2s ease-in-out infinite;
}
.ag-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ag-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes ag-typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-5px); opacity: 1; }
}

/* Quick reply options */
.ag-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
  align-self: flex-start;
  padding: 8px 16px;
}

.ag-qr-btn {
  background: transparent;
  border: 1px solid var(--border-hover);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.ag-qr-btn:hover {
  border-color: var(--user-color, var(--green));
  color: var(--user-color, var(--green));
  background: rgba(0,255,136,0.05);
}

/* Chat input area */
.ag-chat-input-wrap {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
}

.ag-chat-input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 10px 16px;
  color: var(--text-primary);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}

.ag-chat-input:focus { border-color: var(--user-color, var(--green)); }
.ag-chat-input::placeholder { color: var(--text-muted); }

.ag-chat-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--user-color, var(--green));
  color: #050508;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}
.ag-chat-send:hover { transform: scale(1.08); opacity: 0.9; }

/* Restart button */
.ag-chat-restart {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border-top: 1px solid var(--border);
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  width: 100%;
  font-family: inherit;
  transition: color 0.2s;
}
.ag-chat-restart.show { display: flex; }
.ag-chat-restart:hover { color: var(--text-primary); }

/* ── CTA SECTION ─────────────────────────────────────────────── */
.ag-cta-section {
  padding: 80px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  background: var(--bg-primary);
}

.ag-cta-section h2 {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.ag-cta-section p {
  color: var(--text-secondary);
  font-size: 17px;
  margin-bottom: 32px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* ── RESPONSIVE ──────────────────────────────────────────────── */
@media (max-width: 900px) {
  .ag-two-col { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .ag-hero { padding: 100px 16px 60px; }
  .ag-stats-bar { flex-direction: column; }
  .ag-stat-item { border-right: none; border-bottom: 1px solid var(--border); }
  .ag-stat-item:last-child { border-bottom: none; }
  .ag-grid { grid-template-columns: 1fr; }
  .ag-detail-stat-row { flex-direction: column; }
  .ag-container { padding: 0 16px; }
  .ag-modal-content { margin: 10px; border-radius: 12px; }
}
