/* mittwald Flow Design System - Modern Professional Theme */
:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  
  /* mittwald Brand Colors */
  --mw-color-navy: #1a1f35;
  --mw-color-navy-dark: #0f1320;
  --mw-color-primary: #0066cc;
  --mw-color-primary-dark: #0052a3;
  --mw-color-success: #10b981;
  --mw-color-success-dark: #059669;
  --mw-color-error: #ef4444;
  --mw-color-warning: #f59e0b;
  
  /* Background Colors */
  --mw-bg-primary: #ffffff;
  --mw-bg-secondary: #f8fafc;
  --mw-bg-tertiary: #f1f5f9;
  
  /* Text Colors */
  --mw-text-primary: #0f172a;
  --mw-text-secondary: #475569;
  --mw-text-tertiary: #94a3b8;
  --mw-text-on-dark: #ffffff;
  
  /* Border Colors */
  --mw-border-light: #e2e8f0;
  --mw-border-medium: #cbd5e1;
  --mw-border-dark: #94a3b8;
  
  /* Spacing */
  --mw-space-xs: 4px;
  --mw-space-sm: 8px;
  --mw-space-md: 12px;
  --mw-space-lg: 16px;
  --mw-space-xl: 24px;
  --mw-space-2xl: 32px;
  --mw-space-3xl: 48px;
  
  /* Border Radius */
  --mw-radius-sm: 6px;
  --mw-radius-md: 8px;
  --mw-radius-lg: 12px;
  --mw-radius-xl: 16px;
  --mw-radius-full: 9999px;
  
  /* Shadows */
  --mw-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --mw-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --mw-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --mw-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --mw-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  
  /* Transitions */
  --mw-transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --mw-transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --mw-transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Theme transition */
  transition: background-color var(--mw-transition-slow), color var(--mw-transition-slow);
}

/* Dark Mode Theme */
[data-theme="dark"] {
  /* Background Colors */
  --mw-bg-primary: #1e293b;
  --mw-bg-secondary: #0f172a;
  --mw-bg-tertiary: #1e293b;
  
  /* Text Colors */
  --mw-text-primary: #f1f5f9;
  --mw-text-secondary: #cbd5e1;
  --mw-text-tertiary: #94a3b8;
  
  /* Border Colors */
  --mw-border-light: #334155;
  --mw-border-medium: #475569;
  --mw-border-dark: #64748b;
  
  /* Shadows - darker in dark mode */
  --mw-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --mw-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --mw-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --mw-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.4);
  --mw-shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

/* Smooth theme transition */
body,
body * {
  transition: background-color var(--mw-transition-slow), 
              color var(--mw-transition-slow),
              border-color var(--mw-transition-slow),
              box-shadow var(--mw-transition-slow);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--mw-bg-secondary);
  color: var(--mw-text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Header/Navigation Style */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--mw-space-2xl);
  animation: slideUp 0.5s ease-out;
}

/* Hero Section Style */
.header-section {
  background: linear-gradient(135deg, #6366f1 0%, var(--mw-color-primary) 50%, #1e40af 100%);
  border-radius: var(--mw-radius-xl);
  padding: var(--mw-space-3xl) var(--mw-space-2xl);
  margin-bottom: var(--mw-space-2xl);
  color: var(--mw-text-on-dark);
  box-shadow: var(--mw-shadow-xl);
  position: relative;
  overflow: hidden;
}

.header-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.header-section h1 {
  margin: 0 0 var(--mw-space-md) 0;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--mw-text-on-dark);
  position: relative;
  z-index: 1;
}

.header-section p {
  margin: 0;
  font-size: 16px;
  opacity: 0.95;
  position: relative;
  z-index: 1;
}

h1 {
  margin: 0 0 var(--mw-space-lg) 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--mw-text-primary);
}

.muted {
  color: var(--mw-text-secondary);
}

.small {
  font-size: 14px;
  line-height: 1.5;
}

