/* Global overflow prevention - Empêcher toute scrollbar horizontale */
html {
    overflow-x: hidden !important;
    overflow-y: auto;
    max-width: 100vw;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    width: 100vw;
}

body {
    overflow-x: hidden !important;
    overflow-y: auto; /* Auto pour éviter la double scrollbar */
    max-width: 100vw;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100vw;
    position: relative;
}

/* Forcer tous les éléments enfants à ne pas déborder horizontalement */
* {
    max-width: 100%;
}

html, body, #hero, .main-content, section, header, main, footer {
    max-width: 100vw !important;
}

*, *::before, *::after {
    box-sizing: border-box;
}

/* Ensure containers don't overflow */
.container {
    max-width: 100%;
    box-sizing: border-box;
}

/* Protection contre les doublons de navbar */
#sidebar-nav:not(:first-of-type) {
    display: none !important;
}

#mobile-menu:not(:first-of-type) {
    display: none !important;
}

/* Prévenir les doubles barres de scroll verticales */
section {
    box-sizing: border-box;
    position: relative;
}

/* S'assurer que les sections min-h-screen ne causent pas de débordement */
section.min-h-screen {
    min-height: calc(100vh - 1px); /* Légère réduction pour éviter le débordement */
}

/* Sidebar Navigation Styles */
#sidebar-nav {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: 280px;
    background: linear-gradient(180deg, rgba(20, 20, 20, 0.98) 0%, rgba(10, 10, 10, 0.98) 100%);
    backdrop-filter: blur(10px);
    z-index: 999; /* Légèrement sous la top navbar */
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(191, 149, 63, 0.2);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto; /* Scroll interne si contenu trop long */
    overflow-x: hidden;
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    will-change: transform, opacity;
    display: flex;
    flex-direction: column;
}

#sidebar-nav.sidebar-hidden {
    transform: translateX(-100%) !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55), 
                opacity 0.8s ease-out,
                visibility 0.8s ease-out;
}

/* Animation de sortie fluide pour la sidebar */
@keyframes slideOutLeft {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-100%);
        opacity: 0;
    }
}

/* Animation d'entrée fluide pour la sidebar */
@keyframes slideInLeft {
    0% {
        transform: translateX(-100%);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.sidebar-logo {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid rgba(191, 149, 63, 0.2);
}

.sidebar-nav-list {
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 2.5rem; /* Espacement très large entre chaque lien pour bien aérer */
    /* Suppression de flex: 1 pour que le gap fonctionne correctement */
}

.sidebar-nav-item {
    padding: 0.875rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #F0EDE5;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    transition: all 0.3s ease;
    position: relative;
}

.sidebar-nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #BF953F, #AA771C);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active-nav-link {
    background: rgba(191, 149, 63, 0.1);
    color: #FCF6BA;
}

.sidebar-nav-item:hover::before,
.sidebar-nav-item.active-nav-link::before {
    transform: scaleY(1);
}

.sidebar-nav-icon {
    width: 20px;
    height: 20px;
    color: #BF953F;
}

/* Séparateur avant le bouton Réserver pour le distinguer */
.sidebar-booking-separator {
    margin-top: auto; /* Pousse le bouton vers le bas */
    padding-top: 3rem; /* Augmenté de 1.5rem à 3rem pour encore plus d'écart */
    border-top: 1px solid rgba(191, 149, 63, 0.2);
}

/* Style spécial pour le bouton Réserver */
.sidebar-booking-btn {
    background: linear-gradient(135deg, #BF953F 0%, #AA771C 100%) !important;
    border-radius: 8px;
    padding: 12px 20px !important;
    margin: 0.5rem 1rem !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(191, 149, 63, 0.3);
}

.sidebar-booking-btn:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #BF953F 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(191, 149, 63, 0.5);
}

.sidebar-booking-btn::before {
    display: none; /* Pas de barre latérale pour le bouton Réserver */
}

.sidebar-booking-btn .sidebar-nav-icon {
    color: #000 !important; /* Icône noire pour contraster avec le fond doré */
}

.sidebar-booking-btn span {
    color: #000 !important; /* Texte noir pour contraster */
    font-weight: 600;
}

.sidebar-nav-item[href="#booking"]::before {
    display: none; /* Pas besoin de la barre latérale pour le bouton */
}

.sidebar-nav-item[href="#booking"] .sidebar-nav-icon {
    color: #000;
}

.sidebar-nav-item[href="#booking"]:hover .sidebar-nav-icon {
    color: #000;
}

/* Top Navigation Styles */
#top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw; /* Forcer la pleine largeur */
    background: linear-gradient(90deg, rgba(20, 20, 20, 0.98) 0%, rgba(10, 10, 10, 0.98) 100%);
    backdrop-filter: blur(10px);
    z-index: 1100; /* Plus haut que la sidebar pour être au-dessus quand elle apparaît */
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transition-delay: 0.2s; /* Légère attente après le début de la disparition de la sidebar */
    border-bottom: 1px solid rgba(191, 149, 63, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    will-change: transform, opacity;
}

#top-nav.navbar-visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    display: block !important;
    transition-delay: 0s; /* Pas de délai pour l'apparition */
}

