/* La Villa Dionysos - Styles CSS avec TailwindCSS */

/* Import TailwindCSS via CDN dans le HTML */
/* @import url('https://cdn.tailwindcss.com'); */

/* Variables CSS personnalisées pour la palette de couleurs */
:root {
  --color-white-off: #faf9f7;
  --color-sand: #e8dcc0;
  --color-blue-deep: #1e3a5f;
  --color-gold-light: #d4af37;
  --color-text-primary: #2c3e50;
  --color-text-secondary: #7f8c8d;
  --color-accent: #3498db;
}

/* Configuration TailwindCSS personnalisée */
@tailwind base;
@tailwind components;
@tailwind utilities;

/* Styles de base */
@layer base {
  html {
    scroll-behavior: smooth;
    overflow-x: clip;
    overflow-y: auto;
  }

  body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--color-white-off);
    color: var(--color-text-primary);
    line-height: 1.6;
    overflow-x: clip;
    overflow-y: auto;
    width: 100%;
    max-width: 100vw;
    position: relative;
  }
  
  * {
    box-sizing: border-box;
  }
  
  /* Empêcher le scroll horizontal uniquement */
  ::-webkit-scrollbar:horizontal {
    display: none;
    width: 0;
    height: 0;
  }
  
  section {
    overflow-x: clip;
  }
  
  .container-responsive {
    max-width: 100%;
  }
  
  /* Fix pour Swiper qui déborde */
  .swiper,
  .swiper-wrapper,
  .swiper-slide {
    max-width: 100vw;
  }
  
  .swiper-button-next,
  .swiper-button-prev {
    width: 44px !important;
    height: 44px !important;
  }
  
  /* S'assurer que les éléments avec transform ne dépassent pas */
  .swiper-button-next {
    right: 1rem !important;
  }
  
  .swiper-button-prev {
    left: 1rem !important;
  }
  
  .swiper-pagination {
    max-width: calc(100vw - 2rem) !important;
  }
  
  @media (max-width: 768px) {
    .swiper-button-next,
    .swiper-button-prev {
      width: 36px !important;
      height: 36px !important;
    }
  }
  
  /* Hero section qui peut déborder */
  .hero-section {
    max-width: 100vw;
  }
  
  /* Empêcher tout débordement horizontal */
  img, video {
    max-width: 100%;
    height: auto;
  }

  /* Typographie élégante */
  h1, h2, h3, h4, h5, h6 {
    font-family: 'Playfair Display', 'Times New Roman', serif;
    font-weight: 600;
    line-height: 1.2;
    color: var(--color-blue-deep);
  }

  h1 {
    font-size: 3rem;
    font-weight: 700;
  }

  h2 {
    font-size: 2.25rem;
  }

  h3 {
    font-size: 1.875rem;
  }

  /* Liens élégants */
  a {
    color: var(--color-blue-deep);
    text-decoration: none;
    transition: all 0.3s ease;
  }

  a:hover {
    color: var(--color-gold-light);
  }

  /* Boutons personnalisés */
  .btn-primary {
    background: linear-gradient(135deg, var(--color-blue-deep), var(--color-accent));
    color: #FAF9F7;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
  }

  .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(30, 58, 95, 0.3);
  }

  .btn-secondary {
    background: transparent;
    color: var(--color-blue-deep);
    border: 2px solid var(--color-blue-deep);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .btn-secondary:hover {
    background: var(--color-blue-deep);
    color: white;
  }

  .btn-gold {
    background: var(--color-gold-light);
    color: var(--color-blue-deep);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
  }

  .btn-gold:hover {
    background: #b8941f;
    transform: translateY(-2px);
  }
}

