/**
 * Nexa Light Settings Modal Styles
 *
 * Extends app-settings-modal.css with Nexa-specific styling
 *
 * Ergonomic Improvements (2026-03-22):
 * - Fixed scrolling issues in content area with proper flex/overflow handling
 * - Increased padding and spacing throughout for better readability
 * - Enhanced visual hierarchy with improved typography and sizing
 * - Better hover states and transitions for interactive elements
 * - Improved form fields with larger hit areas and better focus states
 * - All scrollable areas now have proper min-height: 0 for flex shrinking
 */

/* ============================================================
 * Two-Column Layout Override for Nexa Settings
 * Left sidebar (tabs) + Right content, both independently scrollable
 * ============================================================ */

/* Prevent the modal itself from scrolling - only children scroll */
.app-settings-modal.nexa-light-settings {
  overflow: hidden;
}

/* Make tabs into a vertical sidebar */
.app-settings-modal.nexa-light-settings .app-settings-tabs {
  flex-direction: column;
  position: absolute;
  top: 65px; /* Below header */
  left: 0;
  bottom: 0;
  width: 200px;
  padding: 16px 12px;
  gap: 4px;
  overflow-y: auto;
  border-bottom: none;
  border-right: 1px solid var(--tv-border, #2a2a4a);
  background: var(--tv-bg-dark, #12121f);
}

.app-settings-modal.nexa-light-settings .app-settings-tab {
  text-align: left;
  padding: 12px 16px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Push content to the right of the sidebar */
.app-settings-modal.nexa-light-settings .app-settings-content {
  position: absolute;
  top: 65px; /* Below header */
  left: 200px; /* After sidebar */
  right: 0;
  bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px;
  /* Ensure scrolling works properly */
  display: flex;
  flex-direction: column;
}

/* Override max-width constraint for Nexa sections */
.app-settings-modal.nexa-light-settings .app-settings-section {
  max-width: none;
  margin-bottom: 24px;
}

/* Toggle Row */
.nexa-settings-toggle-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
}

.nexa-settings-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.nexa-settings-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.nexa-settings-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #555;
  border-radius: 24px;
  transition: 0.3s;
}

.nexa-settings-toggle-slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
}

.nexa-settings-toggle input:checked + .nexa-settings-toggle-slider {
  background-color: #4a9eff;
}

.nexa-settings-toggle input:checked + .nexa-settings-toggle-slider::before {
  transform: translateX(20px);
}

.nexa-settings-toggle-label {
  font-size: 14px;
  color: #e0e0e0;
}

/* System Session Band */
.nexa-settings-band {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  margin-top: 24px;
  background: linear-gradient(135deg, #2a3a4a, #1e2a38);
  border: 1px solid #3a4a5a;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.nexa-settings-band.hover {
  background: linear-gradient(135deg, #3a4a5a, #2a3a4a);
  border-color: #4a9eff;
  box-shadow: 0 4px 12px rgba(74, 158, 255, 0.2);
  transform: translateY(-1px);
}

.nexa-settings-band-icon {
  font-size: 22px;
  opacity: 0.9;
}

.nexa-settings-band-label {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e0;
}

.nexa-settings-band-arrow {
  font-size: 20px;
  color: #aaa;
  transition: color 0.2s, transform 0.2s;
}

.nexa-settings-band.hover .nexa-settings-band-arrow {
  color: #4a9eff;
  transform: translateX(3px);
}

/* Section Header with Button */
.nexa-settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.nexa-settings-section-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: #e0e0e0;
}

/* List Styles */
.nexa-settings-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nexa-settings-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  transition: all 0.2s;
}

.nexa-settings-list-item.hover {
  border-color: #4a9eff;
  background: #2e2e2e;
}

.nexa-settings-list-item-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nexa-settings-list-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #e0e0e0;
}

.nexa-settings-list-item-meta {
  font-size: 12px;
  color: #888;
}

.nexa-settings-list-item-actions {
  display: flex;
  gap: 8px;
}

.nexa-settings-empty {
  text-align: center;
  padding: 32px 24px;
  color: #888;
  font-size: 14px;
  background: #1a1a1a;
  border: 1px dashed #3a3a3a;
  border-radius: 8px;
}

/* Button Styles */
.nexa-settings-btn-add {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: #4a9eff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

.nexa-settings-btn-add.hover {
  background: #3a8eef;
}

.nexa-settings-btn-edit,
.nexa-settings-btn-delete {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #4a4a4a;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.nexa-settings-btn-edit {
  color: #4a9eff;
  background: transparent;
}

.nexa-settings-btn-edit.hover {
  background: rgba(74, 158, 255, 0.15);
  border-color: #4a9eff;
}

.nexa-settings-btn-delete {
  color: #ff6b6b;
  background: transparent;
}

.nexa-settings-btn-delete.hover {
  background: rgba(255, 107, 107, 0.15);
  border-color: #ff6b6b;
}

/* Editor Styles */
.nexa-settings-editor {
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow shrinking for scroll */
  flex: 1; /* Take available space */
}

.nexa-settings-editor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 2px solid #3a3a3a;
  margin-bottom: 20px;
}

.nexa-settings-btn-back {
  padding: 6px 12px;
  font-size: 14px;
  color: #888;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  cursor: pointer;
}

.nexa-settings-btn-back.hover {
  color: #e0e0e0;
  border-color: #4a4a4a;
}

.nexa-settings-editor-title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  color: #e0e0e0;
}

.nexa-settings-btn-save {
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: #4a9eff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.nexa-settings-btn-save.hover {
  background: #3a8eef;
}