/* Animation de descente fluide pour la navbar */
@keyframes slideDownFade {
    0% {
        transform: translateY(-100%);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Animation de montée fluide pour cacher la navbar */
@keyframes slideUpFade {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-100%);
        opacity: 0;
    }
}

.top-nav-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0.875rem 3rem; /* Encore plus de padding pour éloigner le logo du bord */
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Section logo + titre à gauche */
.top-nav-logo-section {
    display: flex;
    align-items: center;
    gap: 4rem; /* Encore plus d'espace entre le logo et "L'or sombre" */
    margin-left: 2rem; /* Décaler toute la section vers la droite */
    margin-right: auto; /* Pousse les autres éléments vers la droite */
}

/* Logo avec fond style sidebar pour la navbar top */
.logo-button-topnav {
    display: inline-block;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    background: #f2e9e3;
    border: 2px solid #BF953F;
    transition: all 0.3s ease;
    cursor: pointer;
    height: 50px;
    display: flex;
    align-items: center;
}

.logo-button-topnav img {
    height: 35px;
    width: auto;
    display: block;
    position: relative;
    z-index: 2;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    -webkit-font-smoothing: antialiased;
}

.shine-effect-topnav {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(208, 184, 170, 0.8) 50%, transparent 100%);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.logo-button-topnav:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(191, 149, 63, 0.4);
    border-color: #D4AF37;
}

.logo-button-topnav:hover .shine-effect-topnav {
    opacity: 1;
    animation: shine-slide 1s ease-in-out;
}

.logo-button-topnav:active {
    transform: translateY(0);
}

