/* AI Analysis Bubble */
.ai-panel {
  position: fixed; 
  width: 340px; 
  max-height: 65vh;
  background: radial-gradient(circle at 30% 30%, rgba(30,41,59,0.95), rgba(15,23,42,0.97));
  backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(51,65,85,0.9); 
  border-radius: 20px; 
  z-index: 11000; /* float above header (3000) and alert panel (9999) */
  display: none; 
  overflow: hidden; 
  box-shadow: 0 10px 32px -4px rgba(0,0,0,0.55), 0 0 0 1px rgba(148,163,184,0.08);
  transform-origin: top left; 
  animation: bubble-pop 180ms cubic-bezier(.4,.14,.3,1);
}

@keyframes bubble-pop { 
  from { transform: scale(.6) translateY(8px); opacity:0 } 
  to { transform: scale(1) translateY(0); opacity:1 } 
}

.ai-panel-header {
  padding: 14px 16px 10px 16px; 
  background: transparent;
  display: flex; 
  justify-content: space-between; 
  align-items: center;
}

.ai-panel-title { 
  font-size: 15px; 
  font-weight: 600; 
  color: #38bdf8; 
  margin: 0; 
  letter-spacing:.5px; 
}

.ai-panel-close {
  background: none; 
  border: none; 
  color: #94a3b8; 
  cursor: pointer;
  font-size: 20px; 
  padding: 4px; 
  border-radius: 4px;
}

.ai-panel-close:hover { 
  background: rgba(148, 163, 184, 0.1); 
}

.ai-panel-content {
  padding: 16px; 
  max-height: 50vh; 
  overflow-y: auto;
}

.hex-info {
  background: rgba(30, 41, 59, 0.5); 
  padding: 12px; 
  border-radius: 8px;
  margin-bottom: 16px; 
  border: 1px solid #475569;
}

.hex-info h4 {
  margin: 0 0 8px 0; 
  color: #f1f5f9; 
  font-size: 14px;
}

.hex-info p {
  margin: 4px 0; 
  font-size: 13px; 
  color: #cbd5e1;
}

.ai-question {
  margin-bottom: 16px;
}

.ai-question input {
  width: 100%; 
  padding: 12px; 
  border: 1px solid #475569;
  border-radius: 8px; 
  background: rgba(30, 41, 59, 0.8);
  color: #e5e7eb; 
  font-size: 14px;
}

.ai-question input:focus {
  outline: none; 
  border-color: #06b6d4;
}

.ai-question button {
  margin-top: 8px; 
  width: 100%; 
  padding: 10px;
  background: linear-gradient(135deg, #0891b2, #06b6d4);
  border: none; 
  border-radius: 8px; 
  color: white;
  font-weight: 500; 
  cursor: pointer; 
  transition: all 0.2s;
}

.ai-question button:hover {
  background: linear-gradient(135deg, #0e7490, #0891b2);
  transform: translateY(-1px);
}

.ai-question button:disabled {
  background: #475569; 
  cursor: not-allowed; 
  transform: none;
}

.ai-response {
  background: rgba(6, 182, 212, 0.1); 
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 8px; 
  padding: 16px; 
  margin-top: 16px;
  font-size: 14px; 
  line-height: 1.6; 
  color: #f1f5f9;
}

.ai-loading {
  display: flex; 
  align-items: center; 
  gap: 8px; 
  color: #06b6d4;
  font-size: 14px; 
  padding: 12px; 
  background: rgba(6, 182, 212, 0.1);
  border-radius: 8px; 
  margin-top: 16px;
}

.ai-loading::before {
  content: ''; 
  width: 16px; 
  height: 16px; 
  border: 2px solid #06b6d4;
  border-top: 2px solid transparent; 
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
