/* Scroll progressif pour la navigation */
html {
  scroll-behavior: smooth;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 25% 25%, rgba(251, 191, 36, 0.05) 2px, transparent 2px),
    radial-gradient(circle at 75% 75%, rgba(245, 158, 11, 0.03) 1px, transparent 1px),
    linear-gradient(45deg, rgba(0, 0, 0, 0.02) 25%, transparent 25%, transparent 75%, rgba(0, 0, 0, 0.02) 75%);
  background-size: 60px 60px, 40px 40px, 120px 120px;
  background-position: 0 0, 30px 30px, 0 0;
  z-index: -1;
  filter: blur(20px) brightness(0.15);
}

.beer-card:hover img {
  transform: translateY(-10px) rotate(-8deg) scale(1.08);
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.4));
}
.beer-card img {
  transition: transform 0.4s ease-out, filter 0.4s ease;
}

/* Badge éphémère avec animation */
.ephemeral-badge {
  animation: badgePulse 2s ease-in-out infinite;
  box-shadow: 0 0 10px rgba(251, 146, 60, 0.5);
}

@keyframes badgePulse {
  0%, 100% {
    transform: rotate(12deg) scale(1);
  }
  50% {
    transform: rotate(12deg) scale(1.05);
  }
}

.title-hover {
  letter-spacing: 0.1em !important;
  transition: letter-spacing 0.5s ease-out !important;
  display: inline-block;
}

.title-hover:hover {
  letter-spacing: 0.54em !important;
}

/* Force la transition même après AOS */
h1.title-hover {
  transition: letter-spacing 0.4s ease-out !important;
}

h1.title-hover:hover {
  letter-spacing: 0.4em !important;
}

.menu-toggle {
  cursor: pointer;
}

.signature {
  font-family: 'Dancing Script', cursive;
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
  filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.3));
}

.animation-delay-300 {
  animation-delay: 300ms;
}

/* Effet de focus pour l'accessibilité */
a:focus, button:focus {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
}

/* Animation du bouton */
.btn-primary {
  background: linear-gradient(45deg, #ffffff, #f3f4f6);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(45deg, #f3f4f6, #e5e7eb);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Bulles animées en arrière-plan */
.bubble {
  position: absolute;
  background: rgba(251, 191, 36, 0.3);
  border-radius: 50%;
  animation: bubbleFloat 4s ease-in-out infinite;
  z-index: 0;
}

.bubble:nth-child(odd) {
  background: rgba(245, 158, 11, 0.2);
  animation-duration: 5s;
}

.bubble:nth-child(3n) {
  background: rgba(217, 119, 6, 0.25);
  animation-duration: 6s;
}

/* Flocons */
#snow-container {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
}

.snowflake {
  position: absolute;
  top: -12px;
  left: 0;
  width: var(--size, 10px);
  height: var(--size, 10px);
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.7) 45%, rgba(255,255,255,0.1) 70%, rgba(255,255,255,0) 100%);
  filter: drop-shadow(0 0 8px rgba(208, 233, 255, 0.55));
  animation: snowFall linear infinite, snowDrift ease-in-out infinite;
  opacity: 0.75;
}

.snowflake::before,
.snowflake::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(255,255,255,0.1));
  clip-path: polygon(48% 0, 52% 0, 52% 42%, 100% 42%, 100% 58%, 52% 58%, 52% 100%, 48% 100%, 48% 58%, 0 58%, 0 42%, 48% 42%);
}

.snowflake::before { transform: rotate(60deg); }
.snowflake::after { transform: rotate(120deg); }

@keyframes snowFall {
  0% { transform: translate3d(var(--start-x, 0), -12px, 0); }
  100% { transform: translate3d(var(--end-x, 0), 110vh, 0); }
}

@keyframes snowDrift {
  0%, 100% { transform: translateX(-4px) rotate(0deg); }
  50% { transform: translateX(4px) rotate(3deg); }
}

@keyframes bubbleFloat {
  0% {
    transform: translateY(500px) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(0px) scale(1);
    opacity: 0;
  }
}

/* Léger flottement pour la bouteille */
.gentle-float {
  animation: gentleFloat 4s ease-in-out infinite;
}

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

/* Effet hover-lift pour les cards et éléments interactifs */
.hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* Amélioration des liens et de l'accessibilité */
a, button {
  transition: all 0.3s ease;
}

a:focus, button:focus {
  outline: 2px solid #fbbf24;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Respecte les préférences utilisateur en limitant les animations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* Effet de feedback sur les liens de navigation */
nav a {
  position: relative;
  transition: color 0.3s ease;
}

nav a:hover {
  color: #fbbf24;
}

nav a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -4px;
  left: 0;
  background-color: #fbbf24;
  transition: width 0.3s ease;
}

