/* Helix Settings Page Styles */

:root {
	/* Helix Color Palette */
	--helix-color-1: #f1f4fe; /* lightest */
	--helix-color-2: #e4e6ed;
	--helix-color-3: #c8cad3;
	--helix-color-4: #a9adb9;
	--helix-color-5: #9094a3;
	--helix-color-6: #7f8496;
	--helix-color-7: #777c91;
	--helix-color-8: #63687c;
	--helix-color-9: #595e72;
	--helix-color-10: #4a5167; /* darkest */
}

.helix-settings-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Header */
.helix-settings-header {
  margin-bottom: 3rem;
  background: linear-gradient(135deg, var(--helix-color-8) 0%, var(--helix-color-10) 100%);
  color: white;
  padding: 3rem 2rem;
  margin: -2rem 0 3rem -2rem;
  border-radius: 0 0 24px 24px;
  position: relative;
  overflow: hidden;
}

.helix-settings-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.helix-settings-header h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 0.5rem 0;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.helix-settings-header p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  position: relative;
  z-index: 1;
  font-weight: 400;
  line-height: 3;
}

/* Loading State */
.helix-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
}

.helix-loading p {
  margin: 20px 0 0 0;
  font-size: 1.1rem;
  color: var(--helix-color-6);
}

/* Spinner */
.helix-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Controls */
.helix-settings-controls,
.helix-settings-footer {
  display: flex;
  justify-content: center;
  margin: 30px 0;
  padding: 20px 0;
  border-top: 1px solid #e5e7eb;
}

.helix-settings-footer {
  border-bottom: 1px solid #e5e7eb;
  margin-top: 50px;
}

/* Save Buttons */
.helix-save-buttons {
  display: flex;
  align-items: center;
  gap: 15px;
}

.helix-btn {
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.helix-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.helix-btn-primary {
  background: linear-gradient(135deg, var(--helix-color-8) 0%, var(--helix-color-10) 100%);
  color: white;
  border-color: var(--helix-color-8);
  box-shadow: 0 4px 6px -1px rgba(102, 126, 234, 0.2);
}

.helix-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  border-color: #5a6fd8;
  transform: translateY(-1px);
  box-shadow: 0 8px 15px -3px rgba(102, 126, 234, 0.3);
}

.helix-btn-secondary {
  background-color: white;
  color: var(--helix-color-9);
  border-color: #d1d5db;
}

.helix-btn-secondary:hover:not(:disabled) {
  background-color: #f9fafb;
  border-color: #9ca3af;
}

.helix-save-status {
  color: #059669;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Tabs */
.helix-settings-tabs {
  margin: 30px 0;
}

.helix-tabs-nav {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  overflow-x: auto;
  gap: 2px;
}

.helix-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--helix-color-6);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  position: relative;
}

.helix-tab:hover {
  color: var(--helix-color-8);
  background-color: var(--helix-color-1);
}

.helix-tab.active {
  color: var(--helix-color-8);
  border-bottom-color: var(--helix-color-8);
}

.helix-tab-icon {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.helix-tab-icon svg {
  width: 20px;
  height: 20px;
  transition: color 0.2s ease;
}

.helix-tab-indicator {
  color: #f59e0b;
  font-size: 12px;
  position: absolute;
  top: 5px;
  right: 5px;
}

/* Content */
.helix-settings-content {
  margin: 40px 0;
}

.helix-tab-panel {
  min-height: 400px;
}

/* Settings Sections */
.helix-settings-section {
  background: var(--helix-color-1);
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.5);
  overflow: hidden;
  margin-bottom: 30px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.helix-settings-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.helix-settings-section-header {
  background: linear-gradient(135deg, var(--helix-color-1) 0%, var(--helix-color-2) 100%);
  padding: 24px;
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.helix-settings-section-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--helix-color-10);
  margin: 0 0 8px 0;
}

.helix-settings-section-description {
  color: var(--helix-color-6);
  margin: 0;
  font-size: 14px;
}

.helix-settings-section-content {
  padding: 24px;
}

.helix-settings-grid {
  display: grid;
  gap: 24px;
}

.helix-settings-subsection {
  border-top: 1px solid #e5e7eb;
  padding-top: 24px;
  margin-top: 24px;
}

