
/* Global styles */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: 'Source Sans 3', 'Source Sans Pro', 'Inter', system-ui, sans-serif;
  line-height: 1.7;
  letter-spacing: 0.01em;
  color: var(--text-dark, #374151);
  /* Ensure sufficient color contrast */
  background-color: #ffffff;
}
#app {
  min-height: 100vh;
}

/* WCAG 2.1 AA Compliance Styles */

/* Screen reader only content */
.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;
}

/* Focus management */
*:focus {
  outline: 2px solid #ff6b35;
  outline-offset: 2px;
}

/* Remove default focus outline for mouse users */
*:focus:not(:focus-visible) {
  outline: none;
}

/* Enhanced focus for keyboard users */
*:focus-visible {
  outline: 2px solid #ff6b35;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
* {
    border-color: currentColor;
}
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
*,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}
}

/* Ensure minimum touch target size (44px) */
button,
a,
input[type='button'],
input[type='submit'],
input[type='reset'],
[role='button'] {
  min-height: 44px;
  min-width: 44px;
}

/* Improve text readability */
p,
li,
span,
div {
  line-height: 1.6;
}

/* Ensure sufficient color contrast ratios */
.text-gray-600 {
  color: #4b5563; /* 4.5:1 contrast ratio */
}
.text-gray-500 {
  color: #6b7280; /* 4.5:1 contrast ratio */
}

/* Form elements accessibility */
input,
textarea,
select {
  font-size: 16px; /* Prevent zoom on iOS */
}

/* Error states */
.error {
  border-color: #dc2626;
  background-color: #fef2f2;
}
.error-message {
  color: #dc2626;
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

/* Success states */
.success {
  border-color: #16a34a;
  background-color: #f0fdf4;
}

/* Loading states */
.loading {
  position: relative;
  pointer-events: none;
}
.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #2d5016;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: #ffffff;
}
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #1e3a8a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1rem;
}
.loading-screen p {
  color: #6b7280;
  font-size: 1rem;
}
@keyframes spin {
0% {
    transform: rotate(0deg);
}
100% {
    transform: rotate(360deg);
}
}

/* CSS Custom Properties für Themes */
/* Diese werden dynamisch vom Theme-System gesetzt */
:root {
  /* Default Werte werden vom Theme-System überschrieben */
  --color-primary-50: #f0fdf4;
  --color-primary-100: #dcfce7;
  --color-primary-200: #bbf7d0;
  --color-primary-300: #86efac;
  --color-primary-400: #4ade80;
  --color-primary-500: #22c55e; /* Wird vom Theme-System überschrieben */
  --color-primary-600: #16a34a; /* Wird vom Theme-System überschrieben */
  --color-primary-700: #15803d;
  --color-primary-800: #166534;
  --color-primary-900: #14532d;

  --color-secondary-50: #fdf4ff;
  --color-secondary-100: #fae8ff;
  --color-secondary-200: #f5d0fe;
  --color-secondary-300: #f0abfc;
  --color-secondary-400: #e879f9;
  --color-secondary-500: #d946ef;
  --color-secondary-600: #c026d3;
  --color-secondary-700: #a21caf;
  --color-secondary-800: #86198f;
  --color-secondary-900: #701a75;

  --color-accent-50: #fffbeb;
  --color-accent-100: #fef3c7;
  --color-accent-200: #fde68a;
  --color-accent-300: #fcd34d;
  --color-accent-400: #fbbf24;
  --color-accent-500: #f59e0b;
  --color-accent-600: #d97706;
  --color-accent-700: #b45309;
  --color-accent-800: #92400e;
  --color-accent-900: #78350f;
}

/* Utility classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}
.text-center {
  text-align: center;
}
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

/* Grid system */
.grid {
  display: grid;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.gap-4 {
  gap: 1rem;
}
.gap-6 {
  gap: 1.5rem;
}
.gap-8 {
  gap: 2rem;
}
.gap-12 {
  gap: 3rem;
}

/* Flexbox utilities */
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.items-start {
  align-items: flex-start;
}
.justify-center {
  justify-content: center;
}
.justify-between {
  justify-content: space-between;
}
.space-x-4 > * + * {
  margin-left: 1rem;
}
.space-x-6 > * + * {
  margin-left: 1.5rem;
}
.space-y-2 > * + * {
  margin-top: 0.5rem;
}
.space-y-4 > * + * {
  margin-top: 1rem;
}
.space-y-6 > * + * {
  margin-top: 1.5rem;
}

/* Spacing */
.p-4 {
  padding: 1rem;
}
.p-6 {
  padding: 1.5rem;
}
.p-8 {
  padding: 2rem;
}
.py-4 {
  padding-top: 1rem;
  padding-bottom: 1rem;
}
.py-6 {
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
}
.py-8 {
  padding-top: 2rem;
  padding-bottom: 2rem;
}
.py-12 {
  padding-top: 3rem;
  padding-bottom: 3rem;
}
.py-16 {
  padding-top: 4rem;
  padding-bottom: 4rem;
}
.py-20 {
  padding-top: 5rem;
  padding-bottom: 5rem;
}
.px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}
.px-6 {
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}
.mb-2 {
  margin-bottom: 0.5rem;
}
.mb-4 {
  margin-bottom: 1rem;
}
.mb-6 {
  margin-bottom: 1.5rem;
}
.mb-8 {
  margin-bottom: 2rem;
}
.mb-12 {
  margin-bottom: 3rem;
}
.mt-1 {
  margin-top: 0.25rem;
}
.mt-4 {
  margin-top: 1rem;
}
.mt-8 {
  margin-top: 2rem;
}

