/* ===================================
   CASAI Website - Global Styles
   Version: 1.0
   =================================== */

/* ===================================
   CSS Custom Properties (Design System)
   =================================== */
:root {
  /* Colors */
  --bg-main: #050509;
  --text-main: #ffffff;
  --text-muted: #f5f5f5;

  --accent-pink: #ff26b9;
  --accent-blue: #1d56e8;
  --accent-purple: #cb6ce6;
  --accent-orange: #f86f03;
  --accent-yellow: #dde255;

  /* Typography */
  --font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;

  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 6rem;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  /* Container */
  --container-max: 1280px;
  --container-padding: 2rem;

  /* Transitions */
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Z-index */
  --z-header: 1000;
  --z-modal: 2000;
  --z-overlay: 1500;
}

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

html {
  font-size: var(--font-size-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: 1rem;
  line-height: var(--line-height-base);
  color: var(--text-main);
  background-color: var(--bg-main);
  overflow-x: hidden;
}

/* ===================================
   Typography
   =================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.5rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 2rem);
}

h5 {
  font-size: clamp(1.125rem, 2vw, 1.5rem);
}

h6 {
  font-size: 1rem;
}

p {
  margin-bottom: 1rem;
}

a {
  color: var(--text-main);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--accent-pink);
}

strong, b {
  font-weight: 700;
}

/* ===================================
   Layout & Container
   =================================== */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
  width: 100%;
}

.section {
  padding: var(--spacing-xl) 0;
}

.section--dark {
  background-color: var(--bg-main);
}

.section--accent {
  background: linear-gradient(135deg, rgba(255, 38, 185, 0.1) 0%, rgba(29, 86, 232, 0.1) 100%);
}

/* ===================================
   Grid System
   =================================== */
.grid {
  display: grid;
  gap: var(--spacing-md);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* ===================================
   Buttons
   =================================== */
a.btn,
button.btn,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  font-family: var(--font-family);
  line-height: 1.2;
}

a.btn--primary,
button.btn--primary,
.btn.btn--primary {
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 100%);
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(255, 38, 185, 0.3);
}

a.btn--primary:hover,
button.btn--primary:hover,
.btn.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 30px rgba(255, 38, 185, 0.5);
  background: linear-gradient(135deg, #ff40c4 0%, #d68aed 100%);
  color: #ffffff;
}

a.btn--secondary,
button.btn--secondary,
.btn.btn--secondary {
  background: transparent;
  color: var(--text-main);
  border: 2px solid var(--text-main);
}

a.btn--secondary:hover,
button.btn--secondary:hover,
.btn.btn--secondary:hover {
  background: var(--text-main);
  color: var(--bg-main);
}

a.btn--large,
button.btn--large,
.btn.btn--large {
  padding: 1rem 2rem;
  font-size: 1rem;
}

a.btn--small,
button.btn--small,
.btn.btn--small {
  padding: 0.5rem 1.125rem;
  font-size: 0.8125rem;
}

/* ===================================
   Cards
   =================================== */
.card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: var(--spacing-md);
  transition: all var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 38, 185, 0.3);
  box-shadow: 0 8px 30px rgba(255, 38, 185, 0.2);
}

.card__title {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

.card__content {
  color: var(--text-muted);
}

/* ===================================
   Header / Navigation
   =================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  background: rgba(5, 5, 9, 0.7);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: all var(--transition-base);
}

.header__container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2rem;
  padding: 1rem var(--container-padding);
  max-width: var(--container-max);
  margin: 0 auto;
}

.header__logo {
  justify-self: start;
}

.nav {
  justify-self: center;
}

.header__logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.nav__list {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.nav__link {
  font-size: 1rem;
  font-weight: 500;
  position: relative;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent-pink);
  transition: width var(--transition-base);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.menu-toggle__bar {
  width: 24px;
  height: 3px;
  background: var(--text-main);
  transition: all var(--transition-base);
  border-radius: 2px;
}

/* ===================================
   Footer
   =================================== */
.footer {
  background: var(--bg-main);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--spacing-lg) 0 var(--spacing-md);
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-md);
}

.footer__section-title {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--accent-pink);
}

.footer__links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer__link {
  color: var(--text-muted);
  transition: color var(--transition-base);
}

.footer__link:hover {
  color: var(--accent-pink);
}

.footer__bottom {
  text-align: center;
  padding-top: var(--spacing-md);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===================================
   Utility Classes
   =================================== */
.text-center {
  text-align: center;
}

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

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

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

.text-gradient {
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-purple) 50%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--spacing-xs); }
.mt-2 { margin-top: var(--spacing-sm); }
.mt-3 { margin-top: var(--spacing-md); }
.mt-4 { margin-top: var(--spacing-lg); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ===================================
   Responsive Design
   =================================== */
@media (max-width: 1024px) {
  :root {
    --container-padding: 1.5rem;
    --spacing-xl: 4rem;
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
    --spacing-lg: 3rem;
    --spacing-xl: 3rem;
  }

  .nav__list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(5, 5, 9, 0.98);
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav__list--open {
    display: flex;
  }

  .menu-toggle {
    display: flex;
  }

  .menu-toggle--active .menu-toggle__bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle--active .menu-toggle__bar:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle--active .menu-toggle__bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }

  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  :root {
    --font-size-base: 14px;
    --spacing-md: 1.5rem;
  }

  .btn {
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
  }
}

