/**
 * VANTIX Enterprise Org Chart Platform — Data Health & Rectification Panel Styles
 * File: public_html_thevantix/apps/enterprise-org-chart-platform/assets/css/rectify-panel.css
 */

/* Slide-in Drawer (Desktop: 360px Right Panel) */
.vantix-rectify-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, 92vw);
  max-width: 92vw;
  z-index: 100001;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.45);
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
  color: #f8fafc;
  font-family: inherit;
  outline: none;
}

/* Light Theme Drawer */
html:not(.dark) .vantix-rectify-drawer,
:root:not(.dark) .vantix-rectify-drawer {
  background: rgba(255, 255, 255, 0.96);
  border-left: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.12);
  color: #0f172a;
}

/* Open state */
.vantix-rectify-drawer.is-open {
  transform: translateX(0);
}

/* Mobile Bottom Sheet (<= 768px) */
@media (max-width: 768px) {
  .vantix-rectify-drawer {
    width: 100%;
    max-width: 100vw;
    height: 85vh;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 20px 20px 0 0;
    transform: translateY(100%);
    box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.45);
  }

  html:not(.dark) .vantix-rectify-drawer,
  :root:not(.dark) .vantix-rectify-drawer {
    border-top: 1px solid rgba(0, 0, 0, 0.12);
    box-shadow: 0 -10px 35px rgba(0, 0, 0, 0.15);
  }

  .vantix-rectify-drawer.is-open {
    transform: translateY(0);
  }
}

