/* ===================================================
   AI UROLOGY CHATBOT & SELF-ASSESSMENT CSS
   Dr. Ruchir Maheshwari - Urology & Renal Transplant
=================================================== */

:root {
  --primary-navy: #1c2b4a;
  --secondary-blue: #1a6fa8;
  --accent-gold: #f2b326;
  --chat-bg: #f5f8fc;
  --bot-msg-bg: #ffffff;
  --user-msg-bg: #1a6fa8;
  --border-color: #e2e8f0;
  --text-dark: #1e293b;
  --text-muted: #64748b;
  --risk-red: #dc2626;
  --risk-red-bg: #fef2f2;
  --risk-yellow: #d97706;
  --risk-yellow-bg: #fffbeb;
  --risk-green: #16a34a;
  --risk-green-bg: #f0fdf4;
}

/* Page Intro Banner */
.ai-page-hero {
  background: linear-gradient(135deg, #1c2b4a 0%, #1e3a6a 60%, #1a6fa8 100%);
  color: #ffffff;
  padding: 40px 20px 25px;
  text-align: center;
  position: relative;
}

.ai-page-hero-inner {
  max-width: 820px;
  margin: 0 auto;
}

.ai-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fef08a;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 5px 16px;
  border-radius: 50px;
  margin-bottom: 12px;
}

.ai-page-hero h1 {
  font-family: 'Nunito', sans-serif;
  font-size: 30px;
  font-weight: 800;
  margin-bottom: 6px;
}

.ai-page-hero .sub-hi {
  font-size: 17px;
  color: #f2b326;
  font-weight: 600;
  margin-bottom: 8px;
}

.ai-page-hero p {
  font-size: 14px;
  color: #e2e8f0;
  margin-bottom: 0;
}

/* Chatbot Outer Wrapper */
.ai-chat-wrapper {
  max-width: 880px;
  margin: -15px auto 60px;
  padding: 0 16px;
  position: relative;
  z-index: 10;
}

.ai-chat-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 12px 45px rgba(0, 0, 0, 0.1);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 720px;
}

/* Chat Header */
.ai-chat-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 5;
}

.ai-bot-profile {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ai-avatar-wrapper {
  position: relative;
  width: 48px;
  height: 48px;
}

.ai-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1c2b4a, #1a6fa8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 22px;
  box-shadow: 0 4px 10px rgba(26, 111, 168, 0.25);
}

.ai-online-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid #ffffff;
}

.ai-bot-info h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-navy);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ai-verified-badge {
  color: #1a6fa8;
  font-size: 14px;
}

.ai-bot-status {
  font-size: 12px;
  color: #16a34a;
  font-weight: 600;
  margin-top: 2px;
}

.ai-header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-restart-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.ai-restart-btn:hover {
  background: #e2e8f0;
  color: var(--primary-navy);
}

/* Progress Bar under header */
.ai-progress-strip {
  height: 4px;
  background: #e2e8f0;
  width: 100%;
}

.ai-progress-strip-bar {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, #1a6fa8, #f2b326);
  transition: width 0.4s ease;
}

/* Chat Messages Scroll Area */
.ai-chat-body {
  flex: 1;
  background: var(--chat-bg);
  padding: 22px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
  scroll-behavior: smooth;
}

/* Message Rows */
.ai-msg-row {
  display: flex;
  gap: 12px;
  max-width: 88%;
  animation: slideInMsg 0.25s ease-out;
}

@keyframes slideInMsg {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-msg-bot {
  align-self: flex-start;
}

.ai-msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary-navy);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 4px;
}

.ai-msg-user .ai-msg-avatar {
  background: #64748b;
}

.ai-bubble {
  background: var(--bot-msg-bg);
  color: var(--text-dark);
  padding: 14px 18px;
  border-radius: 18px 18px 18px 4px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.04);
  font-size: 14px;
  line-height: 1.55;
  border: 1px solid rgba(226, 232, 240, 0.7);
  position: relative;
}

.ai-msg-user .ai-bubble {
  background: var(--user-msg-bg);
  color: #ffffff;
  border-radius: 18px 18px 4px 18px;
  border: none;
  box-shadow: 0 4px 14px rgba(26, 111, 168, 0.22);
}

.ai-bubble-hi {
  font-size: 13px;
  color: #475569;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed #e2e8f0;
}