/* Form Fields */
.nexa-settings-editor-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0; /* Allow shrinking for scroll */
  padding-right: 8px; /* Space for scrollbar */
}

.nexa-settings-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nexa-settings-field-grow {
  flex: 1;
  min-height: 250px;
  display: flex;
  flex-direction: column;
}

.nexa-settings-label {
  font-size: 13px;
  font-weight: 600;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.nexa-settings-input {
  padding: 12px 14px;
  font-size: 14px;
  color: #e0e0e0;
  background: #2a2a2a;
  border: 2px solid #3a3a3a;
  border-radius: 8px;
  outline: none;
  transition: all 0.2s;
}

.nexa-settings-input:focus {
  border-color: #4a9eff;
  background: #2e2e2e;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.nexa-settings-textarea {
  flex: 1;
  padding: 14px;
  font-size: 14px;
  font-family: 'Consolas', 'Monaco', monospace;
  line-height: 1.6;
  color: #e0e0e0;
  background: #2a2a2a;
  border: 2px solid #3a3a3a;
  border-radius: 8px;
  outline: none;
  resize: none;
  min-height: 200px;
  transition: all 0.2s;
}

.nexa-settings-textarea:focus {
  border-color: #4a9eff;
  background: #2e2e2e;
  box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

/* Blocks Section */
.nexa-settings-blocks-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow shrinking */
}

.nexa-settings-blocks-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.nexa-settings-add-block-dropdown {
  position: relative;
}

.nexa-settings-btn-add-block {
  padding: 6px 12px;
  font-size: 13px;
  color: #4a9eff;
  background: transparent;
  border: 1px solid #4a9eff;
  border-radius: 4px;
  cursor: pointer;
}

.nexa-settings-btn-add-block.hover {
  background: rgba(74, 158, 255, 0.1);
}

.nexa-settings-dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 250px;
  margin-top: 4px;
  padding: 8px 0;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 100;
}

.nexa-settings-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
}

.nexa-settings-dropdown-item.hover {
  background: #3a3a3a;
}

.nexa-settings-dropdown-icon {
  font-size: 16px;
}

.nexa-settings-dropdown-type {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  background: #3a3a3a;
  border-radius: 3px;
  color: #888;
}

.nexa-settings-dropdown-empty {
  padding: 12px 16px;
  text-align: center;
  color: #888;
  font-size: 13px;
}

/* Blocks List */
.nexa-settings-blocks-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  min-height: 120px;
  padding-right: 4px; /* Space for scrollbar */
}

.nexa-settings-blocks-empty {
  text-align: center;
  padding: 28px 20px;
  color: #777;
  font-size: 13px;
  background: #1a1a1a;
  border: 1px dashed #3a3a3a;
  border-radius: 8px;
}

.nexa-settings-block-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  transition: all 0.2s;
}

.nexa-settings-block-item.hover {
  background: #2e2e2e;
  border-color: #4a4a4a;
}

.nexa-settings-block-reorder {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nexa-settings-btn-move {
  padding: 2px 6px;
  font-size: 10px;
  color: #888;
  background: transparent;
  border: 1px solid #3a3a3a;
  border-radius: 3px;
  cursor: pointer;
}

.nexa-settings-btn-move.hover:not(:disabled) {
  color: #e0e0e0;
  border-color: #4a4a4a;
}

.nexa-settings-btn-move:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.nexa-settings-block-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

.nexa-settings-block-icon {
  font-size: 16px;
}

.nexa-settings-block-name {
  font-size: 14px;
  color: #e0e0e0;
}

.nexa-settings-block-type {
  font-size: 10px;
  padding: 2px 6px;
  background: #3a3a3a;
  border-radius: 3px;
  color: #888;
}

.nexa-settings-btn-remove-block {
  padding: 4px 8px;
  font-size: 16px;
  color: #888;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: 4px;
}

.nexa-settings-btn-remove-block.hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

/* System Session Modal */
.nexa-system-session-modal {
  z-index: 201;
}

/* ============================================================
 * Sub-Tabs (for Content Blocks tab)
 * ============================================================ */

.nexa-settings-subtabs-container {
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow shrinking for scroll */
  flex: 1; /* Take available space */
}

.nexa-settings-subtabs {
  display: flex;
  gap: 6px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 2px solid #3a3a3a;
}

.nexa-settings-subtab {
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #888;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.nexa-settings-subtab.hover {
  color: #e0e0e0;
  background: rgba(74, 158, 255, 0.1);
  border-color: rgba(74, 158, 255, 0.3);
}

.nexa-settings-subtab.active {
  color: #fff;
  background: rgba(74, 158, 255, 0.2);
  border-color: #4a9eff;
  box-shadow: 0 2px 8px rgba(74, 158, 255, 0.2);
}

.nexa-settings-subtab-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0; /* Allow shrinking for scroll */
}

/* ============================================================
 * FCB (Function Context Blocks) Specific Styles
 * ============================================================ */

.nexa-settings-list-item-readonly {
  cursor: default;
  background: #1e1e1e;
  border: 1px solid #2a2a2a;
}

.nexa-settings-list-item-readonly.hover {
  border-color: #2a2a2a;
}

.nexa-settings-list-item-readonly .nexa-settings-list-item-info {
  flex-direction: row;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.nexa-settings-fcb-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nexa-settings-fcb-description {
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.nexa-settings-fcb-id {
  font-size: 11px;
  padding: 2px 8px;
  background: #2a2a2a;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  color: #888;
  font-family: monospace;
}