/* ===================================
   Loading & Animations
   =================================== */

/* Keyframe Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideIn {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

/* Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transition: none;
}

.animate-on-scroll.animated {
  animation-duration: 0.8s;
  animation-fill-mode: both;
  animation-timing-function: cubic-bezier(0.25, 0, 0.4, 1);
}

.fade-in {
  animation: fadeIn 0.8s cubic-bezier(0.25, 0, 0.4, 1) forwards;
}

.fade-in-up {
  animation: fadeInUp 0.8s cubic-bezier(0.25, 0, 0.4, 1) forwards;
}

.fade-in-left {
  animation: fadeInLeft 0.8s cubic-bezier(0.25, 0, 0.4, 1) forwards;
}

.fade-in-right {
  animation: fadeInRight 0.8s cubic-bezier(0.25, 0, 0.4, 1) forwards;
}

.zoom-in {
  animation: zoomIn 0.8s cubic-bezier(0.25, 0, 0.4, 1) forwards;
}

.slide-in {
  animation: slideIn 0.6s ease forwards;
}

/* Staggered Animations */
.stagger-delay-1 { animation-delay: 0.1s; }
.stagger-delay-2 { animation-delay: 0.2s; }
.stagger-delay-3 { animation-delay: 0.3s; }
.stagger-delay-4 { animation-delay: 0.4s; }
.stagger-delay-5 { animation-delay: 0.5s; }
.stagger-delay-6 { animation-delay: 0.6s; }

/* ===================================
   Accessibility
   =================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-pink);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 9999;
}

.skip-link:focus {
  top: 0;
}

/* Focus styles */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent-pink);
  outline-offset: 2px;
}

/* ===================================
   Responsive Tables Pattern
   =================================== */
/*
  WICHTIG: Alle Tabellen müssen responsive sein!

  Pattern für neue Tabellen:

  1. Desktop: Normale <table> in einem Wrapper mit Klasse
  2. Mobile: Card-basiertes Layout
  3. CSS @media query um zwischen beiden zu wechseln

  Beispiel siehe:
  - wizard.php (Markenvergleichstabelle)
  - how-it-works.php (Preisvergleichstabelle)

  Struktur:

  <!-- Desktop Table -->
  <div class="table-wrapper">
    <table class="responsive-table">
      ...
    </table>
  </div>

  <!-- Mobile Cards -->
  <div class="table-mobile">
    <div class="table-card">...</div>
    <div class="table-card">...</div>
  </div>

  CSS:
  @media (max-width: 768px) {
    .table-wrapper { display: none; }
    .table-mobile { display: block !important; }
  }
*/

/* ===================================
   Wizard Coming Soon Overlay
   =================================== */
.wizard-overlay-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.wizard-overlay-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.wizard-overlay {
  background: linear-gradient(135deg, rgba(255, 38, 185, 0.1) 0%, rgba(29, 86, 232, 0.1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.wizard-overlay-backdrop.active .wizard-overlay {
  transform: scale(1);
}

.wizard-overlay__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  color: var(--text-main);
  font-size: 1.5rem;
}

.wizard-overlay__close:hover {
  background: rgba(255, 38, 185, 0.1);
  border-color: var(--accent-pink);
  color: var(--accent-pink);
}

.wizard-overlay__icon {
  width: 80px;
  height: 80px;
  background: rgba(255, 38, 185, 0.15);
  border: 2px solid var(--accent-pink);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 2rem;
  font-size: 2.5rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 38, 185, 0.7);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15px rgba(255, 38, 185, 0);
  }
}

.wizard-overlay__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, var(--accent-pink) 0%, var(--accent-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.wizard-overlay__subtitle {
  font-size: 1rem;
  text-align: center;
  color: var(--accent-pink);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.wizard-overlay__content {
  text-align: center;
  color: var(--text-muted);
  line-height: 1.8;
  font-size: 1.125rem;
  margin-bottom: 2rem;
}

.wizard-overlay__features {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
  text-align: left;
}

.wizard-overlay__feature {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
}

.wizard-overlay__feature-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.wizard-overlay__feature-text {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.wizard-overlay__cta {
  text-align: center;
}

/* Responsive Overlay */
@media (max-width: 768px) {
  .wizard-overlay-backdrop {
    align-items: flex-start;
    overflow-y: auto;
    padding: 1rem;
  }

  .wizard-overlay {
    padding: 2.5rem 1.5rem;
    margin: 2rem auto;
    max-height: none;
  }

  .wizard-overlay__close {
    width: 35px;
    height: 35px;
    font-size: 1.25rem;
    top: 1rem;
    right: 1rem;
  }

  .wizard-overlay__icon {
    width: 70px;
    height: 70px;
    font-size: 2rem;
  }

  .wizard-overlay__title {
    font-size: 1.75rem;
  }

  .wizard-overlay__content {
    font-size: 1rem;
  }

  .wizard-overlay__features {
    gap: 0.75rem;
  }

  .wizard-overlay__feature {
    padding: 0.75rem;
  }

  .wizard-overlay__feature-text {
    font-size: 0.875rem;
  }
}

/* ===================================
   Print Styles
   =================================== */
@media print {
  .header,
  .footer,
  .btn,
  nav {
    display: none;
  }

  body {
    background: white;
    color: black;
  }
}
