/* ============================================
   ADC WEBSITE - ANIMATIONS & EFFECTS
   ============================================

   Ce fichier contient toutes les animations CSS
   pour rendre le site plus fluide et moderne.

   Inclure ce fichier après styles.css dans vos pages HTML :
   <link rel="stylesheet" href="/css/animations.css" />
*/

/* ============================================
   PAGE LOAD ANIMATION
   ============================================ */

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  opacity: 0;
  animation: fadeIn 0.5s ease-in forwards;
}

body.loaded {
  opacity: 1;
}

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

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.reveal-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   MOBILE MENU ANIMATION
   ============================================ */

#mobile-menu {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

#mobile-menu.mobile-menu-open {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================
   HEADER SCROLL EFFECT
   ============================================ */

header {
  transition: all 0.3s ease-in-out;
}

header.header-scrolled {
  background-color: rgba(23, 37, 84, 0.95);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

/* ============================================
   SCROLL PROGRESS BAR
   ============================================ */

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #0891b2, #22d3ee);
  z-index: 9999;
  transition: width 0.1s ease-out;
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
}

/* ============================================
   BACKGROUND ANIMATION CANVAS
   ============================================ */

.bg-animation {
  display: block;
  width: 100%;
  height: 100%;
}

/* ============================================
   BUTTON ENHANCEMENTS
   ============================================ */

.btn-primary {
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 14px 0 rgba(8, 145, 178, 0.39);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(8, 145, 178, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  transform: translateY(-2px);
}

/* ============================================
   CARD ENHANCEMENTS
   ============================================ */

.card {
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 12px 48px 0 rgba(31, 38, 135, 0.5);
  transform: translateY(-2px);
}

/* ============================================
   UTILITY ANIMATIONS
   ============================================ */

/* Glow effect */
.glow {
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from {
    text-shadow: 0 0 10px rgba(34, 211, 238, 0.5),
                 0 0 20px rgba(34, 211, 238, 0.3);
  }
  to {
    text-shadow: 0 0 20px rgba(34, 211, 238, 0.8),
                 0 0 30px rgba(34, 211, 238, 0.5),
                 0 0 40px rgba(34, 211, 238, 0.3);
  }
}

/* Pulse animation */
.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* Float animation */
.float {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #22d3ee 0%, #0891b2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Shimmer effect */
.shimmer {
  position: relative;
  overflow: hidden;
}

.shimmer::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  to {
    left: 100%;
  }
}

/* Image loading effect */
img {
  transition: opacity 0.3s ease-in-out;
}

img:not(.loaded) {
  opacity: 0.5;
}

img.loaded {
  opacity: 1;
}

/* Card images enhancement - subtle desaturation at rest, full color on hover */
/* Applies to ALL images in cards, EXCEPT the ADC logo (logo.png) */
.card img:not([src*="logo.png"]) {
  opacity: 1;
  filter: grayscale(30%) brightness(0.85);
  transition: filter 0.3s ease, transform 0.3s ease;
}

.card:hover img:not([src*="logo.png"]),
.group:hover img:not([src*="logo.png"]) {
  filter: grayscale(0%) brightness(1.1);
  opacity: 1;
}

/* Ensure ADC logo (logo.png) always keeps original colors everywhere */
img[src*="logo.png"] {
  filter: none !important;
  opacity: 1 !important;
}

/* Hover lift effect */
.lift-on-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.lift-on-hover:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Slide in from left */
.slide-in-left {
  animation: slideInLeft 0.6s ease-out;
}

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

/* Slide in from right */
.slide-in-right {
  animation: slideInRight 0.6s ease-out;
}

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

/* Scale in */
.scale-in {
  animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Bounce */
.bounce {
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* Typing cursor effect */
.typing-cursor::after {
  content: '|';
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Rotation */
.rotate-slow {
  animation: rotateSlow 20s linear infinite;
}

@keyframes rotateSlow {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Background gradient animation */
.animated-gradient {
  background: linear-gradient(
    -45deg,
    #1e3a8a,
    #1e40af,
    #0891b2,
    #22d3ee
  );
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Fade in up */
.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

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

/* Fade in down */
.fade-in-down {
  animation: fadeInDown 0.6s ease-out;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Zoom in */
.zoom-in {
  animation: zoomIn 0.5s ease-out;
}

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

/* Spin */
.spin {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Shake */
.shake {
  animation: shake 0.5s;
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: translateX(-5px);
  }
  20%, 40%, 60%, 80% {
    transform: translateX(5px);
  }
}

/* Ripple effect for buttons */
.btn-primary::after,
.btn-secondary::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:active::after,
.btn-secondary:active::after {
  width: 300px;
  height: 300px;
}

/* ============================================
   RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
  /* Reduce animation intensity on mobile for performance */
  .float,
  .rotate-slow,
  .animated-gradient {
    animation: none;
  }

  /* Simpler transitions on mobile */
  .card:hover {
    transform: none;
  }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ============================================
   DEPTH LAYERS SYSTEM (3 levels)
   ============================================ */

/* Level 1: Background layer (deepest) */
section {
  position: relative;
  z-index: 1;
}

/* Level 2: Content cards (middle layer) */
.card {
  z-index: 10;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37),
              0 4px 16px rgba(0, 0, 0, 0.2);
}

.card:hover {
  z-index: 15;
}

/* Level 3: Priority elements (top layer - CTAs, focus) */
.btn-primary,
.btn-secondary {
  position: relative;
  z-index: 20;
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.39),
              0 2px 8px rgba(0, 0, 0, 0.15);
}

.btn-primary:hover,
.btn-secondary:hover {
  z-index: 25;
  box-shadow: 0 8px 24px rgba(8, 145, 178, 0.5),
              0 4px 12px rgba(0, 0, 0, 0.25);
}

/* Overlay gradient for visual guidance */
.hero-overlay::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to top, rgba(30, 58, 138, 0.3), transparent);
  pointer-events: none;
  z-index: 2;
}

/* Enhanced header depth */
header {
  z-index: 50;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

header.header-scrolled {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* ============================================
   ADC VISUAL IDENTITY ENHANCEMENTS
   ============================================ */

/* Fond vidéo — fallback couleur si la vidéo ne charge pas */
body {
  background: #0f172a !important;
}

/* ADC Signature - Cyan accent top border for hero sections */
.adc-signature {
  position: relative;
}

.adc-signature::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #22d3ee, #0891b2);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 12px rgba(34, 211, 238, 0.4);
}

/* Card corner accent - subtle brand marker */
.card {
  position: relative;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Enhanced card hover with premium lift effect */
.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 60px rgba(31, 38, 135, 0.6),
              0 0 0 1px rgba(34, 211, 238, 0.2);
}

.card-accent::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, transparent 50%, rgba(34, 211, 238, 0.1) 50%);
  border-top-right-radius: 0.5rem;
  pointer-events: none;
}

/* Enhanced hover glow for primary elements */
.btn-primary {
  position: relative;
  overflow: hidden;
}

.btn-primary::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
  width: 300px;
  height: 300px;
}

/* Navigation link underline animation */
header nav a {
  position: relative;
  display: inline-block;
}

header nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #22d3ee, #0891b2);
  transform: translateX(-50%);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

header nav a:hover::after,
header nav a.active::after {
  width: 100%;
}

/* Button enhanced hover states */
.btn-secondary {
  position: relative;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(34, 211, 238, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(34, 211, 238, 0.2);
}

/* Link glow on hover */
a[href]:not(.btn-primary):not(.btn-secondary):hover {
  text-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
  transition: text-shadow 0.2s ease;
}

/* ============================================
   CTA OPTIMIZATION
   ============================================ */

/* Enhanced CTA contrast and visibility */
.btn-primary {
  background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
  box-shadow: 0 4px 14px rgba(8, 145, 178, 0.45),
              0 2px 8px rgba(0, 0, 0, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.15);
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  box-shadow: 0 8px 24px rgba(8, 145, 178, 0.6),
              0 4px 12px rgba(0, 0, 0, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-3px) scale(1.02);
}

.btn-primary:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.4);
}