/* Card Component with Animation */
.card {
  background: var(--mw-bg-primary);
  border: 1px solid var(--mw-border-light);
  border-radius: var(--mw-radius-xl);
  padding: var(--mw-space-2xl);
  box-shadow: var(--mw-shadow-md);
  transition: transform var(--mw-transition-base), box-shadow var(--mw-transition-base);
  animation: slideUp 0.6s ease-out 0.1s both;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--mw-shadow-lg);
}

.stack {
  display: grid;
  gap: var(--mw-space-xl);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--mw-space-xl);
}

@media (max-width: 820px) {
  .row {
    grid-template-columns: 1fr;
  }
  .container {
    padding: var(--mw-space-xl);
  }
  .header-section {
    padding: var(--mw-space-2xl) var(--mw-space-xl);
  }
  .header-section h1 {
    font-size: 28px;
  }
}

/* Label */
.label {
  font-size: 14px;
  font-weight: 600;
  color: var(--mw-text-primary);
  margin-bottom: var(--mw-space-sm);
  display: block;
  transition: color var(--mw-transition-fast);
}

/* Input Fields */
.input {
  width: 100%;
  border-radius: var(--mw-radius-md);
  border: 1.5px solid var(--mw-border-medium);
  background: var(--mw-bg-primary);
  color: var(--mw-text-primary);
  padding: 12px var(--mw-space-lg);
  font-size: 14px;
  line-height: 1.5;
  transition: all var(--mw-transition-base);
  outline: none;
}

.input:hover {
  border-color: var(--mw-color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.05);
}

.input:focus {
  border-color: var(--mw-color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
  transform: translateY(-1px);
}

.input:disabled {
  background: var(--mw-bg-tertiary);
  color: var(--mw-text-tertiary);
  cursor: not-allowed;
  opacity: 0.7;
  border-color: var(--mw-border-light);
}

/* Modern Select/Dropdown Styling */
.select-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.select-wrapper::after {
  content: '';
  position: absolute;
  top: 50%;
  right: var(--mw-space-lg);
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--mw-text-secondary);
  pointer-events: none;
  transition: transform var(--mw-transition-base) cubic-bezier(0.4, 0, 0.2, 1),
              border-top-color var(--mw-transition-base);
  z-index: 1;
}

.select-wrapper:hover::after {
  border-top-color: var(--mw-color-primary);
}

.select-wrapper:has(.select:focus)::after {
  border-top-color: var(--mw-color-primary);
  transform: translateY(-50%) rotate(180deg);
}

