/**
 * BDE Mind Map Chart Styles - Updated with Side Panel
 * Version: 2.1.0
 */

/* Import Sarabun font */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;500;600;700&display=swap');

/* Container and Layout */
.bde-mindmap-container-xyz789 {
  font-family: 'Sarabun', sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  position: relative;
  margin: 20px 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .bde-mindmap-container-xyz789 {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
  }
}

/* Header */
.bde-mindmap-header-xyz789 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.1);
}

.bde-mindmap-title-xyz789 {
  font-size: 28px;
  font-weight: 600;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

/* Admin Controls */
.bde-mindmap-admin-controls-xyz789 {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Layout Selector - Enhanced */
.bde-layout-selector-xyz789 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(59, 130, 246, 0.1);
  position: relative;
  overflow: hidden;
}

.bde-layout-selector-xyz789::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ec4899);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.bde-layout-selector-xyz789:hover::before {
  transform: scaleX(1);
}

.bde-layout-selector-xyz789 label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bde-select-xyz789 {
  padding: 10px 14px;
  padding-right: 35px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  font-weight: 500;
  background: white;
  color: #374151;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 200px;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 18px;
}

.bde-select-xyz789:hover {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #f0f9ff 0%, #ffffff 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.bde-select-xyz789:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
  background: white;
}

.bde-select-xyz789:active {
  transform: translateY(0);
}

.bde-select-xyz789 option {
  padding: 8px;
  background: white;
  color: #374151;
}

.bde-select-xyz789 option:hover {
  background: #f3f4f6;
}

@media (prefers-color-scheme: dark) {
  .bde-layout-selector-xyz789 {
    background: #1e293b;
  }

  .bde-layout-selector-xyz789 label {
    color: #e5e7eb;
  }

  .bde-select-xyz789 {
    background: #0f172a;
    border-color: #374151;
    color: #f1f5f9;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f1f5f9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  }

  .bde-select-xyz789:hover {
    border-color: #3b82f6;
    background-color: #1e293b;
  }

  .bde-select-xyz789 option {
    background: #0f172a;
    color: #f1f5f9;
  }
}

/* Main Container with Side Panel Layout */
.bde-mindmap-main-container-xyz789 {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  position: relative;
}

/* Canvas Wrapper - 70% width when panel is shown */
.bde-mindmap-canvas-wrapper-xyz789 {
  flex: 1;
  background: white;
  border-radius: 12px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 5px 15px rgba(0, 0, 0, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 20px;
  overflow: hidden;
  min-height: 400px;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  transition: all 0.3s ease;
}

/* When recommendation panel is visible */
.bde-mindmap-main-container-xyz789:has(#bde-recommendation-panel:not([style*="display: none"])) .bde-mindmap-canvas-wrapper-xyz789 {
  flex: 0 0 calc(70% - 10px);
}

/* Prevent text selection during pan */
.bde-mindmap-container-xyz789.panning * {
  user-select: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
}

/* Zoom Controls */
.bde-zoom-controls-xyz789 {
  position: absolute;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: white;
  padding: 8px;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.1);
  z-index: 100;
}

.bde-zoom-btn-xyz789 {
  width: 40px;
  height: 40px;
  border: none;
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  color: #374151;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bde-zoom-btn-xyz789:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.bde-zoom-btn-xyz789:active {
  transform: scale(0.95);
}

.bde-zoom-level-xyz789 {
  width: 40px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Sarabun', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 6px;
  border: 1px solid #bfdbfe;
}

/* Zoom Lock Status Badge - Compact Design */
.bde-zoom-lock-status-xyz789 {
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
  animation: lockPulse 2s ease-in-out infinite;
}

.bde-zoom-lock-status-xyz789 .lock-badge {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-radius: 6px;
  color: white;
  flex-shrink: 0;
}

.bde-zoom-lock-status-xyz789 .unlock-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Sarabun', sans-serif;
}

.bde-zoom-lock-status-xyz789 .unlock-btn:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border-color: #f59e0b;
  color: white;
  transform: scale(1.02);
}

.bde-zoom-lock-status-xyz789 .unlock-btn svg {
  flex-shrink: 0;
}

@keyframes lockPulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
  }
  50% {
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
  }
}

/* Zoom Controls - Locked State */
.bde-zoom-controls-xyz789.locked {
  border: 2px solid #f59e0b;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
}

