/* ==========================================================================
   CKEditor Universal Configuration GUI Framework
   Location: /Portals/20/_engine/core/css/ckeditor-gui-framework.css
   ========================================================================== */
.custom-component-container * {
  box-sizing: border-box;
}

/* Universal Staging / Live View Toggle */
.custom-component-container .config-panel {
  display: none;
}

.cke_editable .custom-component-container .config-panel {
  display: block !important;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 28px;
  margin: 0 auto 24px auto;
  max-width: 1200px;
  color: #f1f5f9;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 40px rgba(255, 204, 0, 0.03);
  position: relative;
  z-index: 10;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.cke_editable .custom-component-container .live-panel {
  display: none !important;
}

/* Header Row & ID Management */
.config-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.config-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 240px;
}

.config-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.025em;
}

.config-meta-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.config-id-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(255, 204, 0, 0.25);
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: #94a3b8;
}

.config-id-badge strong {
  color: #ffcc00;
}

.config-id-input {
  background: transparent;
  border: none;
  outline: none;
  color: #f1f5f9;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  min-width: 140px;
}

.config-id-input:focus {
  color: #ffcc00;
}

.config-version-inline,
.config-version-badge {
  margin: 0;
  flex: 0 0 auto;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  color: #ffcc00;
  background: rgba(255, 204, 0, 0.1);
  border: 1px solid rgba(255, 204, 0, 0.2);
  padding: 6px 12px;
  border-radius: 9999px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.config-subtitle {
  margin: -8px 0 16px 0;
  font-size: 13px;
  line-height: 1.6;
  color: #94a3b8;
}

/* 3-Column Universal Grid */
.config-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.config-category {
  grid-column: 1 / -1;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffcc00;
  display: flex;
  align-items: center;
  gap: 12px;
}

.config-category::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.config-field {
  display: grid;
  gap: 8px;
  align-content: start;
  background: rgba(30, 41, 59, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 16px;
  min-width: 0;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.config-field:hover {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(30, 41, 59, 0.45);
}

.config-field-full { grid-column: 1 / -1; }
.config-field-half { grid-column: span 1; }

.config-label-wrap {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px;
  min-width: 0;
  width: 100%;
  flex-wrap: nowrap;
}

.config-label-inner {
  display: flex !important;
  align-items: center !important;
  gap: 8px;
  min-width: 0;
}

.config-label-strong {
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: -0.011em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.config-tag {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.config-help {
  margin: 4px 0 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #64748b;
}

.config-help code {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10.5px;
  color: #ffde59;
}

/* Tooltip Guidance Drawers */
.config-help-toggle {
  display: inline-flex;
  margin: 0;
  padding: 0;
}

.config-help-summary {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 16px;
  height: 16px;
  border-radius: 9999px;
  background: rgba(255, 204, 0, 0.08);
  border: 1px solid rgba(255, 204, 0, 0.25);
  color: #ffcc00;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  line-height: 1;
  outline: none;
  list-style: none;
}

.config-help-summary::-webkit-details-marker { display: none; }

.config-help-summary:hover,
.config-help-toggle[open] .config-help-summary {
  background: #ffcc00;
  border-color: #ffcc00;
  color: #090d16;
  box-shadow: 0 0 8px rgba(255, 204, 0, 0.35);
}

.config-help-drawer {
  display: none;
  width: 100%;
  margin: 4px 0 4px 0;
  background: #040813;
  border: 1px solid rgba(255, 204, 0, 0.25);
  border-left: 3px solid #ffcc00;
  border-radius: 8px;
  padding: 12px 14px;
  color: #cbd5e1;
  font-size: 11px;
  line-height: 1.55;
  animation: drawerSlideDown 0.18s ease-out;
}

@keyframes drawerSlideDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.config-field:has(.config-help-toggle[open]) .config-help-drawer,
.config-field:has(.config-help-summary:hover) .config-help-drawer,
.config-field:has(.config-help-drawer:hover) .config-help-drawer,
.config-header-row:has(.config-help-toggle[open]) .config-help-drawer,
.config-header-row:has(.config-help-summary:hover) .config-help-drawer,
.config-header-row:has(.config-help-drawer:hover) .config-help-drawer {
  display: block !important;
}

.config-help-drawer strong { color: #f1f5f9; font-weight: 700; }
.config-help-drawer code {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10.5px;
  color: #ffde59;
}

.config-help-drawer .help-block { margin-top: 6px; }

.syntax-token,
.syntax-pipe {
  display: inline-block;
  color: #ffcc00;
  font-weight: 900;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11.5px;
  padding: 0 4px;
  user-select: none;
  vertical-align: middle;
  filter: drop-shadow(0 0 4px rgba(255, 204, 0, 0.4));
}

.syntax-badge { display: inline-block; margin: 2px 0; }

/* Form Fields & Lists */
.cfg-val {
  background: #040711;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 10px 14px;
  min-height: 42px;
  width: 100%;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  color: #e2e8f0;
  outline: none;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cfg-val.cfg-short { min-height: 40px; }
.cfg-val.cfg-long { min-height: 52px; }

.cfg-val p, .cfg-val div, .cfg-val span {
  display: inline !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: inherit !important;
  white-space: inherit !important;
  color: inherit !important;
  background: transparent !important;
}

.cfg-val:focus {
  border-color: #ffcc00;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.15);
  background: #02040a;
  color: #ffffff;
}

.cfg-val:empty::before {
  content: attr(data-placeholder);
  color: #64748b;
  font-weight: 500;
}

.cfg-list,
.cfg-list-box {
  min-height: 160px;
  background: #040711;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 16px 12px 32px;
  margin: 8px 0 0 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.6;
  outline: none;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cfg-list:focus,
.cfg-list-box:focus {
  border-color: #ffcc00;
  box-shadow: 0 0 0 3px rgba(255, 204, 0, 0.15);
  background: #02040a;
  color: #ffffff;
}

.config-bottom-note {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  line-height: 1.5;
  color: #475569;
  text-align: center;
}

@media (max-width: 900px) {
  .config-grid { grid-template-columns: 1fr; }
  .config-field-half { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
  .config-header-row { align-items: flex-start; }
  .config-version-inline, .config-version-badge { font-size: 10px; }
  .cke_editable .custom-component-container .config-panel { padding: 18px; }
}