.select {
  width: 100%;
  border-radius: var(--mw-radius-md);
  border: 1.5px solid var(--mw-border-medium);
  background: var(--mw-bg-primary);
  color: var(--mw-text-primary);
  padding: 12px var(--mw-space-xl) 12px var(--mw-space-lg);
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  transition: all var(--mw-transition-base);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  background-image: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.select:hover {
  border-color: var(--mw-color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.05), 0 2px 4px rgba(0, 0, 0, 0.1);
  background-color: var(--mw-bg-primary);
}

.select:focus {
  border-color: var(--mw-color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1), 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
  background-color: var(--mw-bg-primary);
}

.select:active {
  transform: translateY(0);
}

.select:disabled {
  background: var(--mw-bg-tertiary);
  color: var(--mw-text-tertiary);
  cursor: not-allowed;
  opacity: 0.7;
  border-color: var(--mw-border-light);
  box-shadow: none;
}

.select:disabled + .select-wrapper::after {
  opacity: 0.5;
}

/* Select option styling - better browser support */
.select option {
  padding: var(--mw-space-md);
  background: var(--mw-bg-primary);
  color: var(--mw-text-primary);
  font-size: 14px;
  line-height: 1.5;
}

.select option:disabled {
  color: var(--mw-text-tertiary);
  font-style: italic;
}

/* Dark mode select adjustments */
[data-theme="dark"] .select {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .select:hover {
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1), 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .select:focus {
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.2), 0 2px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .select option {
  background: var(--mw-bg-primary);
  color: var(--mw-text-primary);
}

/* Button - mittwald Green CTA Style */
.button {
  width: 100%;
  border-radius: var(--mw-radius-md);
  border: none;
  background: var(--mw-color-success);
  color: var(--mw-text-on-dark);
  padding: 12px var(--mw-space-xl);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  cursor: pointer;
  transition: all var(--mw-transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.button:hover:not(:disabled)::before {
  left: 100%;
}

.button:hover:not(:disabled) {
  background: var(--mw-color-success-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.button:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--mw-border-medium);
  transform: none;
}

.button.ghost {
  background: transparent;
  border: 1.5px solid var(--mw-border-medium);
  color: var(--mw-text-primary);
}

.button.ghost:hover:not(:disabled) {
  background: var(--mw-bg-tertiary);
  border-color: var(--mw-border-dark);
  transform: translateY(-2px);
  box-shadow: var(--mw-shadow-sm);
}

.button.ghost::before {
  display: none;
}

.smallBtn {
  width: auto;
  min-width: 140px;
  flex-shrink: 0;
}

/* Divider */
.hr {
  height: 1px;
  background: linear-gradient(to right, transparent, var(--mw-border-light), transparent);
  margin: var(--mw-space-2xl) 0;
  border: 0;
  animation: slideDown 0.4s ease-out;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  padding: 6px var(--mw-space-md);
  border-radius: var(--mw-radius-full);
  border: 1px solid var(--mw-border-light);
  color: var(--mw-text-secondary);
  background: var(--mw-bg-tertiary);
  line-height: 1.5;
  transition: all var(--mw-transition-fast);
  animation: scaleIn 0.3s ease-out;
}

.badge-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--mw-color-success);
  color: #047857;
}

.flex {
  display: flex;
  gap: var(--mw-space-md);
  align-items: center;
}

.mt8 {
  margin-top: var(--mw-space-sm);
}

/* Error Alert */
.errorBox {
  padding: var(--mw-space-lg);
  border: 1px solid var(--mw-color-error);
  border-radius: var(--mw-radius-lg);
  background: rgba(239, 68, 68, 0.08);
  color: var(--mw-color-error);
  font-size: 14px;
  animation: slideDown 0.3s ease-out;
}

.errorBox strong {
  font-weight: 600;
}

/* Mini Card */
.miniCard {
  background: var(--mw-bg-tertiary);
  border: 1px solid var(--mw-border-light);
  border-radius: var(--mw-radius-lg);
  padding: var(--mw-space-lg);
  transition: all var(--mw-transition-base);
  animation: slideUp 0.4s ease-out;
}

.miniCard:hover {
  border-color: var(--mw-border-medium);
  box-shadow: var(--mw-shadow-sm);
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 13px;
  word-break: break-all;
  color: var(--mw-text-secondary);
  background: var(--mw-bg-secondary);
  padding: 4px 8px;
  border-radius: var(--mw-radius-sm);
}

.row3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--mw-space-lg);
}

@media (max-width: 820px) {
  .row3 {
    grid-template-columns: 1fr;
  }
}

/* Link Button */
.linkBtn {
  margin-left: var(--mw-space-sm);
  background: transparent;
  border: 0;
  color: var(--mw-color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  transition: color var(--mw-transition-fast);
}

.linkBtn:hover {
  color: var(--mw-color-primary-dark);
  text-decoration-thickness: 2px;
}

/* Modal/Dialog */
.modalBackdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: grid;
  place-items: center;
  padding: var(--mw-space-xl);
  z-index: 9999;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease-out;
}

.modal {
  width: min(600px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  background: var(--mw-bg-primary);
  border: 1px solid var(--mw-border-light);
  border-radius: var(--mw-radius-xl);
  box-shadow: var(--mw-shadow-2xl);
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modalHeader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--mw-space-xl);
  border-bottom: 1px solid var(--mw-border-light);
  background: var(--mw-bg-secondary);
  border-radius: var(--mw-radius-xl) var(--mw-radius-xl) 0 0;
}

.modalTitle {
  font-weight: 700;
  font-size: 20px;
  color: var(--mw-text-primary);
  margin: 0;
}