/* Header */
.rectify-header {
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
html:not(.dark) .rectify-header {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.rectify-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: inherit;
}

.rectify-summary-strip {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
html:not(.dark) .rectify-summary-strip {
  color: #64748b;
}

.rectify-summary-strip .sep {
  opacity: 0.5;
}

.rectify-close-btn {
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 120ms ease;
}
.rectify-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
html:not(.dark) .rectify-close-btn:hover {
  background: rgba(0, 0, 0, 0.06);
  color: #0f172a;
}

/* Severity Chips Bar */
.rectify-severity-bar {
  padding: 10px 20px;
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.75rem;
  font-weight: 600;
  overflow-x: auto;
}
html:not(.dark) .rectify-severity-bar {
  background: rgba(0, 0, 0, 0.03);
}

.severity-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}
.chip-structural {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.chip-quality {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.chip-info {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}
.dot-red { background: #ef4444; }
.dot-amber { background: #f59e0b; }

/* Tabs */
.rectify-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 0 20px;
  background: rgba(0, 0, 0, 0.1);
}
html:not(.dark) .rectify-tabs {
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.02);
}

.rectify-tab {
  flex: 1;
  padding: 10px 8px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 120ms ease;
  text-align: center;
}
.rectify-tab:hover {
  color: #f8fafc;
}
html:not(.dark) .rectify-tab:hover {
  color: #0f172a;
}
.rectify-tab.is-active {
  color: #818cf8;
  border-bottom-color: #6366f1;
}
html:not(.dark) .rectify-tab.is-active {
  color: #4f46e5;
  border-bottom-color: #4f46e5;
}

/* Scrollable Body */
.rectify-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

/* All Clear State */
.rectify-all-clear {
  text-align: center;
  padding: 40px 16px;
}
.all-clear-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.rectify-all-clear h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #34d399;
  margin-bottom: 8px;
}
.rectify-all-clear p {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.5;
}

/* Issue Cards */
.issue-cards-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rectify-card {
  border-radius: 10px;
  padding: 14px;
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 200ms ease;
}
html:not(.dark) .rectify-card {
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.rectify-card.severity-structural {
  border-left: 4px solid #ef4444;
}
.rectify-card.severity-data_quality {
  border-left: 4px solid #f59e0b;
}

.rectify-card.issue-card-highlight {
  outline: 2px solid #6366f1;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
  animation: pulse-border 1.5s ease;
}

.rectify-card.card-resolved {
  border-left-color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  opacity: 0.8;
  transform: scale(0.98);
}

.card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.card-severity-badge {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}
.badge-red {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}
.badge-amber {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.card-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  color: inherit;
}

.card-meta {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-bottom: 12px;
  line-height: 1.4;
}
html:not(.dark) .card-meta {
  color: #64748b;
}

.card-meta code {
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 2px 4px;
  border-radius: 4px;
  color: #f87171;
}
html:not(.dark) .card-meta code {
  background: rgba(0, 0, 0, 0.06);
}

.meta-desc {
  margin-top: 4px;
  font-style: italic;
  font-size: 0.72rem;
}

.card-error-msg {
  padding: 8px 10px;
  margin-bottom: 10px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Inline Fix Controls */
.fix-control-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: #cbd5e1;
}
html:not(.dark) .control-label {
  color: #475569;
}

.select-search-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fix-search-input,
.fix-text-input {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  outline: none;
}
html:not(.dark) .fix-search-input,
html:not(.dark) .fix-text-input {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #0f172a;
}

.fix-search-input:focus,
.fix-text-input:focus {
  border-color: #6366f1;
}

.fix-select {
  width: 100%;
  padding: 6px 8px;
  font-size: 0.78rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  outline: none;
  cursor: pointer;
}
html:not(.dark) .fix-select {
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  color: #0f172a;
}

.input-action-row,
.toggle-action-row {
  display: flex;
  gap: 6px;
}

.fix-action-btn {
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  background: #6366f1;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 120ms ease;
  white-space: nowrap;
}
.fix-action-btn:hover {
  background: #4f46e5;
}

.fix-sub-btn {
  padding: 6px 10px;
  font-size: 0.75rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  border-radius: 6px;
  cursor: pointer;
}
html:not(.dark) .fix-sub-btn {
  border: 1px solid rgba(0, 0, 0, 0.2);
  color: #475569;
}

/* History Tab */
.history-controls-top {
  margin-bottom: 12px;
}
.btn-reset-all {
  width: 100%;
  padding: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  border-radius: 6px;
  cursor: pointer;
  transition: all 120ms ease;
}
.btn-reset-all:hover {
  background: rgba(239, 68, 68, 0.25);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-card {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(30, 41, 59, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}
html:not(.dark) .history-card {
  background: rgba(241, 245, 249, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.history-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.history-time {
  font-size: 0.68rem;
  color: #64748b;
}

.btn-undo-single {
  padding: 4px 8px;
  font-size: 0.72rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #818cf8;
  border-radius: 4px;
  cursor: pointer;
}
.btn-undo-single:hover {
  background: rgba(99, 102, 241, 0.35);
}

/* Toolbar Floating Badge */
.health-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
  margin-left: 6px;
}

.badge-has-issues {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-has-issues .badge-dot {
  width: 6px;
  height: 6px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
}

.badge-all-clear {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

/* Ghost Node Styling for Inactive/Resigned */
.org-node-group.is-ghost {
  opacity: 0.35;
  transition: opacity 180ms ease;
}
.org-node-group.is-ghost rect.org-node-rect {
  stroke-dasharray: 4 4;
}

/* Animations */
@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

@keyframes pulse-border {
  0% { box-shadow: 0 0 0 rgba(99, 102, 241, 0); }
  50% { box-shadow: 0 0 20px rgba(99, 102, 241, 0.6); }
  100% { box-shadow: 0 0 0 rgba(99, 102, 241, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .vantix-rectify-drawer {
    transition: none !important;
  }
  .badge-has-issues .badge-dot,
  .rectify-card.issue-card-highlight,
  .badge-pulse-warning,
  .badge-pulse-info {
    animation: none !important;
  }
}

/* ==========================================================================
   Tool #38 Phase 1.5 & 3 UX: Auto-Resolve, Batch Fills & Issue Guidance Badges
   ========================================================================== */

/* Auto-Resolve Banner */
.rectify-auto-resolve-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15) 0%, rgba(99, 102, 241, 0.18) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
}
html:not(.dark) .rectify-auto-resolve-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(99, 102, 241, 0.12) 100%);
  border-color: rgba(16, 185, 129, 0.35);
}

.auto-resolve-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.auto-resolve-badge-icon {
  font-size: 1.25rem;
  background: rgba(16, 185, 129, 0.2);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.auto-resolve-text strong {
  display: block;
  font-size: 0.85rem;
  color: #34d399;
}
html:not(.dark) .auto-resolve-text strong {
  color: #059669;
}

.auto-resolve-text p {
  margin: 2px 0 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.25;
}
html:not(.dark) .auto-resolve-text p {
  color: #64748b;
}

.btn-auto-resolve-all {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  border-radius: 6px;
  padding: 8px 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  transition: all 160ms ease;
}
.btn-auto-resolve-all:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
}
.btn-auto-resolve-all:active {
  transform: translateY(0);
}

/* Batch Fill Banner */
.rectify-batch-fill-banner {
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
html:not(.dark) .rectify-batch-fill-banner {
  background: rgba(241, 245, 249, 0.8);
  border-color: rgba(0, 0, 0, 0.08);
}

.batch-fill-header {
  font-size: 0.8rem;
  color: #f8fafc;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
html:not(.dark) .batch-fill-header {
  color: #0f172a;
}

.batch-fill-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.batch-fill-row {
  display: flex;
  gap: 6px;
}

.batch-fill-input {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 0.78rem;
  color: #f8fafc;
  outline: none;
}
html:not(.dark) .batch-fill-input {
  background: #ffffff;
  border-color: rgba(0, 0, 0, 0.15);
  color: #0f172a;
}

.btn-batch-fill {
  background: #3b82f6;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  border: none;
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms ease;
}
.btn-batch-fill:hover {
  background: #2563eb;
}

/* Root Consolidation Banner */
.rectify-root-consolidate-banner {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.root-consolidate-header {
  font-size: 0.8rem;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 6px;
}
.root-consolidate-desc {
  font-size: 0.74rem;
  color: #94a3b8;
  margin: 4px 0 8px 0;
  line-height: 1.3;
}
html:not(.dark) .root-consolidate-desc {
  color: #64748b;
}
.root-consolidate-row {
  display: flex;
  gap: 6px;
}

/* Guidance Tooltips & Pills */
.card-title-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.card-guidance-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  border-radius: 4px;
  cursor: help;
  position: relative;
  max-width: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html:not(.dark) .card-guidance-pill {
  color: #64748b;
  background: rgba(0, 0, 0, 0.04);
}
.card-guidance-pill:hover {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
}

/* Node Issue Badge on Chart */
.node-issue-badge {
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.node-issue-badge:hover {
  transform: scale(1.25);
}

.badge-pulse-warning {
  animation: vantixPulseWarn 2s infinite ease-in-out;
}

.badge-pulse-info {
  animation: vantixPulseInfo 2s infinite ease-in-out;
}

@keyframes vantixPulseWarn {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

@keyframes vantixPulseInfo {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 6px rgba(245, 158, 11, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