/* EndNode List Styling */
.endpoint-content ul,
.endpoint-content ol {
  margin: 0;
  padding-left: 18px;
  text-align: left;
}

.endpoint-content li {
  margin-bottom: 3px;
  line-height: 1.4;
  color: white;
}

.endpoint-content ul {
  list-style-type: disc;
}

.endpoint-content ol {
  list-style-type: decimal;
}

@media (prefers-color-scheme: dark) {
  .bde-mindmap-canvas-wrapper-xyz789 {
    background: #1e293b;
  }
}

/* Recommendation Panel - 30% width on the right */
.bde-mindmap-recommendation-xyz789 {
  flex: 0 0 calc(30% - 10px);
  animation: slideInRight 0.3s ease;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.bde-recommendation-card-xyz789 {
  background: white;
  border-radius: 12px;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.05),
    0 5px 15px rgba(0, 0, 0, 0.08),
    0 10px 30px rgba(0, 0, 0, 0.1);
  padding: 25px;
}

@media (prefers-color-scheme: dark) {
  .bde-recommendation-card-xyz789 {
    background: #1e293b;
  }
}

.bde-recommendation-card-xyz789 h3 {
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
}

@media (prefers-color-scheme: dark) {
  .bde-recommendation-card-xyz789 h3 {
    color: #f1f5f9;
    border-bottom-color: #374151;
  }
}

/* Path List Section */
.bde-path-list-xyz789 {
  margin-bottom: 20px;
}

.bde-path-items-xyz789 {
  list-style: none;
  padding: 0;
  margin: 0;
}

.bde-path-items-xyz789 li {
  padding: 10px 15px;
  margin-bottom: 8px;
  background: #f8f9fa;
  border-left: 4px solid #3b82f6;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.bde-path-items-xyz789 li:hover {
  background: #eff6ff;
  transform: translateX(3px);
}

@media (prefers-color-scheme: dark) {
  .bde-path-items-xyz789 li {
    background: #0f172a;
    color: #e5e7eb;
  }

  .bde-path-items-xyz789 li:hover {
    background: #1e293b;
  }
}

/* Path level indicator */
.bde-path-items-xyz789 li::before {
  content: '▶';
  color: #3b82f6;
  font-size: 10px;
}

.bde-path-items-xyz789 li.path-root {
  border-left-color: #10b981;
  font-weight: 600;
}

.bde-path-items-xyz789 li.path-root::before {
  content: '🏠';
  font-size: 14px;
}

.bde-path-items-xyz789 li.path-endpoint {
  border-left-color: #f59e0b;
  background: #fef3c7;
}

@media (prefers-color-scheme: dark) {
  .bde-path-items-xyz789 li.path-endpoint {
    background: #451a03;
  }
}

.bde-path-items-xyz789 li.path-endpoint::before {
  content: '🎯';
  font-size: 14px;
}

/* Recommendation Section */
.bde-recommendation-section-xyz789 {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #e5e7eb;
}

@media (prefers-color-scheme: dark) {
  .bde-recommendation-section-xyz789 {
    border-top-color: #374151;
  }
}

.bde-recommendation-section-xyz789 h3 {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border: none;
  padding-bottom: 0;
}

.bde-recommendation-text-xyz789 {
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.bde-recommendation-text-xyz789 .rec-item {
  padding: 12px 15px;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-radius: 8px;
  border-left: 4px solid #10b981;
  color: #14532d;
}

.bde-recommendation-text-xyz789 .rec-item strong {
  color: #14532d;
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
}

@media (prefers-color-scheme: dark) {
  .bde-recommendation-text-xyz789 {
    color: #e5e7eb;
  }

  .bde-recommendation-text-xyz789 .rec-item {
    background: linear-gradient(135deg, #064e3b 0%, #022c22 100%);
    border-left-color: #10b981;
    color: #d1fae5;
  }

  .bde-recommendation-text-xyz789 .rec-item strong {
    color: #86efac;
  }
}

/* Buttons */
.bde-btn-primary-xyz789,
.bde-btn-secondary-xyz789,
.bde-btn-danger-xyz789 {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.bde-btn-primary-xyz789 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
}

.bde-btn-primary-xyz789:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.3);
}