/* Secondary CTA enhanced */
.btn-secondary {
  border-width: 2px;
  border-color: #0891b2;
  color: #22d3ee;
  font-weight: 600;
  letter-spacing: 0.025em;
  box-shadow: 0 2px 8px rgba(8, 145, 178, 0.2),
              inset 0 0 0 0 rgba(34, 211, 238, 0);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
  background: rgba(34, 211, 238, 0.12);
  border-color: #22d3ee;
  color: #fff;
  box-shadow: 0 6px 20px rgba(34, 211, 238, 0.3),
              inset 0 0 0 2px rgba(34, 211, 238, 0.15);
  transform: translateY(-2px);
}

/* CTA breathing room utility */
.cta-section {
  padding: 3rem 0;
  margin-top: 4rem;
  margin-bottom: 4rem;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.3), transparent);
}

/* Persuasive CTA wrapper */
.cta-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

@media (min-width: 768px) {
  .cta-wrapper {
    flex-direction: row;
    justify-content: center;
    gap: 1.5rem;
  }
}

/* ============================================
   MOBILE PREMIUM ENHANCEMENTS
   ============================================ */

@media (max-width: 768px) {
  /* Touch-friendly zones (min 44x44px WCAG) */
  .btn-primary,
  .btn-secondary,
  a[href] {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* Mobile menu enhanced */
  #mobile-menu {
    padding: 1rem;
    background: rgba(23, 37, 84, 0.98);
    backdrop-filter: blur(20px);
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  }

  #mobile-menu a {
    padding: 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
  }

  #mobile-menu a:active {
    transform: scale(0.98);
    background: rgba(34, 211, 238, 0.1);
  }

  /* Reduce card padding for mobile breathing room */
  .card {
    padding: 1.5rem !important;
  }

  /* Hero spacing optimization */
  section.py-20 {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }

  /* Button full-width mobile when appropriate */
  .btn-primary.block,
  .btn-secondary.block {
    width: 100%;
    justify-content: center;
  }

  /* Tap highlight color */
  * {
    -webkit-tap-highlight-color: rgba(34, 211, 238, 0.2);
  }

  /* Larger text for readability */
  body {
    font-size: 16px;
    line-height: 1.6;
  }

  /* Mobile-friendly header */
  header {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  /* Improved mobile hamburger button */
  #mobile-menu-button {
    min-width: 44px;
    min-height: 44px;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: background 0.2s ease;
  }

  #mobile-menu-button:active {
    background: rgba(34, 211, 238, 0.1);
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  .scroll-progress,
  .bg-animation,
  .shimmer::before {
    display: none !important;
  }
}
