/* CSS personnalisé pour Happiness Lodge */

/* Variables CSS pour le mode sombre/clair - Couleurs conformes WCAG AA */
:root {
  --lodge-green: #0A3E37;
  --lodge-orange: #B34A00; /* Contraste WCAG AA 4.5:1+ sur blanc */
  --lodge-orange-light: #CC5A00; /* Pour backgrounds non-critiques */
  --lodge-gray: #F5F7F7;
  --transition-duration: 300ms;
}

/* Smooth scrolling et respect des préférences d'animation */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

/* Styles pour l'accessibilité */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Focus visible pour l'accessibilité clavier */
*:focus {
  outline: 2px solid var(--lodge-orange);
  outline-offset: 2px;
}

/* Animations des cartes */
.feature-card {
  transition: all var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.feature-card:hover .feature-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Animations des boutons */
.btn-primary, .btn-secondary, .btn-whatsapp {
  transition: all var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background-color: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}

/* Effet ripple pour les boutons */
.btn-primary::before, .btn-secondary::before {
  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 var(--transition-duration), height var(--transition-duration);
}

.btn-primary:active::before, .btn-secondary:active::before {
  width: 300px;
  height: 300px;
}

/* Navigation sticky avec effet glassmorphism */
#main-nav {
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
}

.dark #main-nav {
  background-color: rgba(17, 24, 39, 0.95);
}

/* Animations au scroll */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.fade-in-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.fade-in-right {
  opacity: 0;
  transform: translateX(30px);
  transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* Galerie lightbox */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  transition: all var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.gallery-item img {
  transition: transform var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  opacity: 0;
  transition: opacity var(--transition-duration);
  display: flex;
  align-items: end;
  padding: 1.5rem;
}

.gallery-item:hover .gallery-overlay {
  opacity: 1;
}

/* Styles pour les cartes de chambres */
.room-card {
  transition: all var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.dark .room-card {
  border-color: rgba(255, 255, 255, 0.1);
}

.room-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  border-color: var(--lodge-orange);
}

.room-card img {
  transition: transform var(--transition-duration) cubic-bezier(0.4, 0, 0.2, 1);
}

.room-card:hover img {
  transform: scale(1.08);
}

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.dark .skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

/* Mode sombre personnalisé */
.dark {
  color-scheme: dark;
}

/* Optimisations pour mobile */
@media (max-width: 640px) {
  .feature-card:hover {
    transform: translateY(-4px) scale(1.01);
  }
  
  .btn-primary, .btn-secondary {
    width: 100%;
    text-align: center;
  }
  
  .gallery-item:hover {
    transform: scale(1.02);
  }
}

/* Amélioration des contrastes pour l'accessibilité */
.text-gray-600 {
  color: #4b5563;
}

.dark .text-gray-600 {
  color: #d1d5db;
}

.text-gray-300 {
  color: #d1d5db;
}

.dark .text-gray-300 {
  color: #9ca3af;
}

/* Hero section responsive */
.hero-section {
  background-attachment: fixed;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

@media (max-width: 768px) {
  .hero-section {
    background-attachment: scroll;
    min-height: 100vh;
  }
}

/* Animations pour les icônes */
.icon-bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -8px, 0);
  }
  70% {
    transform: translate3d(0, -4px, 0);
  }
  90% {
    transform: translate3d(0, -2px, 0);
  }
}

/* Performance optimizations */
.will-change-transform {
  will-change: transform;
}

.will-change-scroll {
  will-change: scroll-position;
}

/* Print styles */
@media print {
  .no-print {
    display: none !important;
  }
  
  * {
    background: white !important;
    color: black !important;
    box-shadow: none !important;
  }
}

/* Mobile menu links */
.mobile-link {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  font-weight: 600;
  color: #374151;
  background-color: rgba(10, 62, 55, 0.05);
  transition: all var(--transition-duration) ease;
}

.dark .mobile-link {
  color: #d1d5db;
  background-color: rgba(255, 255, 255, 0.05);
}

.mobile-link:hover {
  color: #ffffff;
  background-color: var(--lodge-green);
}

.mobile-link--active {
  color: #ffffff;
  background-color: var(--lodge-orange);
}

/* Footer links */
.footer-link {
  display: inline-flex;
  align-items: center;
  color: #d1d5db;
  transition: color var(--transition-duration) ease;
}

.footer-link:hover {
  color: var(--lodge-orange);
}

/* Social links */
.social-link {
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.12);
  transition: background-color var(--transition-duration) ease;
}

.social-link:hover {
  background-color: var(--lodge-orange);
}