/* Typography */
.text-xs {
  font-size: 0.75rem;
}
.text-sm {
  font-size: 0.875rem;
}
.text-base {
  font-size: 1rem;
}
.text-lg {
  font-size: 1.125rem;
}
.text-xl {
  font-size: 1.25rem;
}
.text-2xl {
  font-size: 1.5rem;
}
.text-3xl {
  font-size: 1.875rem;
}
.text-4xl {
  font-size: 2.25rem;
}
.text-5xl {
  font-size: 3rem;
}
.font-medium {
  font-weight: 500;
}
.font-semibold {
  font-weight: 600;
}
.font-bold {
  font-weight: 700;
}

/* Colors */
.text-white {
  color: #ffffff;
}
.text-gray-300 {
  color: #d1d5db;
}
.text-gray-400 {
  color: #9ca3af;
}
.text-gray-500 {
  color: #6b7280;
}
.text-gray-600 {
  color: #4b5563;
}
.text-gray-700 {
  color: #374151;
}
.text-gray-900 {
  color: #111827;
}
.text-primary-100 {
  color: var(--color-primary-100);
}
.text-primary-600 {
  color: var(--color-primary-600);
}
.text-red-500 {
  color: #ef4444;
}
.text-red-600 {
  color: #dc2626;
}
.bg-white {
  background-color: #ffffff;
}
.bg-gray-50 {
  background-color: #f9fafb;
}
.bg-gray-800 {
  background-color: #1f2937;
}
.bg-primary-100 {
  background-color: var(--color-primary-100);
}
.bg-primary-500 {
  background-color: var(--color-primary-500);
}
.bg-accent-500 {
  background-color: var(--color-accent-500);
}
.bg-gradient-to-r {
  background-image: linear-gradient(to right, var(--tw-gradient-stops));
}
.from-primary-600 {
  --tw-gradient-from: var(--color-primary-600);
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(22, 163, 74, 0));
}
.to-primary-800 {
  --tw-gradient-to: var(--color-primary-800);
}

/* Borders */
.border {
  border-width: 1px;
}
.border-t {
  border-top-width: 1px;
}
.border-b {
  border-bottom-width: 1px;
}
.border-gray-200 {
  border-color: #e5e7eb;
}
.border-gray-300 {
  border-color: #d1d5db;
}
.border-gray-700 {
  border-color: #374151;
}
.border-primary-500 {
  border-color: var(--color-primary-500);
}
.border-red-300 {
  border-color: #fca5a5;
}
.border-red-500 {
  border-color: #ef4444;
}
.rounded-lg {
  border-radius: 0.5rem;
}
.rounded-md {
  border-radius: 0.375rem;
}
.rounded-full {
  border-radius: 9999px;
}

/* Shadows */
.shadow-sm {
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.shadow-lg {
  box-shadow:
    0 10px 15px -3px rgb(0 0 0 / 0.1),
    0 4px 6px -4px rgb(0 0 0 / 0.1);
}

/* Responsive design */
@media (min-width: 768px) {
.md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.md\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.md\:flex {
    display: flex;
}
}
@media (min-width: 1024px) {
.lg\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}
.lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
}
@media (min-width: 640px) {
.sm\:flex-row {
    flex-direction: row;
}
}

/* Hidden utilities */
.hidden {
  display: none;
}
@media (min-width: 768px) {
.md\:flex {
    display: flex;
}
}

/* Width utilities */
.w-6 {
  width: 1.5rem;
}
.w-16 {
  width: 4rem;
}
.w-full {
  width: 100%;
}
.h-6 {
  height: 1.5rem;
}
.h-16 {
  height: 4rem;
}
.min-h-screen {
  min-height: 100vh;
}

/* Max width */
.max-w-2xl {
  max-width: 42rem;
}
.max-w-4xl {
  max-width: 56rem;
}
.mx-auto {
  margin-left: auto;
  margin-right: auto;
}

/* Position */
.relative {
  position: relative;
}

/* Hover effects */
.hover\:text-primary-200:hover {
  color: var(--color-primary-200);
}
.hover\:bg-primary-50:hover {
  background-color: var(--color-primary-50);
}
.hover\:bg-primary-600:hover {
  background-color: var(--color-primary-600);
}
.hover\:bg-accent-600:hover {
  background-color: var(--color-accent-600);
}
.hover\:bg-white:hover {
  background-color: #ffffff;
}
.hover\:text-primary-600:hover {
  color: var(--color-primary-600);
}

/* Focus effects */
.focus\:border-primary-500:focus {
  border-color: var(--color-primary-500);
}
.focus\:ring-primary-500:focus {
  --tw-ring-color: var(--color-primary-500);
  box-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width))
    var(--tw-ring-color);
}
.focus\:border-red-500:focus {
  border-color: #ef4444;
}
.focus\:ring-red-500:focus {
  --tw-ring-color: #ef4444;
  box-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width))
    var(--tw-ring-color);
}
.focus\:outline-none:focus {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* Transitions */
.transition-colors {
  transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
  transition-duration: 150ms;
}

/* Disabled states */
.disabled\:opacity-50:disabled {
  opacity: 0.5;
}
.disabled\:cursor-not-allowed:disabled {
  cursor: not-allowed;
}
.disabled\:bg-gray-50:disabled {
  background-color: #f9fafb;
}
.disabled\:text-gray-500:disabled {
  color: #6b7280;
}

/* Ring utilities */
.ring-2 {
  --tw-ring-width: 2px;
}
.ring-offset-2 {
  --tw-ring-offset-width: 2px;
}

/* List styles */
.space-y-2 > * + * {
  margin-top: 0.5rem;
}

/* Textarea styles */
textarea {
  resize: vertical;
}

/* Select styles */
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}