/* Composants personnalisés */
@layer components {
  /* Section héros */
  .hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  /* Swiper Hero - Styles personnalisés */
  .hero-swiper {
    width: 100%;
    height: 100vh;
  }

  .hero-swiper .swiper-slide {
    position: relative;
    width: 100%;
    height: 100%;
  }

  .hero-swiper .swiper-slide img,
  .hero-swiper .swiper-slide video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Boutons de navigation Swiper */
  .hero-swiper .swiper-button-next,
  .hero-swiper .swiper-button-prev {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    color: white;
    transition: all 0.3s ease;
  }

  .hero-swiper .swiper-button-next:hover,
  .hero-swiper .swiper-button-prev:hover {
    background: rgba(212, 175, 55, 0.9);
    transform: scale(1.1);
  }

  .hero-swiper .swiper-button-next::after,
  .hero-swiper .swiper-button-prev::after {
    font-size: 20px;
    font-weight: bold;
  }

  /* Pagination Swiper */
  .hero-swiper .swiper-pagination {
    bottom: 30px !important;
  }

  .hero-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: white;
    opacity: 0.5;
    transition: all 0.3s ease;
  }

  .hero-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    background: #d4af37;
    width: 30px;
    border-radius: 6px;
  }

  /* Responsive - Mobile */
  @media (max-width: 767px) {
    /* Cacher complètement le carrousel sur mobile */
    .hero-swiper {
      display: none !important;
    }
    
    /* Cacher les boutons de navigation sur mobile */
    .hero-swiper .swiper-button-next,
    .hero-swiper .swiper-button-prev,
    .hero-swiper .swiper-pagination {
      display: none !important;
    }
  }

  /* Responsive - Desktop */
  @media (min-width: 768px) {
    /* Afficher le carrousel sur desktop */
    .hero-swiper {
      display: block !important;
    }
  }

  /* Cartes élégantes */
  .card-elegant {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    transition: all 0.3s ease;
  }

  .card-elegant:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }

  /* Navigation principale */
  .nav-main {
    background: rgba(250, 249, 247, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(232, 220, 192, 0.3);
  }

  /* Menu desktop - caché en dessous de 1330px */
  @media (min-width: 1330px) {
    .menu-desktop {
      display: flex !important;
    }
    .menu-mobile-btn-container {
      display: none !important;
    }
  }

  @media (max-width: 1329px) {
    .menu-desktop {
      display: none !important;
    }
    .menu-mobile-btn-container {
      display: block !important;
    }
  }

  /* Menu mobile - Overlay */
  .mobile-menu-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .mobile-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  /* Menu mobile - Panneau latéral */
  .mobile-menu {
    width: 100%;
    max-width: 400px;
    transition: transform 0.3s ease;
  }

  /* Menu mobile pleine largeur en dessous de 470px */
  @media (max-width: 470px) {
    .mobile-menu {
      max-width: 100% !important;
      width: 100% !important;
    }
  }

  /* Menu mobile au-dessus de 470px - côté droit */
  @media (min-width: 471px) {
    .mobile-menu {
      max-width: 400px;
      width: 400px;
    }
  }
  
  .mobile-menu.active {
    transform: translateX(0) !important;
  }
  
  .mobile-menu-btn {
    position: relative;
    z-index: 100;
  }

  /* Animation du hamburger en X */
  .mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  /* Filtres de galerie */
  .filter-btn {
    cursor: pointer;
    z-index: 10;
    position: relative;
    pointer-events: auto;
    outline: none;
    border: none;
  }
  
  .filter-btn.active {
    background-color: var(--color-blue-deep) !important;
    color: white !important;
  }

  /* Galerie */
  /* Galerie Photos & Vidéos - Responsive */
  .gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
  
  @media (max-width: 768px) {
    .gallery-grid {
      grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
      gap: 1rem;
    }
  }
  
  @media (max-width: 480px) {
    .gallery-grid {
      grid-template-columns: 1fr;
      gap: 1rem;
    }
  }

  .gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 1;
    transform: scale(1);
  }

  .gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  }
  
  @media (max-width: 768px) {
    .gallery-item:hover {
      transform: scale(1.02);
    }
  }

  .gallery-media-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 0.75rem;
  }
  
  .gallery-media-container img,
  .gallery-media-container video,
  .gallery-media-container > div {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .gallery-item img,
  .gallery-item video {
    transition: all 0.3s ease;
  }

  .gallery-item:hover img,
  .gallery-item:hover video {
    transform: scale(1.1);
  }

  .gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(30, 58, 95, 0.95) 0%, rgba(30, 58, 95, 0.7) 50%, transparent 100%);
    padding: 1.5rem 1rem 1rem;
    transform: translateY(100%);
    transition: all 0.3s ease;
  }

  .gallery-item:hover .gallery-overlay {
    transform: translateY(0);
  }
  
  @media (max-width: 768px) {
    .gallery-overlay {
      transform: translateY(0);
      background: linear-gradient(to top, rgba(30, 58, 95, 0.85) 0%, rgba(30, 58, 95, 0.5) 70%, transparent 100%);
      padding: 1rem 0.75rem 0.75rem;
    }
  }
  
  .gallery-overlay .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  /* Animation d'apparition */
  .fade-in {
    animation: fadeInScale 0.5s ease-out;
  }
  
  @keyframes fadeInScale {
    from {
      opacity: 0;
      transform: scale(0.9);
    }
    to {
      opacity: 1;
      transform: scale(1);
    }
  }

  /* Lightbox unifiée - Responsive */
  #unified-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
  }
  
  #unified-lightbox .bg-black {
    background-color: rgba(0, 0, 0, 0.95);
  }
  
  #lightbox-close,
  #lightbox-prev,
  #lightbox-next {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    transition: all 0.3s ease;
  }
  
  #lightbox-close:hover,
  #lightbox-prev:hover,
  #lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
  }
  
  @media (max-width: 768px) {
    #lightbox-prev,
    #lightbox-next {
      width: 40px;
      height: 40px;
    }
    
    #lightbox-prev {
      left: 0.5rem;
    }
    
    #lightbox-next {
      right: 0.5rem;
    }
    
    #lightbox-close {
      top: 0.5rem;
      right: 0.5rem;
      width: 40px;
      height: 40px;
    }
    
    #lightbox-info {
      padding: 0 1rem;
    }
    
    #lightbox-title {
      font-size: 1.25rem;
    }
    
    #lightbox-description {
      font-size: 0.875rem;
    }
  }
  
  #lightbox-image-container img {
    max-height: calc(100vh - 200px);
  }
  
  #lightbox-video-container {
    width: 90vw;
    max-width: 1200px;
    height: calc(90vw * 9 / 16); /* Ratio 16:9 */
    max-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  #lightbox-video-content {
    width: 100%;
    height: 100%;
    position: relative;
  }
  
  #lightbox-video-content iframe,
  #lightbox-video-content video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  }
  
  @media (max-width: 768px) {
    #lightbox-image-container img {
      max-height: calc(100vh - 250px);
    }
    
    #lightbox-video-container {
      width: 95vw;
      height: calc(95vw * 9 / 16);
      max-height: calc(100vh - 250px);
    }
  }
  
  @media (max-width: 480px) {
    #lightbox-video-container {
      width: 100vw;
      height: calc(100vw * 9 / 16);
      max-height: calc(100vh - 200px);
    }
  }
  
  /* Ancienne lightbox (à garder pour compatibilité) */
  .lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .lightbox.active {
    opacity: 1;
    visibility: visible;
  }

  .lightbox img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
  }

  /* Formulaire élégant */
  .form-elegant input,
  .form-elegant textarea,
  .form-elegant select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--color-sand);
    border-radius: 0.5rem;
    background: white;
    transition: all 0.3s ease;
    font-family: inherit;
  }

  .form-elegant input:focus,
  .form-elegant textarea:focus,
  .form-elegant select:focus {
    outline: none;
    border-color: var(--color-gold-light);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
  }

  /* Animations au scroll */
  .fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
  }

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

  .slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.6s ease;
  }

  .slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
  }

  .slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease;
  }

  .slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
  }

  /* Loader élégant */
  .loader {
    border: 4px solid var(--color-sand);
    border-top: 4px solid var(--color-gold-light);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
  }

  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  /* Calendrier personnalisé */
  .calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
  }

  .calendar-day.available {
    background: var(--color-sand);
    color: var(--color-blue-deep);
  }

  .calendar-day.available:hover {
    background: var(--color-gold-light);
    color: white;
  }

  .calendar-day.booked {
    background: var(--color-blue-deep);
    color: white;
  }

  .calendar-day.today {
    background: var(--color-gold-light);
    color: var(--color-blue-deep);
    font-weight: bold;
  }

  /* Tableau de tarifs */
  .pricing-table {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  }

  .pricing-table th {
    background: var(--color-blue-deep);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
  }

  .pricing-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-sand);
  }

  .pricing-table tr:nth-child(even) {
    background: var(--color-white-off);
  }

  .pricing-table tr:hover {
    background: rgba(232, 220, 192, 0.3);
  }

  /* Blog cards */
  .blog-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
  }

  .blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  }

  .blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
  }

  /* Produits boutique */
  .product-card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
  }

  .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  }

  .product-price {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--color-gold-light);
  }

  .product-price del {
    color: var(--color-text-secondary);
    font-size: 0.875rem;
    margin-left: 0.5rem;
  }

  /* Panier */
  .cart-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid var(--color-sand);
  }

  .cart-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 0.5rem;
  }

  /* Pagination */
  .pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
  }

  .pagination a,
  .pagination span {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
  }

  .pagination a {
    background: var(--color-sand);
    color: var(--color-blue-deep);
  }

  .pagination a:hover {
    background: var(--color-gold-light);
    color: white;
  }

  .pagination .current {
    background: var(--color-blue-deep);
    color: white;
  }
}

/* Responsive utilities */
@layer utilities {
  .container-responsive {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
  }

  @media (min-width: 768px) {
    .container-responsive {
      padding: 0 2rem;
    }
  }

  @media (min-width: 1024px) {
    .container-responsive {
      padding: 0 3rem;
    }
  }

  @media (min-width: 1440px) {
    .container-responsive {
      padding: 0 4rem;
    }
  }

  /* Hide scrollbar but keep functionality */
  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }
}

/* Animations CSS personnalisées */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

/* Classes d'animation */
.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

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

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

/* Styles pour l'impression */
@media print {
  .no-print {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  a {
    color: black !important;
    text-decoration: underline !important;
  }
}
