/**
 * ShiftBot Central Admin - Design Tokens
 * ======================================
 * Adaptiert vom ShiftBot Admin UI für konsistentes Branding.
 *
 * Version: 1.0
 * Stand: Januar 2026
 */

:root {
  /* ===================
     BRAND COLORS
     =================== */
  --primary: #8233ff;
  --primary-light: #a366ff;
  --primary-dark: #6b1fd6;
  --primary-glow: rgba(130, 51, 255, 0.3);
  --primary-subtle: rgba(130, 51, 255, 0.1);

  --secondary: #ffca00;
  --secondary-light: #ffd633;
  --secondary-glow: rgba(255, 202, 0, 0.3);
  --secondary-subtle: rgba(255, 202, 0, 0.1);

  /* ===================
     SEMANTIC COLORS
     =================== */
  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.1);
  --success-border: rgba(34, 197, 94, 0.3);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --warning-border: rgba(245, 158, 11, 0.3);

  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --error-border: rgba(239, 68, 68, 0.3);

  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  --info-border: rgba(59, 130, 246, 0.3);

  /* ===================
     DARK THEME (Default)
     =================== */
  --bg-base: #0a0a0f;
  --bg-elevated: #12121a;
  --bg-surface: #1a1a24;

  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-bg-hover: rgba(255, 255, 255, 0.06);
  --glass-bg-active: rgba(255, 255, 255, 0.08);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(255, 255, 255, 0.12);

  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-muted: rgba(255, 255, 255, 0.4);
  --text-disabled: rgba(255, 255, 255, 0.25);

  --border-default: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.15);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--primary-glow);

  /* ===================
     TYPOGRAPHY
     =================== */
  --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono',
               Consolas, monospace;

  /* Font Sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;

  /* Font Weights */
  --font-normal: 400;
  --font-medium: 500;
  --font-semibold: 600;
  --font-bold: 700;

  /* Line Heights */
  --leading-tight: 1.25;
  --leading-normal: 1.5;
  --leading-relaxed: 1.75;

  /* ===================
     SPACING (8px base)
     =================== */
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* ===================
     BORDER RADIUS
     =================== */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;

  /* ===================
     LAYOUT
     =================== */
  --sidebar-width: 264px;
  --sidebar-collapsed: 72px;
  --header-height: 64px;
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --content-max-width: 1400px;

  /* ===================
     ANIMATIONS
     =================== */
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);

  --duration-fast: 150ms;
  --duration-normal: 200ms;
  --duration-slow: 300ms;
  --duration-slower: 500ms;

  /* ===================
     ICON SIZES
     =================== */
  --icon-xs: 14px;
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
  --icon-xl: 32px;

  /* ===================
     Z-INDEX SCALE
     =================== */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-fixed: 300;
  --z-modal-backdrop: 400;
  --z-modal: 500;
  --z-popover: 600;
  --z-tooltip: 700;
  --z-toast: 800;
}

/* ===================
   BASE STYLES
   =================== */
html {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-primary);
}

body {
  background-color: var(--bg-base);
  min-height: 100vh;
}

/* ===================
   GLASS MORPHISM
   =================== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-normal) var(--ease-out);
}

.glass-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

/* ===================
   SIDEBAR STYLES
   =================== */
.sidebar {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-base) 100%);
  border-right: 1px solid var(--border-default);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  transition: all var(--duration-fast) var(--ease-out);
}

.sidebar-nav-item:hover {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
}

.sidebar-nav-item.active {
  background: var(--primary-subtle);
  color: var(--primary-light);
}

.sidebar-nav-item.active:hover {
  background: rgba(130, 51, 255, 0.15);
}

/* ===================
   TOP BAR STYLES
   =================== */
.topbar {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-default);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* ===================
   CARD STYLES
   =================== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}

.card-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-default);
}

.card-body {
  padding: var(--space-6);
}

/* ===================
   STAT CARDS
   =================== */
.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--duration-normal) var(--ease-out);
}

.stat-card:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
}

.stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ===================
   STATUS INDICATORS
   =================== */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
}

.status-dot.online {
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulse-glow 2s infinite;
}

