:root {
  --du-bg-primary: 13 13 17;
  --du-bg-secondary: 18 18 23;
  --du-bg-tertiary: 23 23 27;
  --du-bg-card: 22 21 26;

  --du-text-primary: 249 250 251;
  --du-text-secondary: 209 213 219;
  --du-text-muted: 156 163 175;

  --du-border-color: 43 43 51;
  --du-divider-color: 32 32 40;

  --du-accent: 124 58 237;
  --du-accent-hover: 109 40 217;

  --du-success: 34 197 94;
  --du-warning: 250 204 21;
  --du-danger: 220 53 69;
  --du-info: 56 189 248;
}

[data-theme='light'] {
  --du-bg-primary: 248 250 252;
  --du-bg-secondary: 241 245 249;
  --du-bg-tertiary: 226 232 240;
  --du-bg-card: 255 255 255;

  --du-text-primary: 18 18 23;
  --du-text-secondary: 71 85 105;
  --du-text-muted: 148 163 184;

  --du-border-color: 203 213 225;
  --du-divider-color: 226 232 240;
}

.du-input,
.du-textarea,
.du-btn-primary,
.du-btn-secondary,
.du-btn-ghost {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.du-input.is-invalid,
.du-textarea.is-invalid,
select.du-input.is-invalid {
  border-color: rgb(220 53 69);
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
}

.du-input.is-valid,
.du-textarea.is-valid,
select.du-input.is-valid {
  border-color: rgb(34 197 94);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.2);
}

.form-field-hint {
  font-size: 0.75rem;
  color: rgb(var(--du-text-muted));
}

button.is-loading,
.du-btn-primary.is-loading,
.du-btn-secondary.is-loading {
  pointer-events: none;
  opacity: 0.7;
}

/* Page Loader */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgb(13, 13, 17);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transition: opacity 0.3s ease;
}

#page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
}

.loader-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 1.5rem;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  box-shadow: 0 20px 60px rgba(124, 58, 237, 0.4);
  animation: pulse-glow 2s ease-in-out infinite;
}

.loader-logo svg {
  width: 40px;
  height: 40px;
  color: white;
}

.loader-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid rgba(124, 58, 237, 0.1);
  border-top-color: #7c3aed;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loader-text {
  font-size: 0.875rem;
  color: rgb(156, 163, 175);
  font-weight: 500;
  letter-spacing: 0.05em;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 20px 60px rgba(124, 58, 237, 0.4);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 20px 80px rgba(124, 58, 237, 0.6);
    transform: scale(1.05);
  }
}

/* Enhanced Select Dropdown Styling - Browser Overrides */
select.du-input {
  /* Force color scheme for dropdown */
  color-scheme: dark;
}

/* Chrome, Edge, Safari */
select.du-input option {
  background-color: rgb(18, 18, 23) !important;
  color: rgb(249, 250, 251) !important;
}

select.du-input option:hover,
select.du-input option:focus {
  background-color: rgb(124, 58, 237) !important;
  background: rgb(124, 58, 237) !important;
  color: white !important;
}

select.du-input option:checked {
  background-color: rgb(124, 58, 237) !important;
  background: linear-gradient(rgb(124, 58, 237), rgb(124, 58, 237)) !important;
  color: white !important;
  font-weight: 600;
}

/* Firefox specific overrides */
@-moz-document url-prefix() {
  select.du-input option {
    background-color: rgb(18, 18, 23) !important;
    color: rgb(249, 250, 251) !important;
  }

  select.du-input option:hover {
    background-color: rgb(124, 58, 237) !important;
    color: white !important;
  }

  select.du-input option:checked {
    background-color: rgb(109, 40, 217) !important;
    color: white !important;
  }
}

/* Windows High Contrast override */
@media (prefers-contrast: high) {
  select.du-input option:hover,
  select.du-input option:focus {
    background-color: rgb(124, 58, 237) !important;
    color: white !important;
    outline: 2px solid white;
  }
}