.bde-btn-primary-xyz789.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.bde-btn-secondary-xyz789 {
  background: linear-gradient(135deg, #64748b 0%, #475569 100%);
  color: white;
}

.bde-btn-secondary-xyz789:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(100, 116, 139, 0.3);
}

.bde-btn-danger-xyz789 {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.bde-btn-danger-xyz789:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.3);
}

.bde-btn-info-xyz789 {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  color: white;
}

.bde-btn-info-xyz789:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.3);
}

/* SVG Styles */
.bde-mindmap-svg-xyz789 {
  display: block;
  width: 100%;
}

/* Smooth transitions for layout changes */
.nodes-group g {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.connections-group path {
  transition: d 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    stroke 0.3s ease,
    opacity 0.3s ease;
}

.mindmap-node {
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}

.mindmap-node.dragging {
  opacity: 0.7;
  transition: opacity 0.1s ease;
}

.node-rect {
  transition: fill 0.3s ease,
    stroke 0.3s ease,
    filter 0.3s ease,
    transform 0.2s ease;
}

.node-rect:hover {
  filter: brightness(1.05) drop-shadow(0 4px 12px rgba(59, 130, 246, 0.15));
  stroke-width: 3 !important;
}

.node-rect.draggable {
  cursor: move !important;
}

.node-rect.selected {
  stroke: #3b82f6 !important;
  stroke-width: 3 !important;
  filter: drop-shadow(0 4px 16px rgba(59, 130, 246, 0.3));
}

.mindmap-connection {
  transition: stroke 0.3s ease,
    stroke-width 0.3s ease,
    opacity 0.3s ease;
  opacity: 0.6;
}

.mindmap-connection.selected-path {
  opacity: 1;
  stroke-width: 3 !important;
}

.edit-btn,
.add-btn {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mindmap-node:hover .edit-btn,
.mindmap-node:hover .add-btn {
  opacity: 1;
}

/* Level Control Styles */
.level-control {
  cursor: pointer;
  transition: all 0.3s ease;
}

.level-control:hover rect {
  fill: #e5e7eb !important;
}

.level-control text {
  user-select: none;
  pointer-events: none;
}

/* Node states */
.node-rect.hidden-node {
  fill: #fef2f2 !important;
  stroke: #ef4444 !important;
  stroke-dasharray: 5, 3 !important;
  opacity: 0.6 !important;
}

.mindmap-connection.hidden-connection {
  stroke: #ef4444 !important;
  stroke-dasharray: 5, 5 !important;
  opacity: 0.3 !important;
}

/* Modal */
.bde-modal-xyz789 {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.bde-modal-content-xyz789 {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-color-scheme: dark) {
  .bde-modal-content-xyz789 {
    background: #1e293b;
    color: #f1f5f9;
  }
}

.bde-modal-header-xyz789 {
  padding: 20px 25px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bde-modal-header-xyz789 h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.bde-modal-close-xyz789 {
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.bde-modal-close-xyz789:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.bde-modal-body-xyz789 {
  padding: 25px;
}

/* Form Elements */
.bde-form-group-xyz789 {
  margin-bottom: 20px;
}

.bde-form-group-xyz789 label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #374151;
  font-size: 14px;
}

@media (prefers-color-scheme: dark) {
  .bde-form-group-xyz789 label {
    color: #d1d5db;
  }
}

.bde-input-xyz789,
.bde-textarea-xyz789 {
  width: 100%;
  padding: 10px 15px;
  border: 2px solid #e5e7eb;
  border-radius: 8px;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  transition: all 0.3s ease;
  background: white;
}

.bde-input-xyz789[type="number"] {
  -moz-appearance: textfield;
}

.bde-input-xyz789[type="number"]::-webkit-outer-spin-button,
.bde-input-xyz789[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

@media (prefers-color-scheme: dark) {

  .bde-input-xyz789,
  .bde-textarea-xyz789 {
    background: #0f172a;
    border-color: #374151;
    color: #f1f5f9;
  }
}

.bde-input-xyz789:focus,
.bde-textarea-xyz789:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bde-textarea-xyz789 {
  resize: vertical;
  min-height: 100px;
}

.bde-form-group-xyz789 input[type="checkbox"] {
  margin-right: 8px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.bde-form-actions-xyz789 {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

/* Initial Hint Overlay */
.bde-initial-hint-xyz789 {
  position: absolute;
  bottom: 20px;
  left: 35%;
  transform: translateX(-50%);
  z-index: 100;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }

  50% {
    transform: translateX(-50%) scale(1.05);
  }
}

.bde-hint-content-xyz789 {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: white;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(59, 130, 246, 0.3);
  text-align: center;
}

.bde-hint-text-th {
  font-size: 16px;
  margin: 0 0 5px 0;
  font-weight: 500;
}

.bde-hint-text-en {
  font-size: 14px;
  margin: 0 0 8px 0;
  opacity: 0.9;
  font-style: italic;
}

.bde-hint-controls {
  font-size: 11px;
  margin: 0;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  opacity: 0.8;
  font-family: 'Courier New', monospace;
  line-height: 1.4;
}

.bde-initial-hint-xyz789.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
}

/* Node pulse effect for root in view mode */
.mindmap-node[data-id="root"] .node-rect {
  animation: nodePulse 2s ease-in-out infinite;
}

@keyframes nodePulse {

  0%,
  100% {
    filter: url(#dropShadow) brightness(1);
  }

  50% {
    filter: url(#dropShadow) brightness(1.1);
  }
}

/* Loading Spinner */
.bde-loading-xyz789 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  z-index: 9999;
}

@media (prefers-color-scheme: dark) {
  .bde-loading-xyz789 {
    background: rgba(15, 23, 42, 0.9);
  }
}

.bde-spinner-xyz789 {
  width: 50px;
  height: 50px;
  border: 4px solid #e5e7eb;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tooltip Styles */
.bde-mindmap-tooltip-xyz789 {
  position: fixed;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 10002;
  font-family: 'Sarabun', sans-serif;
  font-size: 13px;
  max-width: 300px;
  pointer-events: none;
}

.bde-mindmap-tooltip-xyz789 .tooltip-header {
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid #e5e7eb;
  font-size: 14px;
}

.bde-mindmap-tooltip-xyz789 .tooltip-header.active {
  color: #22c55e;
  border-bottom-color: #86efac;
}

.bde-mindmap-tooltip-xyz789 .tooltip-path {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bde-mindmap-tooltip-xyz789 .path-item {
  display: flex;
  align-items: center;
  padding: 4px 8px;
  background: #f9fafb;
  border-radius: 4px;
  color: #374151;
  transition: all 0.2s ease;
}

.bde-mindmap-tooltip-xyz789 .path-item.level-0 {
  background: #dbeafe;
  color: #1e40af;
  font-weight: 600;
}

.bde-mindmap-tooltip-xyz789 .path-item.level-1 {
  margin-left: 10px;
}

.bde-mindmap-tooltip-xyz789 .path-item.level-2 {
  margin-left: 20px;
}

.bde-mindmap-tooltip-xyz789 .path-item.level-3 {
  margin-left: 30px;
}

.bde-mindmap-tooltip-xyz789 .path-arrow {
  color: #3b82f6;
  margin-right: 6px;
  font-weight: bold;
}

.bde-mindmap-tooltip-xyz789 .tooltip-recommendation {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.4;
}

@media (prefers-color-scheme: dark) {
  .bde-mindmap-tooltip-xyz789 {
    background: #1e293b;
    border-color: #374151;
  }

  .bde-mindmap-tooltip-xyz789 .tooltip-header {
    color: #e5e7eb;
    border-bottom-color: #374151;
  }

  .bde-mindmap-tooltip-xyz789 .tooltip-header.active {
    color: #86efac;
    border-bottom-color: #22c55e;
  }

  .bde-mindmap-tooltip-xyz789 .path-item {
    background: #0f172a;
    color: #e5e7eb;
  }

  .bde-mindmap-tooltip-xyz789 .path-item.level-0 {
    background: #1e3a8a;
    color: #dbeafe;
  }

  .bde-mindmap-tooltip-xyz789 .tooltip-recommendation {
    border-top-color: #374151;
    color: #9ca3af;
  }
}

/* Endpoint Summary Styles */
.bde-endpoint-summary-xyz789 {
  margin-top: 20px;
  padding: 15px;
  background: linear-gradient(135deg, #fef3c7 0%, #fed7aa 100%);
  border-radius: 8px;
  border-left: 4px solid #f59e0b;
}

.bde-endpoint-summary-xyz789 h4 {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 600;
  color: #92400e;
}

.bde-endpoint-summary-xyz789 ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bde-endpoint-summary-xyz789 li {
  padding: 8px 10px;
  font-size: 13px;
  color: #78350f;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.bde-endpoint-summary-xyz789 li.active-endpoint {
  background: #22c55e;
  color: white;
  font-weight: 600;
}

.bde-endpoint-summary-xyz789 li:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: translateX(3px);
}

.bde-endpoint-summary-xyz789 li.active-endpoint:hover {
  background: #16a34a;
}

.bde-endpoint-summary-xyz789 .endpoint-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  background: #f59e0b;
  color: white;
  border-radius: 50%;
  font-weight: bold;
  font-size: 12px;
  box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
}

.bde-endpoint-summary-xyz789 li.active-endpoint .endpoint-number {
  background: white;
  color: #22c55e;
}

.bde-endpoint-summary-xyz789 .endpoint-label {
  flex: 1;
}

/* Path List Updates */
.bde-path-items-xyz789 li.active-endpoint {
  background: #dcfce7;
  border-left-color: #22c55e;
  font-weight: 600;
}

.bde-path-items-xyz789 li.active-endpoint::before {
  content: '✓';
  color: #22c55e;
  font-size: 14px;
}

@media (prefers-color-scheme: dark) {
  .bde-endpoint-summary-xyz789 {
    background: linear-gradient(135deg, #451a03 0%, #78350f 100%);
    border-left-color: #f59e0b;
  }

  .bde-endpoint-summary-xyz789 h4 {
    color: #fbbf24;
  }

  .bde-endpoint-summary-xyz789 li {
    color: #fed7aa;
    background: rgba(0, 0, 0, 0.3);
  }

  .bde-endpoint-summary-xyz789 li.active-endpoint {
    background: #22c55e;
    color: white;
  }

  .bde-endpoint-summary-xyz789 li:hover {
    background: rgba(0, 0, 0, 0.5);
  }

  .bde-endpoint-summary-xyz789 li.active-endpoint:hover {
    background: #16a34a;
  }

  .bde-endpoint-summary-xyz789 .endpoint-number {
    background: #f59e0b;
    color: #451a03;
  }

  .bde-endpoint-summary-xyz789 li.active-endpoint .endpoint-number {
    background: white;
    color: #22c55e;
  }

  .bde-path-items-xyz789 li.active-endpoint {
    background: #064e3b;
    border-left-color: #22c55e;
  }
}

/* Message Notifications */
.bde-message-xyz789 {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 10001;
}

.bde-message-xyz789.show {
  transform: translateX(0);
}

.bde-message-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bde-message-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.bde-message-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.bde-message-xyz789 {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateX(400px);
  transition: transform 0.3s ease;
  z-index: 10001;
}

.bde-message-xyz789.show {
  transform: translateX(0);
}

.bde-message-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.bde-message-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.bde-message-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Icons */
.bde-icon-edit-xyz789,
.bde-icon-save-xyz789 {
  font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {

  /* Stack vertically on tablets */
  .bde-mindmap-main-container-xyz789 {
    flex-direction: column;
  }

  .bde-mindmap-main-container-xyz789:has(#bde-recommendation-panel:not([style*="display: none"])) .bde-mindmap-canvas-wrapper-xyz789 {
    flex: 1;
  }

  .bde-mindmap-recommendation-xyz789 {
    flex: 1;
    width: 100%;
    position: static;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .bde-mindmap-container-xyz789 {
    padding: 20px;
    border-radius: 8px;
  }

  .bde-mindmap-header-xyz789 {
    flex-direction: column;
    align-items: flex-start;
    gap: 15px;
  }

  .bde-mindmap-title-xyz789 {
    font-size: 24px;
  }

  .bde-mindmap-admin-controls-xyz789 {
    width: 100%;
    justify-content: flex-start;
  }

  .bde-btn-primary-xyz789,
  .bde-btn-secondary-xyz789,
  .bde-btn-danger-xyz789 {
    padding: 8px 16px;
    font-size: 13px;
  }

  .bde-modal-content-xyz789 {
    width: 95%;
    margin: 10px;
  }

  .bde-mindmap-canvas-wrapper-xyz789 {
    padding: 15px;
    min-height: 300px;
  }

  .bde-initial-hint-xyz789 {
    left: 50%;
  }
}

@media (max-width: 480px) {
  .bde-mindmap-container-xyz789 {
    padding: 15px;
    margin: 10px 0;
  }

  .bde-mindmap-header-xyz789 {
    margin-bottom: 20px;
    padding-bottom: 15px;
  }

  .bde-mindmap-title-xyz789 {
    font-size: 20px;
  }

  .bde-btn-primary-xyz789,
  .bde-btn-secondary-xyz789,
  .bde-btn-danger-xyz789 {
    padding: 6px 12px;
    font-size: 12px;
    gap: 4px;
  }

  .bde-form-actions-xyz789 {
    flex-direction: column;
  }

  .bde-form-actions-xyz789 button {
    width: 100%;
  }

  .bde-message-xyz789 {
    right: 10px;
    left: 10px;
    transform: translateY(-100px);
  }

  .bde-message-xyz789.show {
    transform: translateY(0);
  }
}

/* Focus States for Accessibility */
*:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* Print Styles */
@media print {

  .bde-mindmap-admin-controls-xyz789,
  .bde-modal-xyz789,
  .bde-loading-xyz789,
  .bde-initial-hint-xyz789 {
    display: none !important;
  }

  .bde-mindmap-container-xyz789 {
    box-shadow: none;
    background: white;
    padding: 10px;
    page-break-inside: avoid;
  }

  .bde-mindmap-main-container-xyz789 {
    flex-direction: row !important;
  }

  .bde-mindmap-canvas-wrapper-xyz789 {
    box-shadow: none;
    border: 1px solid #e5e7eb;
    background: white;
    flex: 0 0 65% !important;
  }

  .bde-mindmap-recommendation-xyz789 {
    flex: 0 0 33% !important;
  }

  .bde-recommendation-card-xyz789 {
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }

  .bde-mindmap-svg-xyz789 {
    width: 100%;
    height: auto;
    max-width: 100%;
  }

  .mindmap-node .edit-btn,
  .mindmap-node .add-btn {
    display: none !important;
  }

  /* Ensure all text is visible */
  text {
    fill: black !important;
  }

  .node-rect {
    fill: white !important;
    stroke: #333 !important;
  }

  .mindmap-connection {
    stroke: #666 !important;
    opacity: 1 !important;
  }

  /* Show all expanded nodes for printing */
  .connections-group,
  .nodes-group {
    display: block !important;
    visibility: visible !important;
  }
}


/* Print Button Styles */
.bde-btn-print-xyz789 {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
  margin-right: 10px;
}

.bde-btn-print-xyz789:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.3);
  background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}

.bde-btn-print-xyz789:active {
  transform: translateY(0);
}

.bde-btn-print-xyz789.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* Icon for print button */
.bde-icon-print-xyz789 {
  font-size: 16px;
}

/* Controls wrapper to organize buttons */
.bde-mindmap-controls-wrapper-xyz789 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Show print button when there are active selections */
.bde-mindmap-container-xyz789:has(.active-endpoint) #bde-print-report {
  display: inline-flex !important;
}

/* Header adjustments */
.bde-mindmap-header-xyz789 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(59, 130, 246, 0.1);
  flex-wrap: wrap;
  gap: 15px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .bde-mindmap-controls-wrapper-xyz789 {
    width: 100%;
    justify-content: flex-start;
  }

  .bde-btn-print-xyz789 {
    width: 100%;
    justify-content: center;
    margin-right: 0;
    margin-bottom: 10px;
  }

  .bde-mindmap-admin-controls-xyz789 {
    width: 100%;
  }
}

/* Print-specific styles for main interface */
@media print {

  .bde-mindmap-header-xyz789,
  .bde-mindmap-admin-controls-xyz789,
  .bde-btn-print-xyz789,
  .bde-modal-xyz789,
  .bde-loading-xyz789,
  .bde-initial-hint-xyz789,
  #bde-edit-mode-toggle,
  #bde-save-map,
  #bde-layout-selector {
    display: none !important;
  }

  .bde-mindmap-container-xyz789 {
    box-shadow: none;
    background: white;
    padding: 10px;
  }

  .bde-mindmap-main-container-xyz789 {
    flex-direction: column;
  }

  .bde-mindmap-canvas-wrapper-xyz789 {
    box-shadow: none;
    border: 1px solid #e5e7eb;
    flex: 1 !important;
    width: 100% !important;
    margin-bottom: 20px;
  }

  .bde-mindmap-recommendation-xyz789 {
    flex: 1 !important;
    width: 100% !important;
    page-break-inside: avoid;
  }

  .bde-recommendation-card-xyz789 {
    box-shadow: none;
    border: 1px solid #e5e7eb;
  }
}

/* Rule Engine Alerts */
.bde-rule-alerts {
  position: fixed;
  top: 20px;
  right: 20px;
  max-width: 400px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: opacity 0.3s ease-in-out;
}

.bde-rule-alert {
  background: white;
  border-radius: 8px;
  padding: 12px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-left: 4px solid;
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.bde-rule-alert.warning {
  border-left-color: #f59e0b;
  background: #fef3c7;
}

.bde-rule-alert.error {
  border-left-color: #ef4444;
  background: #fee2e2;
}

.bde-rule-alert.info {
  border-left-color: #3b82f6;
  background: #dbeafe;
}

.bde-rule-alert .alert-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.bde-rule-alert .alert-content {
  flex: 1;
  min-width: 0;
}

.bde-rule-alert .alert-content strong {
  display: block;
  font-weight: 600;
  margin-bottom: 4px;
  color: #111827;
}

.bde-rule-alert .alert-details {
  font-size: 14px;
  color: #4b5563;
  line-height: 1.4;
}

.bde-rule-alert .alert-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  margin: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
}

.bde-rule-alert .alert-close:hover {
  color: #111827;
}

/* Visual indicators for nodes with rules */
.bde-node-with-rules {
  stroke: #8b5cf6 !important;
  stroke-width: 2px;
  stroke-dasharray: 3, 2;
}

.bde-node-rule-conflict {
  stroke: #ef4444 !important;
  stroke-width: 3px;
}

.bde-node-rule-required {
  stroke: #3b82f6 !important;
  stroke-width: 2px;
  stroke-dasharray: 5, 3;
}

/* Rule Manager Modal */
.bde-rule-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 20px;
}

.bde-rule-modal {
  background: white;
  border-radius: 12px;
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.bde-rule-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid #e5e7eb;
}

.bde-rule-modal-header h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 600;
  color: #111827;
}

.bde-rule-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  cursor: pointer;
  color: #6b7280;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.bde-rule-modal-close:hover {
  background: #f3f4f6;
  color: #111827;
}

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

.bde-rule-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 24px;
  border-top: 1px solid #e5e7eb;
}

.bde-rules-section {
  margin-bottom: 32px;
}

.bde-rules-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.bde-rules-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.bde-btn-add-rule {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s;
}

.bde-btn-add-rule:hover {
  background: #2563eb;
}

.bde-rules-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 16px;
}