.status-dot.offline {
  background: var(--error);
}

.status-dot.degraded {
  background: var(--warning);
}

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px var(--success); }
  50% { box-shadow: 0 0 16px var(--success); }
}

/* ===================
   BUTTONS
   =================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  cursor: pointer;
}

.btn-primary {
  background: var(--primary);
  color: white;
  border: none;
}

.btn-primary:hover {
  background: var(--primary-light);
  box-shadow: var(--shadow-glow);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-hover);
}

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid var(--error-border);
}

.btn-danger:hover {
  background: var(--error);
  color: white;
}

/* ===================
   TABLES
   =================== */
.table-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: var(--text-xs);
  font-weight: var(--font-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--border-default);
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--border-default);
  color: var(--text-primary);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: var(--glass-bg);
}

/* ===================
   FORMS
   =================== */
.form-input {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  color: var(--text-primary);
  font-size: var(--text-sm);
  width: 100%;
  transition: all var(--duration-fast) var(--ease-out);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* ===================
   BADGES
   =================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-sm);
}

.badge-success {
  background: transparent;
  color: var(--success);
}

.badge-warning {
  background: transparent;
  color: var(--warning);
}

.badge-error {
  background: transparent;
  color: var(--error);
}

.badge-info {
  background: transparent;
  color: var(--info);
}

.badge-secondary {
  background: transparent;
  color: var(--text-muted);
}

/* ===================
   SCROLLBAR (Dark)
   =================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-base);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-strong);
}

/* ===================
   UTILITY CLASSES
   =================== */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-error { color: var(--error); }
.text-info { color: var(--info); }

.bg-base { background-color: var(--bg-base); }
.bg-elevated { background-color: var(--bg-elevated); }
.bg-surface { background-color: var(--bg-surface); }

/* Hover Effects */
.hover-lift {
  transition: transform var(--duration-normal) var(--ease-out),
              box-shadow var(--duration-normal) var(--ease-out);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.hover-glow:hover {
  box-shadow: var(--shadow-glow);
}

/* Focus States */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ===================
   LIGHT THEME
   =================== */
.light-theme {
  /* Background Colors */
  --bg-base: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-surface: #f1f5f9;

  /* Glass Effects (Light) */
  --glass-bg: rgba(0, 0, 0, 0.02);
  --glass-bg-hover: rgba(0, 0, 0, 0.04);
  --glass-bg-active: rgba(0, 0, 0, 0.06);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(0, 0, 0, 0.12);

  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: rgba(30, 41, 59, 0.8);
  --text-muted: rgba(30, 41, 59, 0.5);
  --text-disabled: rgba(30, 41, 59, 0.3);

  /* Border Colors */
  --border-default: rgba(0, 0, 0, 0.08);
  --border-strong: rgba(0, 0, 0, 0.15);

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
}

/* Light theme sidebar adjustments */
.light-theme .sidebar {
  background: linear-gradient(180deg, var(--bg-elevated) 0%, var(--bg-base) 100%);
}

.light-theme .sidebar-nav-item {
  color: var(--text-secondary);
}

.light-theme .sidebar-nav-item:hover {
  color: var(--text-primary);
}

.light-theme .topbar {
  background: var(--bg-elevated);
}

/* Light theme scrollbar */
.light-theme ::-webkit-scrollbar-track {
  background: var(--bg-base);
}

.light-theme ::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
}

.light-theme ::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Light theme stat cards */
.light-theme .stat-card {
  background: var(--bg-elevated);
  border-color: var(--border-default);
  box-shadow: var(--shadow-sm);
}

.light-theme .stat-card:hover {
  box-shadow: var(--shadow-md);
}

/* Light theme table */
.light-theme .table-container {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

.light-theme .table th {
  background: var(--bg-surface);
}

.light-theme .table tr:hover td {
  background: var(--bg-surface);
}

/* Light theme cards */
.light-theme .card {
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}

/* Light theme form inputs */
.light-theme .form-input {
  background: var(--bg-elevated);
  border-color: var(--border-default);
}

.light-theme .form-input:focus {
  border-color: var(--primary);
}
