/* === VARIABLES === */
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --accent: #007bff;
  --header: #f7f9fc;
  --instagram-pink: #E4405F;
  --transition: 0.4s ease;
}

body.dark {
  --bg: #121212;
  --text: #f0f0f0;
  --accent: #66b2ff;
  --header: #1e1e1e;
  --instagram-pink: #ff6f91;
}

/* === GLOBAL === */
body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background var(--transition), color var(--transition);
  overflow-x: hidden;
  scroll-behavior: smooth;
  animation: backgroundFade 1.5s ease;
}

header {
  text-align: center;
  padding: 4rem 1rem 2rem;
  background: var(--header);
  position: relative;
  animation: slideDown 1.2s ease forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
}

/* TITRES */
h1 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: fadeSlideDown 1s ease forwards 0.2s;
  animation-fill-mode: forwards;
}

p {
  font-size: 1.2rem;
  margin: 0;
  opacity: 0;
  animation: fadeIn 1s ease forwards 0.6s;
  animation-fill-mode: forwards;
}

/* BOUTON INSTAGRAM */
.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.2rem;
  color: white;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  padding: 0.6rem 1.4rem;
  border-radius: 40px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(236, 64, 95, 0.6);
  cursor: pointer;
  user-select: none;
  opacity: 0;
  animation: fadeInUp 1s ease forwards 1s;
  animation-fill-mode: forwards;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  overflow: hidden;
}

.instagram-link i {
  font-size: 1.5rem;
  animation: pulse 2.5s infinite;
  filter: drop-shadow(0 0 2px #fff);
  transition: transform 0.3s ease;
}

/* Hover effet animé */
.instagram-link:hover {
  transform: scale(1.1) rotate(-5deg);
  box-shadow:
    0 6px 20px rgba(236, 64, 95, 0.8),
    0 0 15px rgba(236, 64, 95, 0.8);
  text-shadow: 0 0 8px #fff;
}

.instagram-link:hover i {
  transform: scale(1.4) rotate(10deg);
}

/* Effet "shine" sur le bouton */
.instagram-link::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: rgba(255, 255, 255, 0.3);
  transform: skewX(-25deg);
  transition: all 0.7s ease;
  pointer-events: none;
  filter: blur(15px);
}

.instagram-link:hover::before {
  left: 120%;
  transition: all 0.7s ease;
}

/* BOUTON MODE SOMBRE */
#theme-toggle {
  margin-top: 1.5rem;
  padding: 0.5rem 1.2rem;
  background: none;
  border: 2px solid var(--text);
  border-radius: 50px;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 1rem;
  opacity: 0;
  animation: bounceIn 0.8s ease forwards 1.4s;
  animation-fill-mode: forwards;
}

#theme-toggle:hover {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  transform: scale(1.05);
}

/* GALERIE */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 2rem;
  max-width: 1200px;
  margin: auto;
  opacity: 0;
  animation: fadeInUp 1s ease forwards 1.6s;
  animation-fill-mode: forwards;
}

.gallery img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  transform: scale(0.95);
  opacity: 0;
  animation: imagePop 0.6s ease forwards;
  animation-delay: 1.8s;
}

.gallery img:hover {
  transform: scale(1.05);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* LIGHTBOX */
#lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s ease;
}

#lightbox img {
  max-width: 90%;
  max-height: 80vh;
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.2);
  animation: zoomIn 0.4s ease;
}

#close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: white;
  font-size: 3rem;
  cursor: pointer;
  transition: transform 0.3s ease;
}

#close:hover {
  transform: scale(1.2);
}

/* === ANIMATIONS === */
@keyframes slideDown {
  0% { transform: translateY(-30px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

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

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

@keyframes fadeSlideDown {
  0% { opacity: 0; transform: translateY(-20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
  0% { transform: scale(0.8); opacity: 0; }
  60% { transform: scale(1.1); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes imagePop {
  0% { opacity: 0; transform: scale(0.8); }
  100% { opacity: 1; transform: scale(0.95); }
}

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

@keyframes backgroundFade {
  from { background-color: #fff; }
  to { background-color: var(--bg); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  h1 {
    font-size: 2.4rem;
  }

  p {
    font-size: 1rem;
    padding: 0 1rem;
  }

  .instagram-link {
    font-size: 1rem;
    padding: 0.5rem 1rem;
  }

  #theme-toggle {
    font-size: 0.9rem;
    padding: 0.4rem 1rem;
  }

  .gallery {
    padding: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 480px) {
  header {
    padding: 3rem 1rem 1.5rem;
  }

  h1 {
    font-size: 1.8rem;
  }

  .instagram-link {
    width: 100%;
    justify-content: center;
  }

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