@keyframes shine-slide {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Lien du titre "L'or sombre" dans la navbar top */
.top-nav-title-link {
    text-decoration: none;
    display: inline-block;
    transition: transform 0.3s ease;
}

.top-nav-title-link:hover {
    transform: scale(1.05);
}

/* Titre "L'or sombre" dans la navbar top */
.top-nav-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(145deg, #BF953F, #FCF6BA, #B38728, #FBF5B7, #AA771C);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

/* Réseaux sociaux à droite */
.top-nav-social {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 0.5rem; /* Espace entre le bouton Réserver et les réseaux */
    padding-right: 2rem; /* Padding pour éloigner du bord droit */
}

@media (max-width: 1023px) {
    .top-nav-social {
        display: none; /* Masquer sur mobile car déjà dans le menu mobile */
    }
}

.top-nav-list {
    align-items: center;
    gap: 2rem;
    position: absolute;
    left: 55%; /* Décaler vers la droite au lieu de 50% */
    transform: translateX(-50%); /* Centrer les liens */
}

/* Afficher la liste sur desktop, cacher sur mobile */
@media (min-width: 1024px) {
    .top-nav-list {
        display: flex !important;
    }
}

@media (max-width: 1023px) {
    .top-nav-list {
        display: none !important;
    }
}

.top-nav-item {
    color: #F0EDE5;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
}

.top-nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 80%;
    height: 2px;
    background: linear-gradient(90deg, #BF953F, #AA771C);
    transition: transform 0.3s ease;
}

.top-nav-item:hover,
.top-nav-item.active-nav-link {
    color: #FCF6BA;
    background: rgba(191, 149, 63, 0.1);
}

.top-nav-item:hover::after,
.top-nav-item.active-nav-link::after {
    transform: translateX(-50%) scaleX(1);
}

/* Style spécial pour le bouton Réserver dans la navbar supérieure */
.top-nav-item[href="#booking"] {
    background: linear-gradient(135deg, #BF953F 0%, #AA771C 100%);
    border-radius: 8px;
    padding: 10px 20px !important;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(191, 149, 63, 0.3);
    color: #000 !important;
    margin-left: 4rem; /* Encore plus d'espace à gauche du bouton Réserver */
}

.top-nav-item[href="#booking"]:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #BF953F 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(191, 149, 63, 0.5);
}

.top-nav-item[href="#booking"]::after {
    display: none; /* Pas besoin du soulignement pour le bouton */
}

/* Mobile Menu */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.98);
    backdrop-filter: blur(10px);
    z-index: 1100; /* Plus haut que la sidebar pour mobile */
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.mobile-menu-overlay.mobile-menu-open {
    transform: translateX(0);
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2rem;
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(191, 149, 63, 0.2);
}

.mobile-menu-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-menu-item {
    padding: 1rem 1.5rem;
    color: #F0EDE5;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-size: 1.125rem;
    font-weight: 400;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.mobile-menu-item:hover,
.mobile-menu-item.active-nav-link {
    background: rgba(191, 149, 63, 0.1);
    color: #FCF6BA;
}

/* Style spécial pour le bouton Réserver dans le menu mobile */
.mobile-menu-item[href="#booking"] {
    background: linear-gradient(135deg, #BF953F 0%, #AA771C 100%);
    border-radius: 8px;
    padding: 14px 24px !important;
    margin: 8px 0;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(191, 149, 63, 0.3);
    color: #000 !important;
}

.mobile-menu-item[href="#booking"]:hover {
    background: linear-gradient(135deg, #D4AF37 0%, #BF953F 100%);
    transform: translateX(4px);
    box-shadow: 0 6px 20px rgba(191, 149, 63, 0.5);
}

.mobile-menu-item[href="#booking"] svg {
    color: #000 !important;
}

/* Main content always takes full width - sidebar is overlay */
.main-content {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    overflow-y: visible;
    position: relative;
    margin-left: 0;
    padding-left: 0;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Toutes les sections incluant le hero */
.main-content > section,
.main-content > header,
section, header, main {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
    box-sizing: border-box;
}

/* Empêcher les containers de déborder */
.container, .max-w-4xl, .max-w-6xl, .max-w-3xl {
    max-width: 100% !important;
    overflow-x: hidden;
}

@media (min-width: 1024px) {
    /* Hero ET main content avec padding quand sidebar visible */
    body:not(.no-sidebar-offset) #hero,
    body:not(.no-sidebar-offset) .main-content {
        padding-left: 280px;
        transition: padding-left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        width: 100%;
        margin-left: 0;
    }
    
    body.no-sidebar-offset #hero,
    body.no-sidebar-offset .main-content {
        padding-left: 0 !important;
        transition: padding-left 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        margin-left: 0 !important;
    }
    
    /* Hero doit prendre toute la largeur de l'écran */
    #hero {
        width: 100vw;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    /* Containers use available space within the padded area */
    .main-content .container {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* Standard Tailwind max-widths are preserved */
    .main-content .max-w-4xl {
        max-width: min(56rem, 100%);
    }
    
    .main-content .max-w-6xl {
        max-width: min(72rem, 100%);
    }
    
    .main-content .max-w-3xl {
        max-width: min(48rem, 100%);
    }
}

/* Responsive - Protection contre les doublons */
@media (max-width: 1023px) {
    /* Sur mobile et tablette, on cache COMPLÈTEMENT la sidebar latérale */
    #sidebar-nav {
        display: none !important;
        transform: translateX(-100%);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

    /* Le bouton hamburger est toujours visible sur mobile */
    .mobile-menu-btn {
        display: flex !important;
    }
    
    /* La top navbar doit être visible ET fixe par défaut sur mobile */
    #top-nav {
        display: block !important;
        transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        position: fixed !important;
    }
    
    /* Pas de padding-left sur mobile */
    .main-content {
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
    
    #hero {
        margin-left: 0 !important;
    }
}

@media (min-width: 1024px) {
    /* Sur desktop, le bouton hamburger est caché */
    .mobile-menu-btn {
        display: none !important;
    }

    /* Le menu mobile overlay est caché sur desktop */
    #mobile-menu {
        display: none !important;
    }
    
    .mobile-menu-overlay {
        display: none !important;
    }
    
    /* Sur desktop, la sidebar est visible par défaut dans la section hero */
    #sidebar-nav {
        display: block !important;
    }
    
    /* Sur desktop, la top navbar est cachée par défaut (apparaît après le hero) */
    #top-nav {
        display: block;
    }
}

/* Animations for page elements */
.animate-fade-in {
    animation: fadeIn 0.8s ease-in-out;
}

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

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

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

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

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

.animate-scale-in {
    animation: scaleIn 0.5s ease-out;
}

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

/* Hover effects for images */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
}

.image-container img {
    transition: transform 0.5s ease, filter 0.5s ease;
}

.image-container:hover img {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10, 10, 10, 0.8) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
}

.image-container:hover .image-overlay {
    opacity: 1;
}

/* Video background for hero */
.hero-video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.hero-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
}

/* Stagger animations for lists */
.stagger-animation > *:nth-child(1) { animation-delay: 0.1s; }
.stagger-animation > *:nth-child(2) { animation-delay: 0.2s; }
.stagger-animation > *:nth-child(3) { animation-delay: 0.3s; }
.stagger-animation > *:nth-child(4) { animation-delay: 0.4s; }
.stagger-animation > *:nth-child(5) { animation-delay: 0.5s; }
.stagger-animation > *:nth-child(6) { animation-delay: 0.6s; }
