/* Custom Animations */
@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fade-in-up 0.8s ease-out forwards;
}

.delay-100 {
  animation-delay: 0.1s;
}

.delay-200 {
  animation-delay: 0.2s;
}

.delay-300 {
  animation-delay: 0.3s;
}

/* Smooth scrolling behavior */
html {
  scroll-behavior: smooth;
}

/* Selection styling */
::selection {
  background-color: #d97706;
  color: white;
}

/* Header scroll effects */
.header-scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

.header-scrolled #logo-text {
  color: #0f172a !important;
}

.header-scrolled #logo-subtitle {
  color: #6b7280 !important;
}

.header-scrolled .nav-link {
  color: #1e293b !important;
}

.header-scrolled #header-phone {
  color: #0f172a !important;
}

.header-scrolled #header-cta {
  background-color: #d97706 !important;
  color: white !important;
}

.header-scrolled #header-cta:hover {
  background-color: #b45309 !important;
}

.header-scrolled #mobile-menu-toggle {
  color: #0f172a !important;
}

/* Mobile menu transitions */
.mobile-menu-open {
  max-height: 24rem !important;
}

/* Grayscale hover effect */
.filter.grayscale {
  filter: grayscale(100%);
}

.filter.grayscale:hover {
  filter: grayscale(0%);
}

/* Sepia effect for team images */
.filter.sepia-\[0\.2\] {
  filter: sepia(0.2);
}

.filter.sepia-0 {
  filter: sepia(0);
}

/* Service cards sticky positioning */
.service-card-wrapper {
  position: relative;
}

@media (min-width: 1024px) {
  .service-card-wrapper {
    position: sticky;
  }
}

/* Smooth transitions for all interactive elements */
a, button {
  transition: all 0.3s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f8fafc;
}

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* FAQ accordion animation */
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  opacity: 0;
}

.faq-answer.open {
  max-height: 24rem;
  opacity: 1;
}

/* Form input focus effects */
input:focus, textarea:focus {
  outline: none;
  border-color: #d97706 !important;
}

/* Responsive utilities */
@media (max-width: 768px) {
  .mobile-menu-open {
    max-height: 30rem;
  }
}

/* Gradient text effect */
.text-transparent {
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Blur effects */
.blur-2xl {
  filter: blur(64px);
}

.blur-\[80px\] {
  filter: blur(80px);
}

/* Backdrop blur */
.backdrop-blur-sm {
  backdrop-filter: blur(4px);
}

.backdrop-blur-md {
  backdrop-filter: blur(12px);
}

/* Hidden utility */
.hidden {
  display: none;
}

/* Aspect ratio utility */
.aspect-\[4\/5\] {
  aspect-ratio: 4 / 5;
}

/* Object fit */
.object-cover {
  object-fit: cover;
}

.object-top {
  object-position: top;
}

/* Hyphens for text */
.hyphens-auto {
  hyphens: auto;
}

/* Break words */
.break-words {
  word-break: break-word;
}

/* Shrink utility */
.shrink-0 {
  flex-shrink: 0;
}

/* Pointer events */
.pointer-events-none {
  pointer-events: none;
}

/* Resize utility */
.resize-none {
  resize: none;
}

/* Negative z-index */
.-z-10 {
  z-index: -10;
}

/* Transform utilities */
.transform {
  transform: translateZ(0);
}

/* Cookie consent modal animation */
#cookie-consent {
  transition: opacity 0.3s ease;
  animation: fadeIn 0.3s ease;
}

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

#cookie-consent > div {
  animation: slideUp 0.3s ease;
}

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

/* Toggle Switch Styles */
.cookie-toggle:checked + div {
  background-color: #d97706;
}

.cookie-toggle:focus + div {
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.2);
}

/* Smooth scrolling for details/summary */
details {
  transition: all 0.3s ease;
}

details[open] {
  padding-bottom: 0.5rem;
}

summary {
  list-style: none;
  position: relative;
  padding-left: 1.5rem;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: '▶';
  position: absolute;
  left: 0;
  transition: transform 0.3s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
}

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

/* Focus visible - only show focus ring for keyboard navigation */
.sr-only:focus,
.sr-only:focus-visible {
  position: static;
  width: auto;
  height: auto;
  padding: 0.75rem 1.5rem;
  margin: 0;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Enhanced focus styles for accessibility */
*:focus-visible {
  outline: 3px solid #d97706;
  outline-offset: 2px;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid #d97706;
  outline-offset: 2px;
  border-radius: 4px;
}

/* High contrast focus for form elements */
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid #d97706;
  outline-offset: 0;
  box-shadow: 0 0 0 4px rgba(217, 119, 6, 0.2);
}

