/**
 * Goethe Theme - Global Design System
 * Goethe Assessment Distributed System
 */

:root {
  /* Primary Colors */
  --goethe-red: #e30613;
  --goethe-red-dark: #b0050f;
  --goethe-red-light: #ff3b47;
  
  /* Secondary Colors */
  --goethe-blue: #005ea8;
  --goethe-blue-dark: #003d6e;
  --goethe-blue-light: #4a9fd4;
  
  /* Neutral Colors */
  --goethe-black: #1a1a1a;
  --goethe-dark-gray: #4a4a4a;
  --goethe-gray: #8c8c8c;
  --goethe-light-gray: #d4d4d4;
  --goethe-lighter-gray: #f0f0f0;
  --goethe-white: #ffffff;
  
  /* Status Colors */
  --status-success: #28a745;
  --status-warning: #ffc107;
  --status-danger: #dc3545;
  --status-info: #17a2b8;
  
  /* Level Colors */
  --level-a1: #4caf50;
  --level-a2: #8bc34a;
  --level-b1: #ffc107;
  --level-b2: #ff9800;
  --level-c1: #f44336;
  --level-c2: #9c27b0;
  
  /* Typography */
  --font-primary: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
  --font-mono: 'Consolas', 'Monaco', 'Courier New', monospace;
  
  /* Theme vars */
  --bg-body: var(--goethe-lighter-gray);
  --bg-card: var(--goethe-white);
  --text-body: var(--goethe-black);
  --text-muted-custom: var(--goethe-gray);
  --border-color: var(--goethe-light-gray);
  
  /* Sizes & Spacing */
  --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;
  
  --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;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
  
  /* Z-Index Scale */
  --z-base: 0;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-popover: 400;
  --z-tooltip: 500;
}

[data-theme="dark"] {
  --goethe-black: #f0f0f0;
  --goethe-dark-gray: #c4c4c4;
  --goethe-gray: #888888;
  --goethe-light-gray: #3a3a3a;
  --goethe-lighter-gray: #1e1e1e;
  --goethe-white: #2a2a2a;
  --bg-body: #121212;
  --bg-card: #1e1e1e;
  --text-body: #f0f0f0;
  --text-muted-custom: #a0a0a0;
  --border-color: #3a3a3a;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-body);
  background-color: var(--bg-body);
  transition: background-color 250ms ease, color 250ms ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
  margin-bottom: var(--space-4);
}

/* Links */
a {
  color: var(--goethe-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--goethe-blue-dark);
  text-decoration: underline;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-primary);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.5;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.btn:focus {
  outline: 2px solid var(--goethe-blue);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--goethe-red);
  color: var(--goethe-white);
}

.btn-primary:hover {
  background-color: var(--goethe-red-dark);
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--goethe-blue);
  color: var(--goethe-white);
}

.btn-secondary:hover {
  background-color: var(--goethe-blue-dark);
  text-decoration: none;
}

.btn-outline {
  background-color: transparent;
  border-color: var(--goethe-red);
  color: var(--goethe-red);
}

.btn-outline:hover {
  background-color: var(--goethe-red);
  color: var(--goethe-white);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
}

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

/* Forms */
input, textarea, select {
  font-family: var(--font-primary);
  font-size: var(--text-base);
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--goethe-light-gray);
  border-radius: var(--radius-md);
  transition: border-color var(--transition-fast);
  width: 100%;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--goethe-blue);
}

input:disabled, textarea:disabled, select:disabled {
  background-color: var(--goethe-lighter-gray);
  cursor: not-allowed;
}

label {
  display: block;
  margin-bottom: var(--space-2);
  font-weight: 500;
  color: var(--goethe-dark-gray);
}

/* Cards */
.card {
  background-color: var(--goethe-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
}

.card-header {
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--goethe-light-gray);
}

.card-title {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}

/* Alerts */
.alert {
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  border: 1px solid var(--status-success);
  color: #155724;
}

.alert-warning {
  background-color: rgba(255, 193, 7, 0.1);
  border: 1px solid var(--status-warning);
  color: #856404;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border: 1px solid var(--status-danger);
  color: #721c24;
}

.alert-info {
  background-color: rgba(23, 162, 184, 0.1);
  border: 1px solid var(--status-info);
  color: #0c5460;
}

/* Utilities */
.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  background: var(--goethe-black);
  color: var(--goethe-white);
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
  z-index: 10000;
  transform: translateY(-100%);
  transition: transform 0.2s;
}
.skip-link:focus {
  transform: translateY(0);
}

.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;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-mono { font-family: var(--font-mono); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-normal { font-weight: 400; }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }

.text-muted { color: var(--goethe-gray); }
.text-primary { color: var(--goethe-red); }
.text-secondary { color: var(--goethe-blue); }

.bg-white { background-color: var(--goethe-white); }
.bg-light { background-color: var(--goethe-lighter-gray); }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }

.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }

.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }

.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }

.rounded { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }

.shadow { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-4);
}

.container-sm {
  max-width: 640px;
}

.container-md {
  max-width: 768px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { 
    opacity: 0;
    transform: translateY(20px);
  }
  to { 
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.animate-fade-in {
  animation: fadeIn var(--transition-base);
}

.animate-slide-up {
  animation: slideUp var(--transition-base);
}

.animate-pulse {
  animation: pulse 2s infinite;
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Utility Classes */
.hidden {
  display: none !important;
}

/* Result Score Circle */
.result-score {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(var(--goethe-red) var(--score-percent), #eee var(--score-percent));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.result-score-inner {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-value {
  font-size: 2.5rem;
  font-weight: bold;
  color: var(--goethe-red);
}

.score-label {
  font-size: 0.875rem;
  color: var(--goethe-dark-gray);
}