.modalClose {
  background: transparent;
  border: 0;
  color: var(--mw-text-secondary);
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  padding: var(--mw-space-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--mw-radius-sm);
  transition: all var(--mw-transition-fast);
}

.modalClose:hover {
  background: var(--mw-bg-tertiary);
  color: var(--mw-text-primary);
  transform: rotate(90deg);
}

.modalBody {
  padding: var(--mw-space-xl);
}

.field {
  display: grid;
  gap: var(--mw-space-sm);
  animation: slideUp 0.3s ease-out;
}

.field:nth-child(1) { animation-delay: 0.05s; }
.field:nth-child(2) { animation-delay: 0.1s; }
.field:nth-child(3) { animation-delay: 0.15s; }
.field:nth-child(4) { animation-delay: 0.2s; }

.modalActions {
  display: flex;
  gap: var(--mw-space-md);
  justify-content: flex-end;
  margin-top: var(--mw-space-xl);
  padding-top: var(--mw-space-xl);
  border-top: 1px solid var(--mw-border-light);
}

/* Warning Alert */
.warn {
  margin-top: var(--mw-space-sm);
  padding: var(--mw-space-md) var(--mw-space-lg);
  border: 1px solid var(--mw-color-warning);
  border-radius: var(--mw-radius-md);
  background: rgba(245, 158, 11, 0.1);
  color: #92400e;
  font-size: 14px;
  animation: slideDown 0.3s ease-out;
}

.checkRow {
  display: flex;
  gap: var(--mw-space-md);
  align-items: center;
}

.checkRow input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--mw-color-success);
  transition: transform var(--mw-transition-fast);
}

.checkRow input[type="checkbox"]:hover {
  transform: scale(1.1);
}

/* Password Input with Eye Icon */
.password-input-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

.password-input {
  padding-right: 45px;
}

.password-input-wrapper .password-input[style*="paddingRight: 100px"] {
  padding-right: 100px;
}

.password-toggle {
  position: absolute;
  right: var(--mw-space-md);
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--mw-space-xs);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--mw-text-secondary);
  transition: color var(--mw-transition-fast), transform var(--mw-transition-fast);
  z-index: 1;
  border-radius: var(--mw-radius-sm);
}

.password-toggle svg {
  width: 20px;
  height: 20px;
  display: block;
}

.password-toggle:hover:not(:disabled) {
  color: var(--mw-color-primary);
  transform: translateY(-50%) scale(1.1);
}

.password-toggle:active:not(:disabled) {
  transform: translateY(-50%) scale(0.95);
}

.password-toggle:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.password-input:focus + .password-toggle {
  color: var(--mw-color-primary);
}

.password-input-wrapper > div {
  position: absolute;
  right: var(--mw-space-md);
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: var(--mw-space-sm);
  align-items: center;
  z-index: 1;
}

.password-input-wrapper > div .password-toggle {
  position: static;
  transform: none;
}

.password-input-wrapper > div .password-toggle:hover:not(:disabled) {
  transform: scale(1.1);
}

.password-input-wrapper > div .password-toggle:active:not(:disabled) {
  transform: scale(0.95);
}

/* Loading/Installing Animation */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: currentColor;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.6s linear infinite;
}

/* Smooth scroll */
html {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--mw-color-primary);
  outline-offset: 2px;
}

/* Theme Switch */
.theme-switch {
  position: fixed;
  bottom: var(--mw-space-xl);
  left: var(--mw-space-xl);
  z-index: 1000;
  animation: slideUp 0.5s ease-out 0.3s both;
}

.theme-switch-btn {
  background: var(--mw-bg-primary);
  border: 2px solid var(--mw-border-medium);
  border-radius: var(--mw-radius-full);
  padding: 0;
  width: 64px;
  height: 36px;
  cursor: pointer;
  position: relative;
  transition: all var(--mw-transition-base);
  box-shadow: var(--mw-shadow-md);
  outline: none;
}

.theme-switch-btn:hover {
  border-color: var(--mw-color-primary);
  box-shadow: var(--mw-shadow-lg);
  transform: scale(1.05);
}