/* Focus for interactive elements */
summary:focus-visible {
  outline: 2px solid #d97706;
  outline-offset: 4px;
  border-radius: 4px;
}

/* Skip link styles - visible on focus */
.focus\:not-sr-only:focus {
  position: fixed !important;
  width: auto !important;
  height: auto !important;
  padding: 0.75rem 1.5rem !important;
  margin: 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  z-index: 9999 !important;
}

/* Peer utility for Tailwind-like behavior */
.peer:checked ~ .peer-checked\:bg-brand-accent {
  background-color: #d97706;
}

/* Modal overlay backdrop */
#cookie-consent {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Cookie banner scrollbar styling */
#cookie-consent .max-w-2xl {
  scrollbar-width: thin;
  scrollbar-color: #d97706 #f3f4f6;
}

#cookie-consent .max-w-2xl::-webkit-scrollbar {
  width: 8px;
}

#cookie-consent .max-w-2xl::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 10px;
}

#cookie-consent .max-w-2xl::-webkit-scrollbar-thumb {
  background: #d97706;
  border-radius: 10px;
}

#cookie-consent .max-w-2xl::-webkit-scrollbar-thumb:hover {
  background: #b45309;
}

/* Loading state */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Typewriter cursor animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.animate-pulse {
  animation: pulse 1s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bounce animation */
@keyframes bounce {
  0%, 100% {
    transform: translateY(0) translateX(-50%);
    animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
  }
  50% {
    transform: translateY(-25%) translateX(-50%);
    animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
  }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

/* Custom animations for services section */
.service-card {
  transition: transform 0.5s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-5px);
}

/* Team card hover effects */
.team-card {
  transition: all 0.3s ease;
}

.team-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* FAQ item hover */
.faq-item {
  transition: border-color 0.3s ease;
}

.faq-item:hover {
  border-color: #d1d5db !important;
}

/* Rotate animation for chevron */
.rotate-180 {
  transform: rotate(180deg);
}

/* Gap utilities for flex */
.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.gap-8 {
  gap: 2rem;
}

/* Min height utilities */
.min-h-\[160px\] {
  min-height: 160px;
}

.min-h-\[220px\] {
  min-height: 220px;
}

@media (min-width: 768px) {
  .md\:min-h-\[220px\] {
    min-height: 220px;
  }
}

.min-h-\[auto\] {
  min-height: auto;
}

.lg\:min-h-\[500px\] {
  min-height: 500px;
}

@media (min-width: 1024px) {
  .lg\:min-h-\[500px\] {
    min-height: 500px;
  }
}

/* ========================================
   BARRIEREFREIHEIT (WCAG 2.1 AA)
   ======================================== */

/* Reduziere Animationen für Nutzer mit Präferenz */
@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;
  }
}

/* Erhöhter Kontrast für bessere Lesbarkeit */
@media (prefers-contrast: high) {
  * {
    border-width: 2px !important;
  }

  a:focus-visible,
  button:focus-visible {
    outline-width: 4px !important;
  }
}

/* Dark Mode Unterstützung */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
  }
}

/* Minimale Touch-Ziel-Größe (WCAG 2.5.5 - Level AAA, empfohlen) */
button,
a,
[role="button"],
input[type="submit"],
input[type="button"],
input[type="checkbox"],
input[type="radio"] {
  min-height: 44px;
  min-width: 44px;
}

/* Text-Skalierung Unterstützung (bis 200%) */
html {
  font-size: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 100%;
  }
}

/* Fokus-Indikator sollte immer sichtbar sein */
:focus {
  outline-width: 2px;
  outline-style: solid;
  outline-color: #d97706;
}

/* Verhindere, dass Inhalte beim Zoomen verschwinden */
* {
  max-width: 100%;
}

/* Verbesserte Lesbarkeit für lange Texte */
p,
li,
td,
th {
  line-height: 1.5;
  max-width: 70ch; /* Optimale Zeilenlänge */
}

/* Tabellen responsive machen */
@media (max-width: 768px) {
  table {
    display: block;
    overflow-x: auto;
  }
}

/* Keyboard-only Focus Indikator (nur für Tastatur, nicht Maus) */
.js-focus-visible :focus:not(.focus-visible) {
  outline: none;
}

.js-focus-visible .focus-visible {
  outline: 3px solid #d97706;
  outline-offset: 2px;
}

/* Verhindere horizontales Scrollen */
body {
  overflow-x: hidden;
}

/* ARIA Live Regions */
[aria-live="polite"],
[aria-live="assertive"] {
  position: relative;
}

/* Barrierefreie Tooltip-Positionierung */
[role="tooltip"] {
  position: absolute;
  z-index: 1000;
}