.bde-no-rules {
  text-align: center;
  color: #6b7280;
  padding: 40px 20px;
  background: #f9fafb;
  border-radius: 8px;
  border: 2px dashed #e5e7eb;
}

.bde-rule-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.bde-rule-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  border-color: #3b82f6;
}

.bde-rule-card.disabled {
  opacity: 0.6;
  background: #f9fafb;
}

.bde-rule-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bde-rule-type-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.bde-type-dependency {
  background: #dbeafe;
  color: #1e40af;
}

.bde-type-exclusion {
  background: #fee2e2;
  color: #991b1b;
}

.bde-type-prerequisite {
  background: #fef3c7;
  color: #92400e;
}

.bde-type-count {
  background: #e0e7ff;
  color: #3730a3;
}

.bde-type-mutex {
  background: #fce7f3;
  color: #831843;
}

.bde-type-custom {
  background: #f3e8ff;
  color: #6b21a8;
}

.bde-rule-card-actions {
  display: flex;
  gap: 8px;
}

.bde-btn-icon {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: background 0.2s;
}

.bde-btn-icon:hover {
  background: #f3f4f6;
}

.bde-rule-name {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: #111827;
}

.bde-rule-message {
  margin: 0 0 12px 0;
  font-size: 14px;
  color: #4b5563;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.bde-severity-icon {
  flex-shrink: 0;
}

