/**
 * Karten-Komponenten Styles - Optimized
 * Modern Glassmorphism Card Design
 *
 * OPTIMIZATIONS v2.2.0:
 * - Consolidated redundant styles
 * - Improved CSS custom properties usage
 * - Better performance with reduced repaints
 * - Streamlined media queries
 * - Removed duplicate declarations
 * - Enhanced accessibility
 *
 * @version 2.2.0
 * @updated 2025-10-29
 */

/* ========================================
   CSS Custom Properties
======================================== */
:root {
  --card-transition-base: cubic-bezier(0.34, 1.56, 0.64, 1);
  --card-transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --card-blur-base: 24px;
  --card-blur-hover: 28px;
  --card-shadow-base: 0 10px 40px rgba(0, 0, 0, 0.25), 0 2px 8px rgba(0, 0, 0, 0.15);
  --card-shadow-hover: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 40px rgba(7, 161, 255, 0.2);
  --card-glow-color: rgba(7, 161, 255, 0.4);
  --card-min-width: 280px;
  --card-min-height: 300px;
}

/* ========================================
   Full Screen Section Layout
======================================== */
.full-screen-section {
  min-height: 100vh;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  padding: var(--spacing-xl) 0;
  margin-top: 0 !important;
}

/* ========================================
   Base Card Styling
======================================== */
.card {
  /* Layout */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  min-width: var(--card-min-width);
  min-height: var(--card-min-height);
  padding: clamp(1.5rem, 3vw, 2rem);
  position: relative;
  overflow: hidden;

  /* Visual Style */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow-base), inset 0 1px 0 rgba(255, 255, 255, 0.12);

  /* Glassmorphism */
  -webkit-backdrop-filter: blur(var(--card-blur-base)) saturate(1.3);
  backdrop-filter: blur(var(--card-blur-base)) saturate(1.3);

  /* Transitions */
  transition: transform 0.4s var(--card-transition-base),
              background 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.4s ease,
              opacity 0.4s ease-out;

  /* Performance */
  will-change: transform, opacity;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;

  /* Initial state for JS animation */
  opacity: 0;
}

/* Remove will-change when not hovering */
.card:not(:hover) {
  will-change: auto;
}

/* ========================================
   Card Overlay Effects
======================================== */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top left, rgba(7, 161, 255, 0.15) 0%, rgba(88, 166, 255, 0.08) 30%, transparent 70%);
  border-radius: inherit;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.4s ease, transform 0.4s ease;
  pointer-events: none;
}

.card:hover::before {
  opacity: 1;
  transform: scale(1);
}

/* ========================================
   Card Hover State
======================================== */
.card:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.06) 100%);
  border-color: var(--card-glow-color);
  -webkit-backdrop-filter: blur(var(--card-blur-hover)) saturate(1.5);
  backdrop-filter: blur(var(--card-blur-hover)) saturate(1.5);
  box-shadow: var(--card-shadow-hover),
              0 0 80px rgba(7, 161, 255, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.25),
              inset 0 -1px 0 rgba(7, 161, 255, 0.15);
  transform: translateY(-8px) scale(1.02);
}

/* ========================================
   Card Focus State
======================================== */
.card:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* ========================================
   Card Icon Wrapper
======================================== */
.card .icon-wrapper {
  /* Layout */
  display: flex;
  align-items: center;
  justify-content: center;
  width: clamp(56px, 10vw, 64px);
  height: clamp(56px, 10vw, 64px);
  margin: 0 auto clamp(1rem, 2vw, 1.5rem);
  position: relative;
  overflow: hidden;

  /* Visual Style */
  font-size: clamp(2rem, 4vw, 2.5rem);
  background: linear-gradient(135deg, rgba(7, 161, 255, 0.18) 0%, rgba(7, 161, 255, 0.08) 100%);
  border: 1.5px solid rgba(7, 161, 255, 0.25);
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25),
              0 2px 8px rgba(7, 161, 255, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.12);

  /* Glassmorphism */
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);

  /* Transitions */
  transition: transform 0.5s var(--card-transition-base),
              background 0.3s ease,
              border-color 0.3s ease,
              box-shadow 0.4s ease;
}

/* Icon Shimmer Effect */
.card .icon-wrapper::before {
  content: "";
  position: absolute;
  inset: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(120deg, 
    transparent 0%, 
    rgba(255, 255, 255, 0.15) 45%, 
    rgba(7, 161, 255, 0.2) 50%, 
    rgba(255, 255, 255, 0.15) 55%, 
    transparent 100%);
  transform: translateX(-100%) rotate(45deg);
  transition: transform 0.6s var(--card-transition-smooth);
  opacity: 0;
}

.card:hover .icon-wrapper::before {
  opacity: 1;
  transform: translateX(100%) rotate(45deg);
}

/* Icon Wrapper Hover State */
.card:hover .icon-wrapper {
  background: linear-gradient(135deg, 
    rgba(7, 161, 255, 0.45) 0%, 
    rgba(7, 161, 255, 0.25) 50%, 
    rgba(7, 161, 255, 0.15) 100%);
  border-color: rgba(7, 161, 255, 0.6);
  transform: scale(1.15) rotate(-5deg);
  box-shadow: 0 0 40px rgba(7, 161, 255, 0.4),
              0 0 80px rgba(7, 161, 255, 0.2),
              0 8px 32px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.25),
              inset 0 -1px 0 rgba(7, 161, 255, 0.3);
}