/* Service chips */
.service-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  background-color: rgba(10, 62, 55, 0.08);
}

.dark .service-chip {
  background-color: rgba(255, 255, 255, 0.08);
}

/* FAQ cards */
.faq-item {
  border-radius: 1rem;
  border: 1px solid rgba(10, 62, 55, 0.08);
}

.dark .faq-item {
  border-color: rgba(255, 255, 255, 0.08);
}

/* WhatsApp floating button */
.whatsapp-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
}

.whatsapp-fab__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background-color: #22c55e;
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(34, 197, 94, 0.4);
  transition: transform var(--transition-duration) ease, box-shadow var(--transition-duration) ease;
}

.whatsapp-fab__link:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(34, 197, 94, 0.55);
}

@media (max-width: 640px) {
  .whatsapp-fab {
    right: 1rem;
    bottom: 1rem;
  }

  .whatsapp-fab__link {
    width: 3.25rem;
    height: 3.25rem;
  }
}


/* Scroll reveal */
.feature-card,
.room-card,
.gallery-item,
.faq-item {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.feature-card.visible,
.room-card.visible,
.gallery-item.visible,
.faq-item.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Top bar */
.topbar {
  background-color: var(--lodge-green);
  color: #ffffff;
}

.topbar__inner {
  max-width: 80rem;
  margin: 0 auto;
  padding: 0.5rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.topbar__list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  font-size: 0.875rem;
  transition: opacity var(--transition-duration) ease;
}

.topbar__link:hover {
  opacity: 0.85;
}

.topbar__icon {
  width: 1rem;
  height: 1rem;
  font-size: 1rem;
  line-height: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.topbar__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  transition: background-color var(--transition-duration) ease;
}

.topbar__social:hover {
  background-color: rgba(255, 255, 255, 0.28);
}

/* Navigation dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #374151;
  border-radius: 0.5rem;
  transition: color var(--transition-duration) ease, background-color var(--transition-duration) ease;
}

.dark .nav-dropdown__toggle {
  color: #d1d5db;
}

.nav-dropdown__toggle:hover,
.nav-dropdown__toggle:focus {
  color: var(--lodge-orange);
  background-color: rgba(10, 62, 55, 0.08);
}

.nav-dropdown__toggle--active {
  color: var(--lodge-orange);
}

.nav-dropdown__chevron {
  width: 0.75rem;
  height: 0.75rem;
  font-size: 0.75rem;
  line-height: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-duration) ease;
}

.nav-dropdown__toggle[aria-expanded="true"] .nav-dropdown__chevron {
  transform: rotate(180deg);
}

.nav-dropdown__menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  left: 0;
  min-width: 14rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background-color: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
  border: 1px solid rgba(15, 23, 42, 0.05);
  display: grid;
  gap: 0.35rem;
  z-index: 50;
}

.dark .nav-dropdown__menu {
  background-color: #1f2937;
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.nav-dropdown__item {
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-radius: 0.6rem;
  font-size: 0.9rem;
  color: #374151;
  transition: background-color var(--transition-duration) ease, color var(--transition-duration) ease;
}

.nav-dropdown__item:hover,
.nav-dropdown__item:focus {
  background-color: rgba(10, 62, 55, 0.08);
  color: var(--lodge-orange);
}

.dark .nav-dropdown__item {
  color: #d1d5db;
}

.dark .nav-dropdown__item:hover,
.dark .nav-dropdown__item:focus {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--lodge-orange);
}

/* Mobile menu groups */
.mobile-menu__group {
  display: grid;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.mobile-menu__group:last-child {
  border-bottom: none;
}

.dark .mobile-menu__group {
  border-color: rgba(255, 255, 255, 0.08);
}

.mobile-menu__label {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  color: #6b7280;
}

.dark .mobile-menu__label {
  color: #9ca3af;
}


/* Font Awesome + Tailwind size interoperability and alignment */
/* Ensure FA icons align and size correctly when Tailwind width/height utilities are used */
i[class*="fa-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1; /* remove extra vertical space */
}

/* Map common Tailwind width/height utilities to font-size for Font Awesome icons */
/* Tailwind defaults: 1rem(16px)=w-4, 1.25rem= w-5, 1.5rem= w-6, 2rem= w-8 */
i.w-4, i.h-4 { font-size: 1rem; }
i.w-5, i.h-5 { font-size: 1.25rem; }
i.w-6, i.h-6 { font-size: 1.5rem; }
i.w-8, i.h-8 { font-size: 2rem; }

/* Optional: fixed-width icons behave better in lists/buttons; keep width from Tailwind */
.fa-fw { text-align: center; }