.bde-rule-conditions-summary {
  font-size: 13px;
  color: #6b7280;
  background: #f9fafb;
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.bde-rule-conditions-summary strong {
  color: #111827;
  font-weight: 600;
}

.bde-rule-status {
  font-size: 13px;
}

.status-enabled {
  color: #059669;
  font-weight: 500;
}

.status-disabled {
  color: #dc2626;
  font-weight: 500;
}

.bde-rule-editor {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 24px;
  margin-bottom: 32px;
}

.bde-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.bde-editor-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.bde-btn-cancel-edit {
  background: white;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.bde-btn-cancel-edit:hover {
  background: #f3f4f6;
}

.bde-rule-form {
  background: white;
  padding: 20px;
  border-radius: 8px;
}

.bde-form-group {
  margin-bottom: 20px;
}

.bde-form-group label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  color: #374151;
  margin-bottom: 6px;
}

.required {
  color: #dc2626;
}

.bde-form-group input[type="text"],
.bde-form-group input[type="number"],
.bde-form-group select,
.bde-form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.bde-form-group input:focus,
.bde-form-group select:focus,
.bde-form-group textarea:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.bde-form-group textarea {
  resize: vertical;
  min-height: 80px;
}

.bde-form-group select[multiple] {
  min-height: 120px;
}

.bde-field-help,
.bde-form-group small {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

.bde-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.bde-form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #e5e7eb;
}

.bde-btn-primary {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.bde-btn-primary:hover {
  background: #2563eb;
}

.bde-btn-primary:disabled {
  background: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

.bde-btn-secondary {
  background: white;
  border: 1px solid #d1d5db;
  color: #374151;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.bde-btn-secondary:hover {
  background: #f3f4f6;
}

.bde-available-nodes {
  background: white;
  padding: 12px;
  border-radius: 6px;
  margin-top: 12px;
  font-size: 13px;
  color: #6b7280;
}

.bde-available-nodes code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 12px;
  color: #111827;
}

.bde-rule-settings {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 20px;
}

.bde-rule-settings h3 {
  margin: 0 0 16px 0;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.bde-settings-grid {
  display: grid;
  gap: 16px;
}

.bde-settings-grid label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
}

.bde-settings-grid input[type="checkbox"] {
  margin-top: 2px;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.bde-settings-grid label>span {
  font-weight: 500;
  font-size: 14px;
  color: #374151;
  display: block;
}

.bde-settings-grid label small {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-top: 2px;
  font-weight: normal;
}

@media (max-width: 768px) {
  .bde-rule-modal {
    max-width: 100%;
    max-height: 95vh;
    margin: 10px;
  }

  .bde-rules-list {
    grid-template-columns: 1fr;
  }

  .bde-form-row {
    grid-template-columns: 1fr;
  }

  .bde-rule-modal-header h2 {
    font-size: 20px;
  }
}

/* ============================================
   Utility Classes - Moved from inline styles
   ============================================ */

/* Display utilities */
.bde-hidden {
  display: none !important;
}

.bde-show {
  display: block !important;
}

.bde-show-flex {
  display: flex !important;
}

.bde-show-inline-flex {
  display: inline-flex !important;
}

/* Fallback template styles - Moved from PHP inline styles */
.bde-fallback-mindmap-title {
  font-size: 14px;
  margin-bottom: 8px;
}

.bde-no-image-fallback {
  height: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 2px dashed #cbd5e1;
  gap: 10px;
  padding: 20px;
  text-align: center;
}

.bde-no-image-icon {
  font-size: 48px;
}

.bde-no-image-title {
  font-size: 14px;
  color: #64748b;
  font-weight: 600;
}

.bde-no-image-message {
  font-size: 10px;
  color: #94a3b8;
  max-width: 300px;
}

.bde-fallback-endpoints-title {
  font-size: 12px;
  margin: 8px 0;
}

.bde-fallback-endpoint-rec {
  font-size: 9px;
}

/* Initial state - elements hidden by default */
#bde-print-report,
#bde-auto-layout-btn,
#bde-manage-rules-btn,
#bde-layout-selector,
#bde-auto-layout-settings,
#bde-save-map,
#bde-recommendation-panel,
#bde-recommendation-section,
#bde-endpoint-summary,
#bde-edit-modal,
#width-input-group,
#recommendation-group,
#bde-loading,
#bde-rule-modal-overlay,
#bde-rule-editor {
  display: none;
}

/* Dark mode adjustments for fallback */
@media (prefers-color-scheme: dark) {
  .bde-no-image-fallback {
    border-color: #374151;
  }

  .bde-no-image-title {
    color: #e5e7eb;
  }

  .bde-no-image-message {
    color: #6b7280;
  }
}
