/* ============================================
   CAPTORA LITE — Agent Page Styles
   Forest Green + Gold Theme
   ============================================ */

.agent-body {
  overflow: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   AGENT NAVBAR
   ============================================ */
.agent-nav .nav-container {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}
.agent-nav-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}
.agent-status-dot {
  width: 8px; height: 8px;
  background: var(--primary-bright);
  border-radius: 50%;
  animation: statusPulse 2s infinite;
}
@keyframes statusPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58,173,101,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(58,173,101,0); }
}
.agent-nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.welcome-text {
  font-size: 13px;
  color: var(--text-muted);
}
.btn-upgrade-nav {
  background: linear-gradient(135deg, #D4AF37, #A8892A);
  color: var(--bg-dark);
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}
.btn-upgrade-nav:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212,175,55,0.4);
}

/* ============================================
   AGENT LAYOUT
   ============================================ */
.agent-layout {
  display: grid;
  grid-template-columns: 265px 1fr;
  flex: 1;
  overflow: hidden;
  height: calc(100vh - 65px);
}

/* ============================================
   SIDEBAR
   ============================================ */
.agent-sidebar {
  background: var(--bg-card);
  border-right: 1px solid rgba(212,175,55,0.12);
  overflow-y: auto;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: relative;
  z-index: 1;
}
.agent-sidebar::-webkit-scrollbar { width: 3px; }
.agent-sidebar::-webkit-scrollbar-track { background: transparent; }
.agent-sidebar::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 2px; }

.sidebar-section { display: flex; flex-direction: column; gap: 10px; }
.sidebar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 4px;
}
.quick-prompts { display: flex; flex-direction: column; gap: 6px; }
.quick-btn {
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 9px;
  line-height: 1.3;
}
.quick-btn i { color: var(--primary-bright); font-size: 12px; width: 14px; flex-shrink: 0; }
.quick-btn:hover {
  background: rgba(27,107,58,0.12);
  border-color: rgba(27,107,58,0.35);
  color: var(--text-primary);
  transform: translateX(3px);
}

/* Platform Tags */
.platform-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ptag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.ptag.instagram { background: rgba(225,48,108,0.1); color: #E1306C; border-color: rgba(225,48,108,0.25); }
.ptag.tiktok { background: rgba(255,255,255,0.05); color: #EEE; border-color: rgba(255,255,255,0.15); }
.ptag.facebook { background: rgba(24,119,242,0.1); color: #6495ED; border-color: rgba(24,119,242,0.25); }
.ptag.linkedin { background: rgba(0,119,181,0.1); color: #0A90C5; border-color: rgba(0,119,181,0.25); }

.platform-upgrade-hint {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 11px;
  background: rgba(212,175,55,0.07);
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: 4px;
}
.platform-upgrade-hint i { color: var(--gold); margin-top: 1px; flex-shrink: 0; }
.platform-upgrade-hint strong { color: var(--gold-light); }

/* Sidebar Upgrade Card */
.sidebar-upgrade-card {
  background: linear-gradient(145deg, rgba(212,175,55,0.08), rgba(27,107,58,0.06));
  border: 1px solid rgba(212,175,55,0.25);
  border-radius: var(--radius);
  padding: 18px 14px;
  text-align: center;
  margin-top: auto;
}
.upgrade-icon {
  width: 40px; height: 40px;
  background: var(--gradient-gold);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--bg-dark);
  margin: 0 auto 10px;
}
.sidebar-upgrade-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 5px; color: var(--text-primary); }
.sidebar-upgrade-card p { font-size: 12px; color: var(--text-secondary); line-height: 1.55; margin-bottom: 12px; }
.btn-upgrade-sidebar {
  width: 100%;
  justify-content: center;
  background: var(--gradient-gold);
  color: var(--bg-dark);
  padding: 9px 14px;
  font-size: 12px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 700;
  transition: var(--transition);
}
.btn-upgrade-sidebar:hover { transform: translateY(-2px); box-shadow: var(--shadow-gold); }
.sidebar-see-pricing {
  display: block;
  margin-top: 9px;
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}
.sidebar-see-pricing:hover { color: var(--gold); }

/* ============================================
   MAIN AGENT AREA
   ============================================ */
.agent-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

/* Welcome Banner */
.agent-welcome {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 22px;
  background: rgba(27,107,58,0.07);
  border-bottom: 1px solid rgba(27,107,58,0.2);
  flex-shrink: 0;
}
.welcome-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  overflow: hidden;
  border: 1.5px solid rgba(212,175,55,0.3);
  flex-shrink: 0;
}
.welcome-content h2 { font-size: 14px; font-weight: 700; margin-bottom: 3px; font-family: 'Space Grotesk', sans-serif; }
.welcome-content p { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }
.welcome-content strong { color: var(--gold-light); }
.welcome-close {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  font-size: 13px;
  flex-shrink: 0;
  transition: var(--transition);
}
.welcome-close:hover { color: var(--text-primary); }

/* IFRAME SHELL */
.iframe-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 14px 18px 0;
  border: 1px solid rgba(212,175,55,0.2);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}
