/* Enhanced Features CSS - AI Assistant, Encryption, Analytics, etc. */

/* ===== AI Smart Assistant ===== */
.ai-assistant-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: auto;
  z-index: 9999;
  transition: right 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* When chat sidebar opens: AI assistant moves to left with high-class animation */
.ai-assistant-container.ai-assistant-shifted-left {
  right: auto;
  left: 20px;
  transform: translateX(0);
}

.ai-assistant-toggle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(15,23,42,0.85) 0%, rgba(30,58,138,0.6) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #60a5fa;
  font-size: 1.4rem;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.ai-assistant-toggle::before {
  content: 'Hold to open';
  position: absolute;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}
.ai-assistant-toggle:hover::before { opacity: 1; }

.ai-assistant-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(59, 130, 246, 0.35);
  border-color: rgba(59, 130, 246, 0.6);
}

.ai-assistant-toggle.active {
  background: linear-gradient(135deg, #10b981, #059669);
}

.ai-assistant-toggle.has-suggestion::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse 2s infinite;
}

.assistant-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.4);
  animation: pulse-ring 2s infinite;
}

@keyframes pulse-ring {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.5);
    opacity: 0;
  }
}

.ai-assistant-panel {
  position: fixed;
  bottom: 100px;
  right: 20px;
  left: auto;
  width: 420px;
  max-width: calc(100vw - 40px);
  height: 600px;
  max-height: calc(100vh - 140px);
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              right 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* When chat sidebar opens: AI panel follows container to left */
.ai-assistant-container.ai-assistant-shifted-left .ai-assistant-panel {
  right: auto;
  left: 20px;
}

.ai-assistant-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

.assistant-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.assistant-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-weight: 600;
}

.assistant-title i {
  color: #3b82f6;
  font-size: 1.25rem;
}

.assistant-status {
  font-size: 0.75rem;
  color: #10b981;
  margin-left: 0.5rem;
}

.assistant-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.2s;
}

.assistant-close:hover {
  background: rgba(148, 163, 184, 0.1);
  color: white;
}

.assistant-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.assistant-welcome {
  text-align: center;
  padding: 2rem 1rem;
}

.welcome-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
}