.helix-settings-subsection h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--helix-color-9);
  margin: 0 0 20px 0;
}

/* Form Fields */
.helix-form-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.helix-form-label {
  font-weight: 500;
  color: var(--helix-color-9);
  font-size: 14px;
}

.helix-required {
  color: #ef4444;
  margin-left: 4px;
}

.helix-form-control {
  display: flex;
  flex-direction: column;
}

.helix-form-description {
  font-size: 13px;
  color: var(--helix-color-6);
  margin: 0;
  line-height: 1.4;
}

.helix-form-error {
  font-size: 13px;
  color: #ef4444;
  margin: 0;
}

/* Input Elements */
.helix-text-input,
.helix-number-input,
.helix-select-input {
  padding: 10px 12px;
  border: 1px solid var(--helix-color-3);
  border-radius: 6px;
  font-size: 14px;
  transition: border-color 0.2s ease;
  background: var(--helix-color-1);
}

.helix-text-input:focus,
.helix-number-input:focus,
.helix-select-input:focus {
  outline: none;
  border-color: var(--helix-color-8);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.helix-select-input {
  cursor: pointer;
}

/* Toggle Input */
.helix-toggle-field {
  margin: 16px 0;
}

.helix-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
}

.helix-toggle-label {
  font-weight: 500;
  color: var(--helix-color-9);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.helix-toggle-label-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toggle Switch Button */
.helix-toggle-switch {
  position: relative;
  width: 48px;
  height: 24px;
  border-radius: 24px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  flex-shrink: 0;
  outline: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
}

.helix-toggle-switch:focus {
  box-shadow: 0 0 0 3px var(--helix-color-3);
  outline: none;
}

/* Switch States */
.helix-toggle-switch-off {
  background-color: var(--helix-color-3);
}

.helix-toggle-switch-off:hover:not(:disabled) {
  background-color: var(--helix-color-4);
}

.helix-toggle-switch-on {
  background-color: var(--helix-color-8);
}

.helix-toggle-switch-on:hover:not(:disabled) {
  background-color: var(--helix-color-9);
}

.helix-toggle-switch-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Toggle Knob */
.helix-toggle-knob {
  display: inline-block;
  width: 20px;
  height: 20px;
  background-color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease-in-out;
  transform: translateX(2px);
}

.helix-toggle-knob-on {
  transform: translateX(26px);
}

.helix-toggle-knob-off {
  transform: translateX(2px);
}

/* Notifications */
.helix-notification {
  background: var(--helix-color-1);
  border: 1px solid var(--helix-color-3);
  border-radius: 8px;
  padding: 16px;
  margin: 20px 0;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.helix-notification.visible {
  opacity: 1;
  transform: translateY(0);
}

.helix-notification-success {
  border-left: 4px solid #059669;
  background-color: #f0fdf4;
}

.helix-notification-error {
  border-left: 4px solid #ef4444;
  background-color: #fef2f2;
}

.helix-notification-warning {
  border-left: 4px solid #f59e0b;
  background-color: #fffbeb;
}

.helix-notification-info {
  border-left: 4px solid #667eea;
  background-color: #f0f4ff;
}

.helix-notification-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.helix-notification-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.helix-notification-message {
  flex: 1;
  font-size: 14px;
  color: var(--helix-color-9);
}

.helix-notification-close {
  background: none;
  border: none;
  font-size: 20px;
  color: var(--helix-color-6);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
}

.helix-notification-close:hover {
  color: var(--helix-color-9);
}

/* Responsive Design */
@media (max-width: 768px) {
  .helix-settings-page {
    padding: 15px;
  }

  .helix-settings-header h1 {
    font-size: 2rem;
  }

  .helix-tabs-nav {
    flex-direction: column;
    gap: 0;
  }

  .helix-tab {
    justify-content: flex-start;
    border-bottom: 1px solid #e5e7eb;
    border-right: none;
  }

  .helix-tab.active {
    border-bottom-color: #e5e7eb;
    border-left: 3px solid #667eea;
    background-color: var(--helix-color-1);
  }

  .helix-settings-section-content,
  .helix-settings-section-header {
    padding: 20px;
  }

  .helix-save-buttons {
    flex-direction: column;
    width: 100%;
  }

  .helix-btn {
    width: 100%;
    justify-content: center;
  }
}