.theme-switch-btn:active {
  transform: scale(0.98);
}

.theme-switch-track {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: var(--mw-radius-full);
  background: var(--mw-bg-tertiary);
  transition: background-color var(--mw-transition-base);
}

.theme-switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--mw-bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  box-shadow: var(--mw-shadow-sm);
  transition: transform var(--mw-transition-base) cubic-bezier(0.4, 0, 0.2, 1),
              background-color var(--mw-transition-base);
  transform: translateX(0);
}

[data-theme="dark"] .theme-switch-thumb {
  transform: translateX(28px);
}

.theme-switch-btn:focus-visible {
  outline: 2px solid var(--mw-color-primary);
  outline-offset: 2px;
}

/* Dark mode header gradient adjustment */
[data-theme="dark"] .header-section {
  background: linear-gradient(135deg, #4c1d95 0%, var(--mw-color-primary) 50%, #1e3a8a 100%);
}

[data-theme="dark"] .header-section::before {
  background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
}

/* Dark mode error box */
[data-theme="dark"] .errorBox {
  background: rgba(239, 68, 68, 0.15);
  border-color: var(--mw-color-error);
}

/* Dark mode warning */
[data-theme="dark"] .warn {
  background: rgba(245, 158, 11, 0.15);
  border-color: var(--mw-color-warning);
  color: #fbbf24;
}

/* Dark mode badge success */
[data-theme="dark"] .badge-success {
  background: rgba(16, 185, 129, 0.2);
  border-color: var(--mw-color-success);
  color: #34d399;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: var(--mw-space-xl);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--mw-space-md);
  max-width: 500px;
  width: calc(100% - var(--mw-space-2xl));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--mw-space-lg) var(--mw-space-xl);
  border-radius: var(--mw-radius-lg);
  box-shadow: var(--mw-shadow-xl);
  cursor: pointer;
  pointer-events: all;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.toast-closing {
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
}

.toast-success {
  background: var(--mw-color-success);
  color: var(--mw-text-on-dark);
  border-left: 4px solid #059669;
}

.toast-error {
  background: var(--mw-color-error);
  color: var(--mw-text-on-dark);
  border-left: 4px solid #dc2626;
}

.toast-content {
  display: flex;
  align-items: center;
  gap: var(--mw-space-md);
  font-weight: 500;
  font-size: 14px;
  flex: 1;
}

.toast-content > span:first-child {
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  margin-right: var(--mw-space-sm);
}

.toast-content > span:last-child {
  flex: 1;
}

.toast-close {
  background: transparent;
  border: none;
  color: currentColor;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity var(--mw-transition-fast);
  margin-left: var(--mw-space-md);
}

.toast-close:hover {
  opacity: 1;
}

.toast:hover {
  transform: translateY(-2px);
  box-shadow: var(--mw-shadow-2xl);
}

/* Dark mode toast adjustments */
[data-theme="dark"] .toast-success {
  background: var(--mw-color-success);
  border-left-color: #34d399;
}

[data-theme="dark"] .toast-error {
  background: var(--mw-color-error);
  border-left-color: #f87171;
}

/* Settings Button */
.settings-button {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--mw-radius-md);
  padding: var(--mw-space-sm) var(--mw-space-md);
  color: var(--mw-text-on-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--mw-space-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all var(--mw-transition-base);
  backdrop-filter: blur(10px);
  white-space: nowrap;
}

.settings-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.settings-button svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

[data-theme="dark"] .settings-button {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .settings-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
  .settings-button {
    top: var(--mw-space-md);
    right: var(--mw-space-md);
    padding: var(--mw-space-xs) var(--mw-space-sm);
    font-size: 12px;
  }

  .settings-button span {
    display: none;
  }

  .settings-button svg {
    width: 20px;
    height: 20px;
  }
}

/* Responsive Theme Switch */
@media (max-width: 640px) {
  .theme-switch {
    bottom: var(--mw-space-lg);
    left: var(--mw-space-lg);
  }
  
  .theme-switch-btn {
    width: 56px;
    height: 32px;
  }
  
  .theme-switch-thumb {
    width: 24px;
    height: 24px;
    font-size: 14px;
  }
  
  [data-theme="dark"] .theme-switch-thumb {
    transform: translateX(24px);
  }
}

/* Chat Widget Styles */
.chat-icon-button {
  position: fixed;
  bottom: var(--mw-space-xl);
  right: var(--mw-space-xl);
  width: 56px;
  height: 56px;
  border-radius: var(--mw-radius-full);
  background: var(--mw-color-success);
  color: var(--mw-text-on-dark);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--mw-shadow-xl);
  z-index: 1000;
  transition: all var(--mw-transition-base);
  animation: slideUp 0.5s ease-out 0.3s both;
}

