/* Nexus Panel · DatabasePanel.css — V22b spec InovHost
   Correspond au composant React DatabasePanel.jsx du document référencé
   Adapté Vanilla SPA — classes: nexus-db-panel, db-header, db-card… */

.nexus-db-panel {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  color: #e5e7eb;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  position: relative;
  z-index: 2;
}

/* HEADER */
.nexus-db-panel .db-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.nexus-db-panel .db-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .3px;
  background: linear-gradient(120deg, #22d3ee 0%, #60a5fa 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nexus-db-panel .db-header h2::before {
  content: "🗄️";
  font-size: 20px;
  -webkit-text-fill-color: initial;
  filter: drop-shadow(0 0 6px rgba(34,211,238,.5));
}

/* FEEDBACK (toast inline) */
.nexus-db-panel .feedback {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 18px;
  border: 1px solid transparent;
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
  position: relative;
  overflow: hidden;
}
.nexus-db-panel .feedback::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
}
.nexus-db-panel .feedback.success {
  background: rgba(16, 185, 129, .1);
  color: #a7f3d0;
  border-color: rgba(16,185,129,.28);
}
.nexus-db-panel .feedback.success::before { background: linear-gradient(180deg, #10b981, #059669); }
.nexus-db-panel .feedback.error {
  background: rgba(239, 68, 68, .1);
  color: #fecaca;
  border-color: rgba(239,68,68,.28);
}
.nexus-db-panel .feedback.error::before { background: linear-gradient(180deg, #ef4444, #b91c1c); }
.nexus-db-panel .feedback.info {
  background: rgba(34, 211, 238, .08);
  color: #bae6fd;
  border-color: rgba(34,211,238,.25);
}
.nexus-db-panel .feedback.info::before { background: linear-gradient(180deg, #22d3ee, #0891b2); }

/* DB LIST */
.nexus-db-panel .db-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}
.nexus-db-panel .empty {
  padding: 54px 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  border: 1px dashed rgba(148,163,184,.18);
  border-radius: 14px;
  background: rgba(15,23,42,.32);
  grid-column: 1 / -1;
}

/* DB CARD */
.nexus-db-panel .db-card {
  background: linear-gradient(180deg, rgba(15,23,42,.78), rgba(15,23,42,.55));
  border: 1px solid rgba(148,163,184,.14);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  backdrop-filter: blur(6px);
  transition: all .2s ease;
  position: relative;
  overflow: hidden;
}
.nexus-db-panel .db-card:hover {
  border-color: rgba(34,211,238,.3);
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(34,211,238,.08);
}
.nexus-db-panel .db-card h3,
.nexus-db-panel .db-card-title {
  margin: 0 0 6px;
  font-size: 15.5px;
  font-weight: 700;
  color: #e0f2fe;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-height: 20px;
}
.nexus-db-panel .db-card-title > span:first-child { max-width: 100%; display:inline-block; }
.nexus-db-panel .db-card h3 .type-badge {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34,211,238,.12);
  color: #67e8f9;
  border: 1px solid rgba(34,211,238,.22);
}
.nexus-db-panel .db-card h3 .type-badge.pg {
  background: rgba(99,102,241,.12);
  color: #c7d2fe;
  border-color: rgba(99,102,241,.22);
}
.nexus-db-panel .db-card .meta {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
}
.nexus-db-panel .db-card .meta b { color: #cbd5e1; font-weight: 600; }

.nexus-db-panel .db-card .status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  margin-top: 4px;
}
.nexus-db-panel .db-card .status-pill.active { background: rgba(16,185,129,.12); color: #6ee7b7; border:1px solid rgba(16,185,129,.22);}
.nexus-db-panel .db-card .status-pill.inactive{ background: rgba(100,116,139,.12);color:#cbd5e1;border:1px solid rgba(100,116,139,.2);}
.nexus-db-panel .db-card .status-pill.importing{ background: rgba(251,191,36,.1);color:#fde68a;border:1px solid rgba(251,191,36,.22);}
.nexus-db-panel .db-card .status-pill.error{ background: rgba(239,68,68,.1);color:#fecaca;border:1px solid rgba(239,68,68,.22);}

.nexus-db-panel .db-card .creds {
  margin-top: 4px;
  background: rgba(2,6,23,.55);
  border: 1px solid rgba(148,163,184,.1);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.65;
  color: #93c5fd;
}
.nexus-db-panel .db-card .creds .copy-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.nexus-db-panel .db-card .creds .copy-btn {
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(148,163,184,.12);
  color: #cbd5e1;
  cursor: pointer;
  border: 1px solid rgba(148,163,184,.18);
  font-weight: 600;
}
.nexus-db-panel .db-card .creds .copy-btn:hover { background: rgba(34,211,238,.14); color:#67e8f9; border-color:rgba(34,211,238,.3);}

.nexus-db-panel .db-card .db-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* BOUTONS */
.nexus-db-panel .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all .18s ease;
  white-space: nowrap;
  user-select: none;
}
.nexus-db-panel .btn:disabled {
  opacity: .55 !important;
  cursor: not-allowed !important;
  filter: grayscale(.25);
}
.nexus-db-panel .btn-primary {
  background: linear-gradient(135deg, #22d3ee 0%, #3b82f6 60%, #8b5cf6 100%);
  background-size: 140% 140%;
  color: #082f49;
  box-shadow: 0 6px 22px rgba(34,211,238,.22);
}
.nexus-db-panel .btn-primary:hover:not(:disabled){ background-position: 100% 50%; transform: translateY(-1px); box-shadow:0 10px 26px rgba(34,211,238,.28);}
.nexus-db-panel .btn-ghost {
  background: rgba(148,163,184,.08);
  color: #cbd5e1;
  border-color: rgba(148,163,184,.2);
}
.nexus-db-panel .btn-ghost:hover:not(:disabled){ background: rgba(34,211,238,.08); color:#67e8f9; border-color: rgba(34,211,238,.3);}
.nexus-db-panel .btn-danger {
  background: rgba(239,68,68,.1);
  color: #fca5a5;
  border-color: rgba(239,68,68,.22);
}
.nexus-db-panel .btn-danger:hover:not(:disabled){ background: rgba(239,68,68,.18); color:#fecaca; border-color: rgba(239,68,68,.35);}
.nexus-db-panel .btn-pma {
  background: linear-gradient(135deg, rgba(251,146,60,.18), rgba(249,115,22,.14));
  color: #fed7aa;
  border-color: rgba(251,146,60,.35);
  cursor: pointer;
}
.nexus-db-panel .btn-pma:hover:not(:disabled):not(.btn-pma-disabled){ background: linear-gradient(135deg, rgba(251,146,60,.3), rgba(249,115,22,.25)); color:#ffedd5; transform: translateY(-1px);}
.nexus-db-panel .btn-pma.btn-pma-disabled {
  background: linear-gradient(135deg, rgba(99,102,241,.14), rgba(168,85,247,.10));
  color: #c7d2fe;
  border-color: rgba(99,102,241,.28);
  cursor: help;
  opacity: .95;
  font-weight: 600;
}
.nexus-db-panel .btn-pma.btn-pma-disabled:hover { transform: none; filter: none; }

.nexus-db-panel .btn-sm { padding: 8px 12px; font-size: 12px; border-radius: 8px; }

/* ================ MODAL ================ */
.nexus-db-panel .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: radial-gradient(700px 480px at 50% 30%, rgba(34,211,238,.14), transparent 65%),
              rgba(2, 6, 23, .75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: nx-fade .2s ease;
}
@keyframes nx-fade { from { opacity: 0; } to { opacity: 1; } }

.nexus-db-panel .modal {
  width: 100%;
  max-width: 560px;
  background: linear-gradient(180deg, #0b1220, #080d1a);
  border: 1px solid rgba(34,211,238,.22);
  border-radius: 16px;
  padding: 24px 24px 20px;
  position: relative;
  box-shadow: 0 30px 90px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.02) inset;
  animation: nx-pop .25s cubic-bezier(.2,.9,.3,1.1);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
@keyframes nx-pop { from { transform: scale(.96) translateY(6px); opacity:0;} to { transform:none; opacity:1;} }
.nexus-db-panel .modal h3 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .25px;
  color: #e0f2fe;
  display: flex;
  align-items: center;
  gap: 10px;
}
.nexus-db-panel .modal h3::before{ content:"🗄️"; filter: drop-shadow(0 0 4px rgba(251,146,60,.55));}
.nexus-db-panel .modal label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #cbd5e1;
  margin-bottom: 16px;
}
.nexus-db-panel .modal label input[type="text"] {
  margin-top: 6px;
  display: block;
  width: 100%;
  padding: 10px 13px;
  border-radius: 9px;
  background: rgba(2,6,23,.7);
  border: 1px solid rgba(148,163,184,.18);
  color: #f1f5f9;
  font-size: 13.5px;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.nexus-db-panel .modal label input[type="text"]:focus {
  outline: none;
  border-color: rgba(34,211,238,.55);
  box-shadow: 0 0 0 3px rgba(34,211,238,.16);
}
.nexus-db-panel .modal label input:disabled { opacity: .5; }

/* DROPZONE */
.nexus-db-panel .dropzone {
  border: 2px dashed rgba(148,163,184,.25);
  border-radius: 12px;
  padding: 26px 18px;
  text-align: center;
  transition: all .18s ease;
  cursor: pointer;
  background: rgba(15,23,42,.35);
  margin-bottom: 18px;
  position: relative;
}
.nexus-db-panel .dropzone.drag-over {
  border-color: #22d3ee;
  background: rgba(34,211,238,.09);
  box-shadow: inset 0 0 0 1px rgba(34,211,238,.18);
}
.nexus-db-panel .dropzone.has-file {
  border-color: rgba(16,185,129,.4);
  background: rgba(16,185,129,.07);
}
.nexus-db-panel .dropzone p { margin: 0 0 8px; color: #cbd5e1; font-size: 14px; font-weight: 500;}
.nexus-db-panel .dropzone span { color: #94a3b8; font-size: 12.5px; display: block; margin-bottom: 10px;}
.nexus-db-panel .dropzone .btn-file {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(34,211,238,.14);
  color: #67e8f9;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(34,211,238,.28);
  transition: all .18s;
}
.nexus-db-panel .dropzone .btn-file:hover { background: rgba(34,211,238,.22); color: #a5f3fc; }
.nexus-db-panel .dropzone:has(:disabled) { cursor: default; }

.nexus-db-panel .file-selected {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(2,6,23,.45);
  border: 1px solid rgba(148,163,184,.12);
}
.nexus-db-panel .file-selected span { font-size: 13px; color: #e2e8f0; font-weight: 600; margin: 0;}
.nexus-db-panel .btn-remove-file {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex; align-items:center; justify-content:center;
}
.nexus-db-panel .btn-remove-file:hover:not(:disabled) { background: rgba(239,68,68,.18); }

/* PROGRESS BAR + BOUTON ANNULER (spec nexusDbApi.importSql) */
.nexus-db-panel .progress-container {
  margin: 4px 0 14px;
}
.nexus-db-panel .progress-label {
  font-size: 12.5px;
  color: #94a3b8;
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.nexus-db-panel .progress-bar {
  height: 10px;
  background: rgba(148,163,184,.12);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid rgba(148,163,184,.1);
}
.nexus-db-panel .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #22d3ee 0%, #3b82f6 50%, #a78bfa 100%);
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width .2s ease;
  animation: nx-shimmer 2s linear infinite;
}
@keyframes nx-shimmer {
  0% { background-position: 0% 50%;}
  100% { background-position: 200% 50%;}
}
.nexus-db-panel .btn-abort {
  background: none;
  border: 1px solid rgba(239,68,68,.25);
  color: #fca5a5;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .3px;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all .15s;
}
.nexus-db-panel .btn-abort:hover {
  background: rgba(239,68,68,.12);
  color: #fecaca;
}

.nexus-db-panel .modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 6px;
}
