/* ==================================================
   CARD BASE COMPONENT - Common Card Styles
   ================================================== */

/* ==================== CARD CONTAINER VARIABLES ==================== */

#the-problem-container .feature-card-container {
  max-width: none;
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
  z-index: 1;
  --card-radius: 2.5rem;
  --ring-width: 3px;
  --outer-glow-blur: 20px;
  --outer-glow-spread: 3px;
  --inner-glow-size: 12px;
  --inner-glow-blur: 18px;
  --inner-glow-feather: 12px;
  --ring-angle: 220deg;
  --ring-stops: 
    rgba(255,122,0,1) 0deg, 
    rgba(255,45,85,1) 50deg, 
    rgba(255,0,153,1) 100deg, 
    rgba(191,90,242,1) 150deg, 
    rgba(94,92,230,1) 200deg, 
    rgba(10,132,255,1) 250deg, 
    rgba(100,210,255,1) 300deg, 
    rgba(255,122,0,1) 360deg;
  --ring-gradient: conic-gradient(from var(--ring-angle), var(--ring-stops));
}

/* ==================== BASE CARD STYLES ==================== */

#the-problem-container .lg-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100% !important;
  min-height: 170px;
  padding: 2.5rem;
  overflow: hidden;
  z-index: 2;
  border-radius: var(--card-radius);
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.02), 
    inset 0 1px 2px rgba(100, 180, 255, 0.04), 
    inset 0 -1px 2px rgba(0, 0, 0, 0.01);
  will-change: border-color;
  color: #fff;
  transform: none;
  transform-style: preserve-3d;
  perspective: 1200px;
  isolation: isolate;
  transition: 
    transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1), 
    box-shadow 700ms cubic-bezier(0.2, 0.8, 0.2, 1), 
    border-color 700ms ease;
}

#the-problem-container .lg-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: 
    radial-gradient(ellipse at center, rgba(100, 180, 255, 0) 0%, rgba(255, 255, 255, 0) 70%), 
    linear-gradient(135deg, rgba(100, 180, 255, 0.002) 0%, rgba(255, 255, 255, 0.0003) 50%, rgba(100, 180, 255, 0.002) 100%);
  backdrop-filter: blur(6px) saturate(110%) contrast(102%);
  -webkit-backdrop-filter: blur(6px) saturate(110%) contrast(102%);
}

#the-problem-container .lg-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transform: translate3d(0, 0, 0);
  background: 
    radial-gradient(120% 120% at 50% 50%, rgba(191, 90, 242, 0) 0%, rgba(191, 90, 242, 0.24) 18%, rgba(94, 92, 230, 0.18) 42%, rgba(255, 255, 255, 0) 70%), 
    radial-gradient(80% 60% at 18% 22%, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0) 60%), 
    radial-gradient(80% 60% at 82% 78%, rgba(10, 132, 255, 0.20) 0%, rgba(10, 132, 255, 0) 60%), 
    linear-gradient(135deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0.12) 38%, rgba(255, 255, 255, 0) 60%);
  will-change: opacity, transform;
  transition: opacity 600ms ease, transform 600ms ease;
}

/* ==================== CARD EFFECT LAYERS ==================== */

#the-problem-container .lg-card__ring {
  --outline-width: var(--ring-width);
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 3;
  pointer-events: none;
  background: var(--ring-gradient);
  padding: var(--outline-width);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 1;
  filter: saturate(140%) brightness(122%);
  transition: opacity 450ms ease, filter 450ms ease;
}

/* Masquer spécifiquement pour card-b pour éviter les artefacts */
#the-problem-container .card-b .lg-card__ring {
  display: none;
}

#the-problem-container .lg-card:hover .lg-card__ring,
#the-problem-container .lg-card:focus-within .lg-card__ring {
  opacity: 1;
  filter: saturate(140%) brightness(122%);
}

#the-problem-container .lg-card__innerband {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 1;
  padding: var(--inner-glow-size);
  background: 
    var(--ring-gradient), 
    radial-gradient(closest-side, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 70%);
  background-blend-mode: screen;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  filter: blur(var(--inner-glow-blur)) saturate(128%);
  opacity: .48;
  transition: filter .22s ease, opacity .22s ease;
}

/* Masquer spécifiquement pour card-b pour éviter les artefacts */
#the-problem-container .card-b .lg-card__innerband {
  display: none;
}