.ai-msg-user .ai-bubble-hi {
  color: #e0f2fe;
  border-top-color: rgba(255, 255, 255, 0.2);
}

/* Typing Indicator */
.ai-typing-indicator {
  display: none;
  align-self: flex-start;
  align-items: center;
  gap: 12px;
}

.ai-typing-indicator.active {
  display: flex;
}

.ai-typing-bubble {
  background: #ffffff;
  padding: 12px 18px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  border: 1px solid var(--border-color);
}

.ai-typing-dot {
  width: 7px;
  height: 7px;
  background: #94a3b8;
  border-radius: 50%;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Options / Interactive Controls Container */
.ai-chat-actions {
  background: #ffffff;
  border-top: 1px solid var(--border-color);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-chips-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 180px;
  overflow-y: auto;
}

.ai-chip-btn {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: var(--text-dark);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
  text-align: left;
}

.ai-chip-btn:hover {
  background: #eef5fb;
  border-color: var(--secondary-blue);
  color: var(--secondary-blue);
  transform: translateY(-1px);
}

.ai-chip-btn.selected {
  background: var(--secondary-blue);
  border-color: var(--secondary-blue);
  color: #ffffff;
}

/* Rating Scale (0 to 5) for IPSS */
.ai-ratings-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ai-ratings-scale {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.ai-rate-chip {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.ai-rate-chip:hover {
  border-color: var(--secondary-blue);
  background: #f0f7fc;
}

.ai-rate-chip .num {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-navy);
  display: block;
}

.ai-rate-chip .lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  line-height: 1.2;
  margin-top: 2px;
}

/* Multi-select Red Flags checklist inside chat */
.ai-checklist-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.ai-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.15s;
}

.ai-check-label:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.ai-check-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: var(--risk-red);
  cursor: pointer;
  flex-shrink: 0;
}

.ai-confirm-btn {
  background: var(--secondary-blue);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(26, 111, 168, 0.25);
  margin-top: 4px;
}

.ai-confirm-btn:hover {
  background: #145987;
}

/* Final Triage Report Card (inside chat) */
.ai-report-card {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  margin-top: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.ai-triage-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.ai-triage-red {
  background: var(--risk-red-bg);
  color: var(--risk-red);
  border: 1.5px solid #fca5a5;
}

.ai-triage-yellow {
  background: var(--risk-yellow-bg);
  color: var(--risk-yellow);
  border: 1.5px solid #fcd34d;
}

.ai-triage-green {
  background: var(--risk-green-bg);
  color: var(--risk-green);
  border: 1.5px solid #86efac;
}

.ai-report-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 14px;
}

.ai-stat-box {
  border-right: 1px solid #e2e8f0;
  padding-right: 8px;
}

.ai-stat-box:nth-child(2n) {
  border-right: none;
}

.ai-stat-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-navy);
}

.ai-stat-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.ai-report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  margin-bottom: 16px;
  text-align: left;
}

.ai-report-table th,
.ai-report-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #e2e8f0;
}

.ai-report-table th {
  color: #475569;
  font-weight: 600;
  width: 40%;
}

.ai-report-table td {
  color: var(--text-dark);
  font-weight: 700;
}

.ai-report-cta-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ai-wa-btn {
  background: #25D366;
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: background 0.2s;
}

.ai-wa-btn:hover {
  background: #1eb956;
}

.ai-call-btn {
  background: var(--primary-navy);
  color: #ffffff !important;
  font-size: 14px;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.ai-secondary-btns {
  display: flex;
  gap: 8px;
}

.ai-sec-btn {
  flex: 1;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: var(--text-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ai-sec-btn:hover {
  background: #e2e8f0;
}

.ai-disclaimer {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 12px;
  line-height: 1.4;
  text-align: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .ai-chat-card {
    height: 82vh;
    border-radius: 14px;
  }
  .ai-chat-body {
    padding: 14px 12px;
  }
  .ai-msg-row {
    max-width: 95%;
  }
  .ai-bubble {
    font-size: 13.5px;
    padding: 12px 14px;
  }
  .ai-ratings-scale {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .ai-page-hero h1 {
    font-size: 22px;
  }
  .ai-report-stats {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ai-stat-box {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 6px;
  }
  .ai-stat-box:last-child {
    border-bottom: none;
  }
}