.iframe-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-card2);
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius) var(--radius) 0 0;
  flex-shrink: 0;
}
.iframe-header-left { display: flex; align-items: center; gap: 9px; }
.agent-dot {
  width: 8px; height: 8px;
  background: var(--primary-bright);
  border-radius: 50%;
}
.agent-dot.pulse { animation: agentPulse 2.5s infinite; }
@keyframes agentPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(58,173,101,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(58,173,101,0); }
}
.iframe-title { font-size: 12px; font-weight: 600; color: var(--text-secondary); letter-spacing: 0.2px; }
.iframe-header-right { display: flex; align-items: center; gap: 8px; }
.iframe-platform-hint {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border-light);
  border-radius: 6px;
}
.iframe-platform-hint span { font-size: 11px; }
.iframe-action-btn {
  width: 28px; height: 28px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-light);
  border-radius: 7px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: var(--transition);
}
.iframe-action-btn:hover {
  background: rgba(27,107,58,0.12);
  border-color: rgba(27,107,58,0.3);
  color: var(--primary-bright);
}
.iframe-body { flex: 1; position: relative; overflow: hidden; }
#captoraFrame { width: 100%; height: 100%; border: none; display: block; background: white; }

/* Fallback */
.iframe-fallback {
  display: none;
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  text-align: center;
  padding: 40px;
}
.fallback-icon {
  width: 64px; height: 64px;
  border-radius: 14px;
  overflow: hidden;
  margin: 0 auto 20px;
  border: 2px solid rgba(212,175,55,0.3);
  box-shadow: var(--shadow-gold);
}
.iframe-fallback h3 { font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; font-family: 'Playfair Display', serif; }
.iframe-fallback p { font-size: 14px; color: var(--text-secondary); max-width: 420px; line-height: 1.65; }

/* POST-SESSION CTA STRIP */
.post-session-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  background: rgba(212,175,55,0.06);
  border-top: 1px solid rgba(212,175,55,0.18);
  flex-shrink: 0;
  gap: 12px;
}
.post-cta-left {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold);
  font-size: 16px;
  flex: 1;
  min-width: 0;
}
.post-cta-left div { display: flex; flex-direction: column; min-width: 0; }
.post-cta-left strong { font-size: 13px; color: var(--text-primary); font-weight: 700; white-space: nowrap; }
.post-cta-left span { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-cta-btns { display: flex; gap: 8px; flex-shrink: 0; }
.btn-cta-strip {
  background: var(--gradient-gold);
  color: var(--bg-dark);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.btn-cta-strip:hover { transform: translateY(-1px); box-shadow: var(--shadow-gold); }
.btn-cta-funnel {
  background: rgba(27,107,58,0.12);
  color: var(--primary-bright);
  border: 1px solid rgba(27,107,58,0.3);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.btn-cta-funnel:hover {
  background: var(--primary);
  color: white;
  transform: translateY(-1px);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 900px) {
  .agent-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    height: calc(100vh - 65px);
  }
  .agent-sidebar {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 12px 14px;
    gap: 14px;
    border-right: none;
    border-bottom: 1px solid rgba(212,175,55,0.12);
    height: auto;
  }
  .agent-sidebar .sidebar-section { flex-shrink: 0; min-width: 200px; }
  .agent-sidebar .sidebar-upgrade-card { display: none; }
  .quick-prompts { flex-direction: row; flex-wrap: nowrap; }
  .quick-btn { white-space: nowrap; min-width: 170px; }
  .agent-nav-center { display: none; }
}
@media (max-width: 600px) {
  .agent-nav-right .welcome-text { display: none; }
  .iframe-shell { margin: 8px 10px 0; }
  .post-cta-left span { display: none; }
  .btn-cta-funnel { display: none; }
  .iframe-platform-hint { display: none; }
}