#the-problem-container .lg-card__innerfeather {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 0;
  background: var(--ring-gradient);
  background-blend-mode: screen;
  -webkit-mask: 
    linear-gradient(#000, transparent) top/100% var(--inner-glow-feather) no-repeat, 
    linear-gradient(transparent, #000) bottom/100% var(--inner-glow-feather) no-repeat, 
    linear-gradient(90deg, #000, transparent) left/var(--inner-glow-feather) 100% no-repeat, 
    linear-gradient(90deg, transparent, #000) right/var(--inner-glow-feather) 100% no-repeat;
  mask: 
    linear-gradient(#000, transparent) top/100% var(--inner-glow-feather) no-repeat, 
    linear-gradient(transparent, #000) bottom/100% var(--inner-glow-feather) no-repeat, 
    linear-gradient(90deg, #000, transparent) left/var(--inner-glow-feather) 100% no-repeat, 
    linear-gradient(90deg, transparent, #000) right/var(--inner-glow-feather) 100% no-repeat;
  filter: blur(calc(var(--inner-glow-blur) * 0.65)) saturate(126%);
  opacity: .38;
}

/* ==================== CARD CONTENT ==================== */

#the-problem-container .liquid-glass-card > *,
#the-problem-container .lg-card > * {
  position: relative;
  z-index: 2;
}

#the-problem-container .card-motion {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: inherit;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  will-change: transform;
  transition: transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ==================== HEADLINE LAYOUT ==================== */

/* Card A, B, C and D headline layout */
#the-problem-container .card-a-headline,
#the-problem-container .card-b-headline,
#the-problem-container .card-c-headline,
#the-problem-container .card-d-headline {
  display: flex;
  align-items: center;
  gap: 2rem;
  width: 100%;
  justify-content: flex-start;
  padding-left: 1rem;
}

#the-problem-container .card-a-headline .image-container,
#the-problem-container .card-b-headline .logo-container,
#the-problem-container .card-c-headline .image-container,
#the-problem-container .card-d-headline .image-container {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

#the-problem-container .card-a-headline .text-container,
#the-problem-container .card-b-headline .text-container,
#the-problem-container .card-c-headline .text-container,
#the-problem-container .card-d-headline .text-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

#the-problem-container .card-a-headline .text-container h3,
#the-problem-container .card-b-headline .text-container h3,
#the-problem-container .card-c-headline .text-container h3,
#the-problem-container .card-d-headline .text-container h3 {
  margin: 0;
  line-height: 1.2;
}

#the-problem-container .card-a-headline .text-container h3 span:not(.block),
#the-problem-container .card-b-headline .text-container h3 span:not(.block),
#the-problem-container .card-c-headline .text-container h3 span:not(.block),
#the-problem-container .card-d-headline .text-container h3 span:not(.block) {
  display: inline;
  margin-right: 0.5rem;
}

/* ==================== MULTICOLOR TEXT STYLE ==================== */

/* Flat Apple-like multicolor gradient (no glow) for headings/text */
#the-problem-container .ai-multicolor-flat {
  background: linear-gradient(90deg,
    #3b82f6 0%,   /* blue-500 */
    #6366f1 25%,  /* indigo-500 */
    #a78bfa 45%,  /* purple-400 */
    #f472b6 65%,  /* pink-400 */
    #fb7185 82%,  /* rose-400 */
    #fb7185 100%  /* end on rose, remove orange */
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  text-shadow: none !important;
  filter: none !important;
}

/* ==================== BROWSER COMPATIBILITY ==================== */

@supports not (mask-composite: exclude) {
  #the-problem-container .liquid-glass-card,
  #the-problem-container .lg-card {
    border: var(--ring-width) solid transparent;
    border-image: var(--ring-gradient) 1;
    border-radius: var(--card-radius);
  }
  #the-problem-container .liquid-glass-card .liquid-glass-outline,
  #the-problem-container .lg-card .lg-card__ring {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  #the-problem-container .liquid-glass-card,
  #the-problem-container .lg-card {
    transition: none;
    transform: none;
  }
  #the-problem-container .liquid-glass-card:hover,
  #the-problem-container .liquid-glass-card:focus-within {
    transform: none;
  }
}

/* ==================== MOBILE CARD BASE STYLES ==================== */

@media (max-width: 768px) {
  /* Mobile card base styling - Dark background with subtle violet effects */
  #the-problem-container .lg-card {
    height: auto;
    min-height: 240px; /* Ensure minimum height for proper content accommodation */
    padding: 2.5rem 2rem; /* Increased vertical padding */
    background: 
      radial-gradient(ellipse at center, hsla(250, 90%, 50%, 0.12) 0%, hsla(280, 85%, 45%, 0.08) 40%, rgb(9, 5, 24) 70%),
      rgb(9, 5, 24) !important;
    box-shadow: 
      inset 0 0 30px hsla(220, 95%, 55%, 0.10),
      inset 0 0 60px hsla(250, 90%, 50%, 0.05) !important;
  }
  
  /* Remove all glassmorphism effects on mobile */
  #the-problem-container .lg-card::before {
    display: none !important;
  }
  
  /* Remove colored rings and inner glow on mobile */
  #the-problem-container .lg-card__ring,
  #the-problem-container .lg-card__innerband,
  #the-problem-container .lg-card__innerfeather {
    display: none !important;
  }
  
  /* Remove outer glow container on mobile */
  #the-problem-container .feature-card-container::before {
    display: none !important;
  }
  
  /* Mobile headline layout - switch to vertical */
  #the-problem-container .card-a-headline,
  #the-problem-container .card-b-headline,
  #the-problem-container .card-c-headline,
  #the-problem-container .card-d-headline {
    flex-direction: column;
    gap: 1.5rem; /* Increased gap between image and text */
    text-align: center;
    justify-content: center;
    height: 100%;
  }
  
  /* Mobile text container centering */
  #the-problem-container .card-a-headline .text-container,
  #the-problem-container .card-b-headline .text-container,
  #the-problem-container .card-c-headline .text-container,
  #the-problem-container .card-d-headline .text-container {
    align-items: center;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  
  /* Mobile-optimized text sizing */
  #the-problem-container .card-a-headline .text-container h3,
  #the-problem-container .card-b-headline .text-container h3,
  #the-problem-container .card-c-headline .text-container h3,
  #the-problem-container .card-d-headline .text-container h3 {
    font-size: 1.4rem; /* Slightly smaller for better mobile fit */
    line-height: 1.3;
    margin: 0;
  }
  
  #the-problem-container .card-a-headline .text-container .ai-multicolor-flat,
  #the-problem-container .card-b-headline .text-container .ai-multicolor-flat,
  #the-problem-container .card-c-headline .text-container .ai-multicolor-flat,
  #the-problem-container .card-d-headline .text-container .ai-multicolor-flat {
    font-size: 1.6rem; /* Consistent highlight text size */
  }
}