.chat-icon-button:hover {
  background: var(--mw-color-success-dark);
  transform: scale(1.1) translateY(-2px);
  box-shadow: var(--mw-shadow-2xl);
}

.chat-icon-button:active {
  transform: scale(0.95);
}

.chat-icon-button svg {
  width: 24px;
  height: 24px;
}

.chat-window {
  position: fixed;
  bottom: var(--mw-space-xl);
  right: var(--mw-space-xl);
  width: 400px;
  max-width: calc(100vw - var(--mw-space-2xl));
  height: 600px;
  max-height: calc(100vh - var(--mw-space-2xl));
  background: var(--mw-bg-primary);
  border: 1px solid var(--mw-border-light);
  border-radius: var(--mw-radius-xl);
  box-shadow: var(--mw-shadow-2xl);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  animation: scaleIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--mw-space-lg) var(--mw-space-xl);
  border-bottom: 1px solid var(--mw-border-light);
  background: var(--mw-bg-secondary);
}

.chat-header-title {
  display: flex;
  align-items: center;
  gap: var(--mw-space-md);
  font-weight: 600;
  font-size: 16px;
  color: var(--mw-text-primary);
}

.chat-header-title svg {
  width: 20px;
  height: 20px;
  color: var(--mw-color-success);
}

.chat-close-button {
  background: transparent;
  border: none;
  color: var(--mw-text-secondary);
  cursor: pointer;
  padding: var(--mw-space-xs);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mw-radius-sm);
  transition: all var(--mw-transition-fast);
}

.chat-close-button:hover {
  background: var(--mw-bg-tertiary);
  color: var(--mw-text-primary);
  transform: rotate(90deg);
}

.chat-close-button svg {
  width: 20px;
  height: 20px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--mw-space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--mw-space-md);
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: var(--mw-bg-secondary);
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--mw-border-medium);
  border-radius: var(--mw-radius-full);
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: var(--mw-border-dark);
}