.assistant-welcome h3 {
  color: white;
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.assistant-welcome p {
  color: #94a3b8;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.assistant-welcome ul {
  text-align: left;
  color: #cbd5e1;
  margin: 1rem 0;
  padding-left: 1.5rem;
}

.assistant-welcome li {
  margin: 0.5rem 0;
}

.welcome-prompt {
  color: #3b82f6 !important;
  font-weight: 600;
  margin-top: 1.5rem !important;
}

.assistant-message {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
  animation: slideIn 0.3s ease;
}

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

.message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.assistant-message.user .message-avatar {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: white;
}

.assistant-message.assistant .message-avatar {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.message-content {
  flex: 1;
  background: rgba(59, 130, 246, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  color: #e2e8f0;
  line-height: 1.6;
}

.assistant-message.user .message-content {
  background: rgba(99, 102, 241, 0.2);
}

.message-content strong {
  color: white;
  font-weight: 600;
}

.message-content code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
}

.assistant-typing {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.typing-dots {
  background: rgba(59, 130, 246, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 12px;
  display: flex;
  gap: 0.5rem;
}

.typing-dots span {
  width: 8px;
  height: 8px;
  background: #3b82f6;
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

.assistant-suggestions {
  padding: 0 1.5rem 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.suggestion-chip {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.suggestion-chip:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.assistant-input-container {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  display: flex;
  gap: 0.75rem;
}

.assistant-input {
  flex: 1;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  transition: all 0.2s;
}

.assistant-input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.15);
}

.assistant-input::placeholder {
  color: #64748b;
}

.assistant-send {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border: none;
  border-radius: 12px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.assistant-send:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* ===== Smart Engine Indicator ===== */
.smart-engine-indicator {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 1000;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.engine-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #10b981;
  font-size: 0.875rem;
  font-weight: 600;
}

.engine-status i {
  font-size: 1.25rem;
  animation: brain-pulse 2s infinite;
}

@keyframes brain-pulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.1);
  }
}

.engine-pulse {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

/* ===== Encryption Module ===== */
.encryption-card {
  grid-column: span 2;
}

.encryption-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.encryption-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid rgba(148, 163, 184, 0.1);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
}

.tab-btn:hover {
  color: #3b82f6;
}

.tab-btn.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.encryption-tab {
  display: none;
}

.encryption-tab.active {
  display: block;
}

.file-upload-area {
  border: 2px dashed rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.file-upload-area:hover,
.file-upload-area.drag-over {
  border-color: #3b82f6;
  background: rgba(59, 130, 246, 0.05);
}

.upload-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: #94a3b8;
}

.upload-placeholder i {
  font-size: 3rem;
  color: #3b82f6;
}

.image-preview {
  position: relative;
}

.image-preview img {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
}

.remove-image {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(239, 68, 68, 0.9);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
}

.remove-image:hover {
  background: #dc2626;
  transform: scale(1.1);
}

.message-textarea {
  min-height: 120px;
  resize: vertical;
}

.char-counter {
  text-align: right;
  color: #64748b;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.btn-large {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  margin: 1.5rem 0;
}

.encryption-result {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
}

.result-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #10b981;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.result-header.success {
  color: #10b981;
}

.result-section {
  margin-bottom: 1.5rem;
}

.result-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #cbd5e1;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.security-badge {
  background: #dc2626;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  margin-left: auto;
}

.key-display,
.encrypted-display {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.key-display code,
.encrypted-display code {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
  color: #10b981;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
  word-break: break-all;
  max-height: 150px;
  overflow-y: auto;
}

.copy-btn {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #3b82f6;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.copy-btn:hover {
  background: rgba(59, 130, 246, 0.3);
  transform: translateY(-2px);
}

.toggle-btn {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #10b981;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  margin-left: 0.5rem;
}

.toggle-btn:hover {
  background: rgba(16, 185, 129, 0.3);
  transform: translateY(-2px);
}

.toggle-btn i {
  pointer-events: none;
}

.security-warning {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #f59e0b;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.encryption-info {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.info-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.875rem;
}

.info-item i {
  color: #10b981;
}

.decrypted-message {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1.5rem;
  border-radius: 8px;
  color: white;
  line-height: 1.6;
}

.decrypted-image img {
  max-width: 100%;
  max-height: 320px;
  border-radius: 8px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* Encryption module - image preview and decrypted image display */
.encryption-card .image-preview {
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.encryption-card .image-preview img {
  max-width: 100%;
  max-height: 280px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.encryption-card .encryption-decrypted-image img {
  max-width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

/* ===== User Analytics ===== */
.analytics-card {
  grid-column: span 2;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.analytics-section {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.section-title i {
  color: #3b82f6;
}

.analytics-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.analytics-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.item-label {
  color: #94a3b8;
  font-size: 0.875rem;
}

.item-value {
  color: white;
  font-weight: 600;
}

.risk-score {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.score-value {
  font-size: 1.25rem;
  color: #3b82f6;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.badge-info {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
}

.badge-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.badge-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.badge-secondary {
  background: rgba(148, 163, 184, 0.2);
  color: #94a3b8;
}

.live-scan-section {
  background: rgba(16, 185, 129, 0.05);
  border: 1px solid rgba(16, 185, 129, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.scan-status {
  margin-left: auto;
  padding: 0.25rem 0.75rem;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-radius: 6px;
  font-size: 0.875rem;
  animation: pulse 2s infinite;
}

.scan-status.complete {
  background: rgba(59, 130, 246, 0.2);
  color: #3b82f6;
  animation: none;
}

.scan-progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0;
}

.scan-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 4px;
  transition: width 0.5s ease;
  width: 0%;
}

.scan-insights {
  margin-top: 1rem;
}

.insight-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #cbd5e1;
  padding: 0.75rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
}

.insight-item i {
  color: #10b981;
}

.recommendations-section {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
}

.recommendations-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recommendation-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid;
}

.recommendation-item.success {
  background: rgba(16, 185, 129, 0.1);
  border-color: #10b981;
  color: #10b981;
}

.recommendation-item.info {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  color: #3b82f6;
}

.recommendation-item.warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: #f59e0b;
}

.recommendation-item.high {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.recommendation-item span {
  color: #cbd5e1;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .ai-assistant-panel {
    width: calc(100vw - 40px);
    height: calc(100vh - 140px);
    right: 20px;
    bottom: 100px;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .encryption-card {
    grid-column: span 1;
  }

  .analytics-card {
    grid-column: span 1;
  }
}

/* ===== Animations ===== */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOutRight {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}


/* ===== Enhanced Threat Map ===== */
.user-location-marker {
  position: absolute;
  z-index: 100;
  transform: translate(-50%, -50%);
  animation: markerAppear 0.5s ease;
}

@keyframes markerAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

.user-marker-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(16, 185, 129, 0.3);
  border-radius: 50%;
  animation: userPulse 2s infinite;
}

@keyframes userPulse {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

.user-marker-icon {
  position: relative;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
  border: 3px solid white;
  z-index: 2;
}

.user-marker-label {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(16, 185, 129, 0.95);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.location-info-panel {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 12px;
  padding: 1rem;
  min-width: 250px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 10;
}

.location-info-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #10b981;
  font-weight: 600;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.location-info-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.info-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
}

.info-label {
  color: #94a3b8;
}

.info-value {
  color: white;
  font-weight: 600;
}

.heat-zone {
  position: absolute;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(239, 68, 68, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  animation: heatPulse 3s infinite;
  transform: translate(-50%, -50%);
}

@keyframes heatPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
  }
}

.attack-vector {
  position: absolute;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.6), transparent);
  transform-origin: left center;
  pointer-events: none;
  animation: vectorFlow 2s infinite;
}

@keyframes vectorFlow {
  0% {
    opacity: 0;
    transform: scaleX(0);
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scaleX(1);
  }
}

.threat-ripple {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid currentColor;
  animation: ripple 2s infinite;
  opacity: 0;
}

@keyframes ripple {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) scale(2);
    opacity: 0;
  }
}

.threat-tooltip {
  position: fixed;
  background: rgba(15, 23, 42, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 12px;
  padding: 0;
  min-width: 250px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 10000;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  animation: tooltipAppear 0.2s ease;
}

@keyframes tooltipAppear {
  from {
    opacity: 0;
    transform: translate(-50%, -90%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -100%);
  }
}

.tooltip-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  font-weight: 600;
  border-radius: 12px 12px 0 0;
}

.tooltip-header.critical {
  background: rgba(220, 38, 38, 0.2);
  color: #dc2626;
}

.tooltip-header.high {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
}

.tooltip-header.medium {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.tooltip-header.low {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.tooltip-body {
  padding: 0.75rem 1rem;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  margin: 0.5rem 0;
  font-size: 0.875rem;
}

.tooltip-row span:first-child {
  color: #94a3b8;
}

.tooltip-row span:last-child {
  color: white;
  font-weight: 600;
}

.nearby-threat {
  animation: nearbyThreatAppear 0.5s ease;
}

@keyframes nearbyThreatAppear {
  from {
    opacity: 0;
    transform: scale(0);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.connection-line {
  position: absolute;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  transform-origin: left center;
  pointer-events: none;
  opacity: 0.5;
  animation: connectionPulse 2s infinite;
}

.connection-line.critical {
  color: #dc2626;
}

.connection-line.high {
  color: #ef4444;
}

.connection-line.medium {
  color: #f59e0b;
}

.connection-line.low {
  color: #10b981;
}

@keyframes connectionPulse {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 0.7;
  }
}

/* ===== Data Transparency ===== */
.transparency-card {
  grid-column: span 2;
}

.transparency-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}

.transparency-intro {
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid #3b82f6;
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.transparency-intro p {
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.transparency-intro i {
  color: #3b82f6;
  margin-top: 0.25rem;
}

.sources-filter {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
}

.filter-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: #3b82f6;
  color: white;
}

.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.source-card {
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.source-card:hover {
  transform: translateY(-4px);
  border-color: #3b82f6;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.2);
}

.source-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.source-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.source-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}

.source-status.active {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
}

.source-status.checking {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
}

.source-status i {
  font-size: 0.5rem;
  animation: pulse 2s infinite;
}

.source-body {
  margin-bottom: 1rem;
}

.source-name {
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.source-type {
  color: #3b82f6;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.source-description {
  color: #94a3b8;
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.source-details {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.detail-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.detail-item i {
  color: #3b82f6;
  margin-top: 0.25rem;
}

.detail-label {
  color: #94a3b8;
  min-width: 80px;
}

.detail-value {
  color: white;
  font-weight: 600;
  flex: 1;
  word-break: break-all;
}

.detail-value code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8em;
}

.reliability-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}

.source-data-types {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.data-types-label {
  color: #94a3b8;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.data-types-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.data-type-chip {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
}

.source-footer {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.source-btn {
  flex: 1;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.source-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: #3b82f6;
  transform: translateY(-2px);
}

.transparency-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-box {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(59, 130, 246, 0.05);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.stat-box:hover {
  transform: translateY(-2px);
  border-color: #3b82f6;
}

.stat-icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
}

.stat-content {
  flex: 1;
}

.stat-value {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.stat-label {
  color: #94a3b8;
  font-size: 0.875rem;
}

.transparency-footer {
  background: rgba(16, 185, 129, 0.1);
  border-left: 4px solid #10b981;
  padding: 1rem;
  border-radius: 8px;
}

.transparency-footer p {
  color: #cbd5e1;
  line-height: 1.6;
  margin: 0;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.transparency-footer i {
  color: #10b981;
  margin-top: 0.25rem;
}

.source-detail-modal {
  max-width: 700px;
}

.source-detail-section {
  margin-bottom: 2rem;
}

.source-detail-section h4 {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.detail-table {
  width: 100%;
  border-collapse: collapse;
}

.detail-table tr {
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.detail-table td {
  padding: 0.75rem 0;
  color: #cbd5e1;
}

.detail-table td:first-child {
  color: #94a3b8;
  width: 40%;
}

.data-types-detail {
  list-style: none;
  padding: 0;
}

.data-types-detail li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  color: #cbd5e1;
}

.data-types-detail i {
  color: #10b981;
}

.usage-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.usage-stat {
  background: rgba(59, 130, 246, 0.1);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
}

.usage-label {
  color: #94a3b8;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.usage-value {
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
}

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

/* ==================================
   RADAR SWEEP - WORLD-CLASS UI
   ================================== */

/* Radar Canvas */
.radar-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* Radar Controls */
.radar-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 10;
  display: flex;
  gap: 8px;
  align-items: center;
}

.radar-toggle-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 6px 12px;
  color: #60a5fa;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(10px);
}

.radar-toggle-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  border-color: rgba(59, 130, 246, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.radar-toggle-btn.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: rgba(6, 182, 212, 0.5);
  color: #06b6d4;
}

.radar-toggle-btn i {
  font-size: 0.875rem;
}

.radar-status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: radarStatusPulse 2s infinite;
}

.radar-status-indicator.active {
  background: #06b6d4;
}

.radar-status-indicator.radar-status-safe {
  background: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.radar-status-indicator.radar-status-threats_blocked {
  background: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

@keyframes radarStatusPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.6;
    transform: scale(1.2);
  }
}

/* Enhanced Threat Map with Radar Mode */
.threat-map-container.radar-mode {
  background: 
    radial-gradient(circle at center, rgba(6, 182, 212, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(30, 41, 59, 0.6) 100%);
  box-shadow: 
    inset 0 0 80px rgba(6, 182, 212, 0.05),
    0 0 0 1px rgba(6, 182, 212, 0.12),
    0 0 40px rgba(6, 182, 212, 0.1);
}

.threat-map-container.radar-mode:hover {
  border-color: rgba(6, 182, 212, 0.4);
  box-shadow: 
    inset 0 0 80px rgba(6, 182, 212, 0.08),
    0 0 24px rgba(6, 182, 212, 0.15);
}

/* Radar Grid Overlay */
.radar-grid-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.3;
  background-image: 
    repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(59, 130, 246, 0.1) 19px, rgba(59, 130, 246, 0.1) 20px),
    repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(59, 130, 246, 0.1) 19px, rgba(59, 130, 246, 0.1) 20px);
}

/* Enhanced Threat Points for Radar Mode */
.threat-map-container.radar-mode .threat-point {
  animation: radarThreatPulse 2s infinite, radarBlip 0.5s ease-out;
}

@keyframes radarBlip {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes radarThreatPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
    filter: brightness(1);
  }
  50% {
    transform: scale(1.3);
    opacity: 0.8;
    filter: brightness(1.4);
  }
}
