/* ===== AI RISK PANEL (LIGHT COLLAPSIBLE) ===== */
.ai-risk-panel {
  background: white;
  border-radius: 20px;
  padding: 16px;
  position: relative;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ai-risk-panel.collapsed {
  padding: 10px 14px;
}

.ai-risk-panel.collapsed .ai-risk-content {
  display: none;
}

.ai-risk-panel.collapsed .ai-collapse-icon {
  transform: rotate(-90deg);
}

.ai-collapse-icon {
  transition: transform 0.3s;
}

.ai-risk-score-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
  font-weight: 900;
  color: #1e293b;
  position: relative;
}

.ai-risk-score-ring::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: conic-gradient(var(--ring-color) var(--ring-pct), #f1f5f9 0%);
  z-index: -1;
}

.ai-thinking {
  animation: ai-pulse 1.5s ease-in-out infinite;
}

.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  animation: ai-pulse 2s ease-in-out infinite;
}

.ai-action-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  margin-top: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-action-chip:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.ai-refresh-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ai-refresh-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.spin-slow {
  animation: spin-slow 1.2s linear infinite;
}

/* ===== REPORTS HUB STYLES ===== */
.report-filter-chip {
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.report-filter-chip.active {
  background: #006857;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 104, 87, 0.2);
}
.report-filter-chip:hover:not(.active) {
  background: #e2e8f0;
  color: #334155;
}

.report-card {
  background: white;
  border-radius: 24px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}
.report-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
  border-color: #006857;
}
.report-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.report-badge.raw { background: #fef3c7; color: #92400e; }
.report-badge.verified { background: #d1fae5; color: #065f46; }
.report-badge.official { background: #dbeafe; color: #1e40af; }
.report-badge.resolved { background: #f1f5f9; color: #475569; }

.trust-meter-container {
  height: 4px;
  background: #f1f5f9;
  border-radius: 2px;
  overflow: hidden;
}
.trust-meter-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  transition: width 1s ease-out;
}

/* Timeline */
.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 24px;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #f1f5f9;
}
.timeline-item:last-child::before {
  display: none;
}
.timeline-dot {
  position: absolute;
  left: 0;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  border: 3px solid #006857;
  z-index: 1;
}

/* ===== LOADING INDICATOR ===== */
#map-loading {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-radius: 99px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: #006857;
  z-index: 60;
  box-shadow: 0 4px 20px rgba(0, 104, 87, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: opacity 0.4s ease;
}

#map-loading.hidden-fade {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #e1e3e4;
  border-top-color: #006857;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ===== NIRA OVERLAY (same pattern as profile-overlay) ===== */
#nira-overlay {
  position: fixed;
  inset: 0;
  z-index: 9200;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

#nira-overlay.open {
  opacity: 1;
  pointer-events: all;
}

/* The chat card itself */
#nira-card {
  background: #ffffff;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.18);
  width: 100%;
  max-width: 620px;
  height: 85vh;
  max-height: 700px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(60px);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

#nira-overlay.open #nira-card {
  transform: translateY(0);
}

/* On desktop, show as centered floating card instead */
@media (min-width: 768px) {
  #nira-overlay {
    align-items: center;
    justify-content: center;
    padding: 20px;
  }

  #nira-card {
    border-radius: 28px;
    height: 80vh;
    width: 480px;
    max-width: 100%;
    transform: scale(0.92) translateY(20px);
  }

  #nira-overlay.open #nira-card {
    transform: scale(1) translateY(0);
  }
}

/* --- Header --- */
#nira-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #006857, #00a87e);
  flex-shrink: 0;
  cursor: grab;
  user-select: none;
  /* Touch action none prevents page scrolling while dragging on mobile */
  touch-action: none;
}

#nira-header:active {
  cursor: grabbing;
}

.nira-avatar-wrap {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.4);
  flex-shrink: 0;
}

.nira-avatar-wrap .material-symbols-outlined {
  color: #fff;
  font-size: 22px;
  font-variation-settings: 'FILL' 1;
}

.nira-header-info {
  flex: 1;
}

.nira-header-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 16px;
  color: #fff;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

#nira-model-selector {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 13px;
  padding: 3px 6px;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

#nira-model-selector option {
  color: #1a1c1e;
  background: #fff;
  font-weight: 500;
  font-size: 14px;
}