.chat-message {
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

.chat-message-user {
  align-items: flex-end;
}

.chat-message-assistant {
  align-items: flex-start;
}

.chat-message-content {
  max-width: 80%;
  padding: var(--mw-space-md) var(--mw-space-lg);
  border-radius: var(--mw-radius-lg);
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-message-user .chat-message-content {
  background: var(--mw-color-success);
  color: var(--mw-text-on-dark);
  border-bottom-right-radius: var(--mw-radius-sm);
}

.chat-message-assistant .chat-message-content {
  background: var(--mw-bg-tertiary);
  color: var(--mw-text-primary);
  border: 1px solid var(--mw-border-light);
  border-bottom-left-radius: var(--mw-radius-sm);
}

/* Markdown styles in chat messages */
.chat-message-content p {
  margin: 0 0 var(--mw-space-md) 0;
  line-height: 1.6;
}

.chat-message-content p:last-child {
  margin-bottom: 0;
}

.chat-message-content strong,
.chat-message-content b {
  font-weight: 600;
  color: var(--mw-text-primary);
}

.chat-message-content code {
  background: var(--mw-bg-secondary);
  color: var(--mw-color-primary);
  padding: 2px 6px;
  border-radius: var(--mw-radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.9em;
  border: 1px solid var(--mw-border-light);
}

.chat-message-content pre {
  background: var(--mw-bg-secondary);
  border: 1px solid var(--mw-border-light);
  border-radius: var(--mw-radius-md);
  padding: var(--mw-space-md);
  overflow-x: auto;
  margin: var(--mw-space-md) 0;
}

.chat-message-content pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: var(--mw-text-primary);
}

.chat-message-content ul,
.chat-message-content ol {
  margin: var(--mw-space-md) 0;
  padding-left: var(--mw-space-2xl);
}

.chat-message-content li {
  margin: var(--mw-space-sm) 0;
  line-height: 1.6;
}

.chat-message-content h1,
.chat-message-content h2,
.chat-message-content h3,
.chat-message-content h4,
.chat-message-content h5,
.chat-message-content h6 {
  margin: var(--mw-space-lg) 0 var(--mw-space-md) 0;
  font-weight: 600;
  color: var(--mw-text-primary);
  line-height: 1.3;
}

.chat-message-content h1:first-child,
.chat-message-content h2:first-child,
.chat-message-content h3:first-child,
.chat-message-content h4:first-child,
.chat-message-content h5:first-child,
.chat-message-content h6:first-child {
  margin-top: 0;
}

.chat-message-content blockquote {
  border-left: 3px solid var(--mw-color-primary);
  padding-left: var(--mw-space-lg);
  margin: var(--mw-space-md) 0;
  color: var(--mw-text-secondary);
  font-style: italic;
}

.chat-message-content a {
  color: var(--mw-color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.chat-message-content a:hover {
  color: var(--mw-color-primary-dark);
}

.chat-message-content hr {
  border: none;
  border-top: 1px solid var(--mw-border-light);
  margin: var(--mw-space-lg) 0;
}

.chat-message-content table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--mw-space-md) 0;
}

.chat-message-content th,
.chat-message-content td {
  border: 1px solid var(--mw-border-light);
  padding: var(--mw-space-sm) var(--mw-space-md);
  text-align: left;
}

.chat-message-content th {
  background: var(--mw-bg-secondary);
  font-weight: 600;
}

.chat-input-form {
  display: flex;
  gap: var(--mw-space-sm);
  padding: var(--mw-space-lg);
  border-top: 1px solid var(--mw-border-light);
  background: var(--mw-bg-secondary);
}

.chat-input {
  flex: 1;
  border-radius: var(--mw-radius-md);
  border: 1.5px solid var(--mw-border-medium);
  background: var(--mw-bg-primary);
  color: var(--mw-text-primary);
  padding: var(--mw-space-md) var(--mw-space-lg);
  font-size: 14px;
  line-height: 1.5;
  transition: all var(--mw-transition-base);
  outline: none;
}

.chat-input:hover {
  border-color: var(--mw-color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.05);
}

.chat-input:focus {
  border-color: var(--mw-color-primary);
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.chat-input:disabled {
  background: var(--mw-bg-tertiary);
  color: var(--mw-text-tertiary);
  cursor: not-allowed;
  opacity: 0.7;
}

.chat-send-button {
  width: 44px;
  height: 44px;
  border-radius: var(--mw-radius-md);
  border: none;
  background: var(--mw-color-success);
  color: var(--mw-text-on-dark);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--mw-transition-base);
  flex-shrink: 0;
}

.chat-send-button:hover:not(:disabled) {
  background: var(--mw-color-success-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.chat-send-button:active:not(:disabled) {
  transform: translateY(0);
}

.chat-send-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--mw-border-medium);
}

.chat-send-button svg {
  width: 20px;
  height: 20px;
}

/* Responsive Chat Widget */
@media (max-width: 640px) {
  .chat-icon-button {
    bottom: var(--mw-space-lg);
    right: var(--mw-space-lg);
    width: 48px;
    height: 48px;
  }

  .chat-icon-button svg {
    width: 20px;
    height: 20px;
  }

  .chat-window {
    bottom: var(--mw-space-lg);
    right: var(--mw-space-lg);
    left: var(--mw-space-lg);
    width: auto;
    height: 500px;
    max-height: calc(100vh - var(--mw-space-2xl));
  }

  .chat-message-content {
    max-width: 85%;
  }
}