nav a:hover::after {
  width: 100%;
}

/* Indicateur de progression de scroll */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(to right, #fbbf24, #f59e0b);
  z-index: 60;
  transition: width 0.1s ease;
}

/* Animation améliorée pour les boutons */
.btn-enhanced {
  position: relative;
  overflow: hidden;
}

.btn-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s ease;
}

.btn-enhanced:hover::before {
  left: 100%;
}

/* Amélioration responsive pour mobile */
@media (max-width: 768px) {
  .relative.group.h-96 {
    height: 24rem;
    margin-bottom: 0rem;
  }
  
  .absolute.-bottom-8.left-8 {
    position: relative;
    bottom: auto;
    left: auto;
    margin-top: 1rem;
    margin-left: auto;
    margin-right: auto;
    width: auto;
    max-width: 300px;
    display: flex;
    justify-content: center;
  }
  
  .absolute.-bottom-8.left-8 .flex {
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
  }
  
  .absolute.-bottom-8.left-8 .w-12 {
    flex-shrink: 0;
  }
  
  .gentle-float {
    height: 16rem;
  }
  
  /* Assurer que le texte ne déborde pas */
  .absolute.-bottom-8.left-8 p {
    font-size: 0.875rem;
    line-height: 1.2;
  }
  
  .absolute.-bottom-8.left-8 .text-sm {
    font-size: 0.75rem;
  }
}

/* Assurer que les bulles restent en arrière-plan */
.bubble {
  z-index: 0 !important;
  pointer-events: none;
}

/* Styles pour les modales de bières */
.beer-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s ease;
}

.beer-modal.active {
  opacity: 1;
  visibility: visible;
}

.beer-modal-content {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  border-radius: 20px;
  max-width: 900px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.8) translateY(30px);
  transition: transform 0.4s ease;
  border: 1px solid rgba(251, 191, 36, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.beer-modal.active .beer-modal-content {
  transform: scale(1) translateY(0);
}

.beer-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 10;
  transition: color 0.3s ease;
}

.beer-modal-close:hover {
  color: #fbbf24;
}

.beer-modal-header {
  position: relative;
  height: 300px;
  background-size: cover;
  background-position: center;
  border-radius: 20px 20px 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.beer-modal-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.beer-modal-title {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.beer-modal-title img {
  max-height: 160px;
  max-width: 80%;
  object-fit: contain;
  filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.8));
  transition: transform 0.3s ease;
  animation: titleFloat 3s ease-in-out infinite;
}

.beer-modal-title img:hover {
  transform: scale(1.1);
  animation-play-state: paused;
}

/* Animation flottante permanente pour le titre */
@keyframes titleFloat {
  0%, 100% {
    transform: translateY(0px) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.02);
  }
}

/* Animation d'entrée des éléments de la modale */
.beer-modal.active .beer-modal-header {
  animation: slideInDown 0.5s ease-out;
}

.beer-modal.active .beer-stats {
  animation: slideInUp 0.6s ease-out 0.2s both;
}

.beer-modal.active .beer-description {
  animation: slideInUp 0.6s ease-out 0.3s both;
}

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

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

.beer-modal-body {
  padding: 2rem;
  color: white;
}

.beer-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.beer-stat {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
}

.beer-stat-label {
  font-size: 0.9rem;
  color: #fbbf24;
  margin-bottom: 0.5rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.beer-stat-bar {
  background: rgba(255, 255, 255, 0.1);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.beer-stat-fill {
  height: 100%;
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  border-radius: 4px;
  transition: width 0.8s ease;
  width: 0%;
}

.beer-stat-value {
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
}

.beer-description {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 1.5rem;
  border-left: 4px solid #fbbf24;
}

.beer-description h3 {
  color: #fbbf24;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

.beer-description p {
  line-height: 1.6;
  color: #e5e7eb;
}

/* Animation pour les barres de stats */
@keyframes fillBar {
  from { width: 0%; }
}

/* Responsive modal */
@media (max-width: 768px) {
  .beer-modal-content {
    width: 95%;
    margin: 1rem;
    max-height: 95vh;
  }
  
  .beer-modal-header {
    height: 200px;
  }
  
  .beer-modal-title img {
    max-height: 100px;
    max-width: 90%;
  }
  
  .beer-modal-body {
    padding: 1rem;
  }
  
  .beer-stats {
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .beer-stat {
    padding: 1rem;
  }
  
  .beer-description {
    padding: 1rem;
  }
  
  .beer-description h3 {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
  }
  
  .beer-description p {
    font-size: 0.9rem;
    line-height: 1.5;
  }
}