.nira-header-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.nira-status-dot {
  width: 7px;
  height: 7px;
  background: #6effd3;
  border-radius: 50%;
  animation: nira-blink 2s ease-in-out infinite;
}

#nira-close,
#nira-export,
#nira-clear {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

#nira-close:hover,
#nira-export:hover,
#nira-clear:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* --- Messages --- */
#nira-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #f8fafb;
}

#nira-messages::-webkit-scrollbar {
  width: 4px;
}

#nira-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.nira-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.55;
  font-family: 'Plus Jakarta Sans', sans-serif;
  word-break: break-word;
}

.nira-bubble.ai {
  background: #ffffff;
  color: #1a1c1e;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  border: 1px solid #e8f0ed;
}

.nira-bubble.user {
  background: linear-gradient(135deg, #006857, #00a87e);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.nira-bubble.typing {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 12px 16px;
}

.nira-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: nira-dot-bounce 1.2s ease-in-out infinite;
}

.nira-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.nira-dot:nth-child(3) {
  animation-delay: 0.4s;
}

.nira-timestamp {
  font-size: 10px;
  color: #94a3b8;
  text-align: center;
  margin: 2px 0;
}

/* Welcome chip */
.nira-chip {
  align-self: center;
  background: rgba(0, 104, 87, 0.08);
  border: 1px solid rgba(0, 104, 87, 0.15);
  color: #006857;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 99px;
  margin-bottom: 4px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* --- Input bar --- */
#nira-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(0, 104, 87, 0.08);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}

#nira-textarea {
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  resize: none;
  outline: none;
  max-height: 100px;
  min-height: 42px;
  overflow-y: auto;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  color: #1a1c1e;
  background: #f8fafb;
  line-height: 1.5;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.02);
}

#nira-textarea:focus {
  border-color: #006857;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 104, 87, 0.1);
}

#nira-textarea::placeholder {
  color: #94a3b8;
}

#nira-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #006857, #059669);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 104, 87, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#nira-send:hover:not(:disabled) {
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 6px 16px rgba(0, 104, 87, 0.35);
}

#nira-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

#nira-send .material-symbols-outlined {
  font-size: 20px;
  font-variation-settings: 'FILL' 1;
}

.elevation-tonal {
  box-shadow: 0 10px 40px -10px rgba(0, 104, 87, 0.08);
}

.tonal-transition {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(242, 244, 245, 0.8) 100%);
}

.layer-btn.active {
  background-color: #006857 !important;
  color: white !important;
}

.layer-btn.active .layer-icon {
  color: white !important;
}

/* ===== PREMIUM MOBILE BOT-SHEET SPECIFIC STYLES ===== */
.nira-drag-handle {
  width: 40px;
  height: 5px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 99px;
  margin: 8px auto 0;
  flex-shrink: 0;
}

@keyframes bubble-appear {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.nira-bubble {
  animation: bubble-appear 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  will-change: transform, opacity;
}

/* Premium Custom Quick Reply Chips */
.nira-quick-reply-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  background: #ffffff;
  color: #006857;
  border: 1.5px solid #a7f3d0;
  cursor: pointer;
  white-space: nowrap;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 104, 87, 0.04);
}

.nira-quick-reply-btn:hover {
  background: #f0fdf4;
  border-color: #34d399;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 104, 87, 0.08);
}

.nira-quick-reply-btn:active {
  transform: translateY(0);
  background: #d1fae5;
}

/* Sleek Model Selector Dropdown */
#nira-model-selector {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 99px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 700;
  font-size: 11px;
  padding: 4px 10px;
  outline: none;
  cursor: pointer;
  transition: all 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

#nira-model-selector:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

#nira-model-selector option {
  color: #1a1c1e;
  background: #ffffff;
  font-weight: 600;
  font-size: 13px;
}

@media (max-width: 767px) {
  #nira-export,
  #nira-expand {
    display: none !important;
  }
  
  #nira-close, 
  #nira-clear {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #nira-header {
    padding: 10px 16px 14px;
    border-radius: 28px 28px 0 0;
  }
}

/* Premium Quick Replies Drag-to-Scroll cursor grab & selection prevention */
#nira-quick-replies {
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  scroll-behavior: smooth;
}

#nira-quick-replies.active-dragging {
  cursor: grabbing !important;
  scroll-behavior: auto; /* disable smooth scroll during active drag for responsive dragging */
}

#nira-quick-replies button {
  user-select: none;
  -webkit-user-select: none;
}
