/* FILIAL ANALITIK - Modals, AI Chat, Client Profile & Extra Components */

/* Modal Dialog System */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 37, 64, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.show {
  display: flex;
}

.modal-card {
  background-color: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 750px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes modalSlide {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #F8FAFC;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  background-color: #F8FAFC;
}

/* File Upload Drop Zone */
.drop-zone {
  border: 2px dashed #CBD5E1;
  border-radius: var(--radius-md);
  padding: 40px 20px;
  text-align: center;
  background-color: #F8FAFC;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary-blue);
  background-color: #EFF6FF;
}

.drop-icon {
  font-size: 44px;
  color: var(--primary-blue);
  margin-bottom: 12px;
}

/* Column Mapping Grid */
.mapping-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}

.mapping-source {
  flex: 1;
  font-weight: 600;
  font-size: 13px;
}

.mapping-arrow {
  color: var(--text-muted);
}

.mapping-target {
  flex: 1.2;
}

/* AI Chat Assistant UI */
.ai-chat-container {
  display: flex;
  flex-direction: column;
  height: 600px;
  background-color: #FFFFFF;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ai-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-cyan);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}

.ai-chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background-color: #F8FAFC;
}

.chat-bubble {
  max-width: 80%;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
}

.chat-bubble.user {
  align-self: flex-end;
  background-color: var(--primary-blue);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.chat-bubble.ai {
  align-self: flex-start;
  background-color: #FFFFFF;
  color: #1E293B;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border-light);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
  padding: 16px 20px;
  max-width: 85%;
  line-height: 1.6;
}

.chat-bubble.ai .ai-h1,
.chat-bubble.ai .ai-h2,
.chat-bubble.ai .ai-h3,
.chat-bubble.ai .ai-h4 {
  font-family: 'Inter', sans-serif;
  color: #0F172A;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 6px;
}

.chat-bubble.ai .ai-h1 { font-size: 17px; }
.chat-bubble.ai .ai-h2 { font-size: 16px; border-bottom: 2px solid #E2E8F0; padding-bottom: 4px; }
.chat-bubble.ai .ai-h3 { font-size: 14.5px; color: #0284C7; }
.chat-bubble.ai .ai-h4 { font-size: 13.5px; color: #475569; }

.chat-bubble.ai .ai-p {
  margin-bottom: 8px;
  font-size: 13.5px;
  color: #334155;
  line-height: 1.65;
}

.chat-bubble.ai .ai-list {
  margin: 8px 0 12px 20px;
  padding: 0;
  list-style-type: disc;
}

.chat-bubble.ai .ai-list li {
  margin-bottom: 6px;
  font-size: 13.5px;
  color: #334155;
  line-height: 1.6;
}

.chat-bubble.ai strong {
  color: #0F172A;
  font-weight: 700;
}

.chat-bubble.ai .ai-code {
  background-color: #F1F5F9;
  color: #0284C7;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 12px;
  font-weight: 600;
}

.chat-bubble.ai .ai-divider {
  border: 0;
  border-top: 1px dashed #CBD5E1;
  margin: 14px 0;
}

.chat-bubble.ai .ai-spacer {
  height: 6px;
}

.ai-chat-input-bar {
  padding: 16px 20px;
  background-color: #FFFFFF;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 12px;
}

.chat-input {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  outline: none;
  font-size: 14px;
}

.chat-input:focus {
  border-color: var(--primary-blue);
}

/* Quick Suggestion Chips */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 20px;
  background-color: #F1F5F9;
  border-top: 1px solid var(--border-light);
}

.chip {
  background-color: #FFFFFF;
  border: 1px solid var(--border-light);
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 12px;
  color: var(--primary-blue);
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  background-color: var(--primary-blue);
  color: #FFFFFF;
}

/* Client 360 View Cards */
.profile-header-card {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-blue));
  color: #FFFFFF;
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profile-name {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 4px;
}

.profile-meta {
  display: flex;
  gap: 16px;
  font-size: 13px;
  color: #94A3B8;
}

/* Alert Item List */
.alert-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background-color: #FFFFFF;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
}

.alert-item.critical { border-left: 5px solid var(--status-red); }
.alert-item.high { border-left: 5px solid var(--status-yellow); }
.alert-item.medium { border-left: 5px solid var(--status-blue); }