/* ========================================
   Card Content Elements
======================================== */

/* Card Title */
.card-title {
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 600;
  margin-bottom: clamp(0.75rem, 1.5vw, 1rem);
  color: var(--text-primary);
  line-height: 1.3;
  transition: color 0.3s ease,
              transform 0.4s var(--card-transition-base),
              text-shadow 0.3s ease;
}

.card:hover .card-title {
  color: #ffffff;
  text-shadow: 0 0 20px rgba(7, 161, 255, 0.5),
               0 0 40px rgba(7, 161, 255, 0.25),
               0 2px 8px rgba(0, 0, 0, 0.4);
  transform: translateY(-3px);
}

/* Card Eyebrow (Category Label) */
.card-title[data-eyebrow]::before {
  content: attr(data-eyebrow);
  display: block;
  font-size: clamp(0.7rem, 1.5vw, 0.8rem);
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: clamp(0.5rem, 1vw, 0.75rem);
  transition: color 0.3s ease,
              text-shadow 0.3s ease,
              letter-spacing 0.3s ease;
}

.card:hover .card-title[data-eyebrow]::before {
  color: #ffffff;
  text-shadow: 0 0 10px rgba(7, 161, 255, 0.6),
               0 0 20px rgba(7, 161, 255, 0.3);
  letter-spacing: 0.15em;
}

/* Card Description Text */
.card-text {
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: clamp(0.875rem, 2vw, 0.95rem);
  transition: color 0.3s ease;
  flex-grow: 1;
}

.card:hover .card-text {
  color: rgba(255, 255, 255, 0.95);
}

/* ========================================
   Features Section Layout
======================================== */

/* Features Section Container */
#features.section {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 !important;
  margin: 0 !important;
  position: relative;
  z-index: 1;
}

/* Features Content Wrapper */
.features-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 80vh;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
  position: relative;
}

/* Background Ambient Glow */
.features-content::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, 
    rgba(7, 161, 255, 0.08) 0%, 
    rgba(88, 166, 255, 0.04) 30%, 
    transparent 60%);
  transform: translate(-50%, -50%);
  opacity: 0.6;
  pointer-events: none;
  z-index: -1;
  filter: blur(60px);
}

/* Features Cards Grid */
.features-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 2.5rem);
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  perspective: 1000px;
}

/* ========================================
   Responsive Design
======================================== */

/* Tablet (769px - 1024px) - 2 Columns */
@media (min-width: 769px) and (max-width: 1024px) {
  .features-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: clamp(1.75rem, 2.5vw, 2.25rem);
    max-width: 900px;
  }

  .features-content {
    padding: 0 clamp(1.5rem, 3vw, 2rem);
  }

  .card {
    padding: clamp(1.5rem, 2.5vw, 1.875rem);
  }

  .card:hover {
    transform: translateY(-6px) scale(1.015);
  }
}

/* Mobile (≤768px) - 1 Column */
@media (max-width: 768px) {
  :root {
    --card-min-width: 0;
    --card-min-height: 0;
  }

  #features.section {
    padding: clamp(1rem, 3vw, 1.5rem) 0 !important;
  }

  .features-content {
    min-height: 70vh;
    padding: 0 clamp(1rem, 4vw, 1.5rem);
  }

  .features-cards {
    grid-template-columns: 1fr;
    gap: clamp(1.25rem, 4vw, 1.75rem);
    margin-top: clamp(1rem, 3vw, 1.5rem);
    padding: 0 clamp(0.75rem, 3vw, 1rem);
  }

  .card {
    height: auto;
    padding: clamp(1.25rem, 4vw, 1.75rem);
    transition: transform 0.3s ease,
                background 0.25s ease,
                border-color 0.25s ease,
                box-shadow 0.3s ease,
                opacity 0.4s ease-out;
  }

  .card:hover {
    transform: translateY(-4px) scale(1.01);
  }

  .card .icon-wrapper {
    width: clamp(52px, 12vw, 60px);
    height: clamp(52px, 12vw, 60px);
    font-size: clamp(1.75rem, 5vw, 2.25rem);
    margin-bottom: clamp(0.875rem, 3vw, 1.25rem);
  }

  .card:hover .icon-wrapper {
    transform: scale(1.08) rotate(-3deg);
  }
}

/* ========================================
   Accessibility - Reduced Motion
======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
  }

  .card:hover,
  .card:hover .icon-wrapper,
  .card:hover .card-title {
    transform: none;
  }

  .features-content::before {
    animation: none;
  }
}

/* ========================================
   Print Styles
======================================== */
@media print {
  .card {
    background: white;
    border: 1px solid #ddd;
    box-shadow: none;
    backdrop-filter: none;
    page-break-inside: avoid;
  }

  .card::before,
  .features-content::before {
    display: none;
  }

  .features-cards {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}
