/* Bulma Default Layout Styles */

html, body {
  height: 100%;
}

#wrapper {
  padding-top: 3.25rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

/* Ensure navbar stays visible on top of all content */
.navbar {
  z-index: 1030 !important;
}

.logo img {
  filter: invert(1);
}

/* Video Hero Section - Bulma Hero with Video Background */
.video-hero {
  position: relative;
  overflow: hidden;
  z-index: 100;
  height: 100vh;
}

.video-hero .hero-body {
  position: relative;
  z-index: 101;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

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

.video-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none;
  object-fit: cover;
}

/* Overlay for video */
.video-hero .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: 1;
}

/* Non-desktop: remove video, use image background */
@media (max-width: 1023px) {
  .video-hero {
    background-image: url(/assets/img/bg-maison1.jpg);
    background-size: cover;
    background-position: center;
  }

  .video-container,
  .video-iframe,
  .video-hero .overlay {
    display: none !important;
  }

  .video-hero .hero-body {
    background: rgba(0, 0, 0, 0.55);
  }
}

/* Brand heading styling */
.brand-heading {
  color: #ffffff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  font-weight: 700;
  line-height: 1.2;
  font-family: 'Pacifico', 'Brush Script MT', cursive;
  font-style: italic;
  font-size: 5.5rem;
}

@media (max-width: 768px) {
  .brand-heading {
    font-size: 2.5rem;
  }
}

@media (max-width: 480px) {
  .brand-heading {
    font-size: 1.8rem;
  }
}

.video-hero .subtitle {
  color: #f5f5f5;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
}

.page-scroll .button {
  transition: all 0.3s ease;
}

.page-scroll .button:hover {
  transform: scale(1.1);
}

/* Carousel text rotation */
.carousel {
  position: relative;
  width: 100%;
  min-height: 60px;
  will-change: contents;
}

@media (max-width: 768px) {
  .carousel {
    min-height: 50px;
  }
}

@media (max-width: 480px) {
  .carousel {
    min-height: 40px;
  }
}

.carousel-inner {
  position: relative;
  width: 100%;
}

.carousel-item {
  display: none;
  width: 100%;
  opacity: 0;
  position: absolute;
  top: 0;
  left: 0;
}

.carousel-item.active {
  display: block;
  position: relative;
  animation: flipIn 0.6s ease-in-out forwards;
}

@media (max-width: 768px) {
  .carousel-item p {
    font-size: 1.1rem;
  }
}

@media (max-width: 480px) {
  .carousel-item p {
    font-size: 0.9rem;
  }
}

@keyframes flipIn {
  from {
    opacity: 0;
    transform: perspective(400px) rotateY(90deg);
  }
  to {
    opacity: 1;
    transform: perspective(400px) rotateY(0deg);
  }
}

/* Image Modal Styles */
.modal-gallery {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  will-change: transform;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 1;
  pointer-events: auto;
  -webkit-backdrop-filter: blur(5px);
}

.modal-content {
  position: relative;
  z-index: 2;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-image-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-image {
  max-width: 80vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  will-change: opacity;
}

.modal-button {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.9);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  color: #333;
  z-index: 3;
  touch-action: manipulation;
}

.modal-button:hover {
  background-color: white;
  transform: scale(1.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-button:active {
  transform: scale(0.95);
}

.modal-prev {
  left: 20px;
}

.modal-next {
  right: 20px;
}

.modal-close {
  top: 20px;
  right: 20px;
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.modal-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  font-size: 14px;
  margin: 0;
  z-index: 3;
  user-select: none;
}

/* Responsive modal buttons */
@media (max-width: 768px) {
  .modal-button {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .modal-prev {
    left: 10px;
  }
  
  .modal-next {
    right: 10px;
  }
  
  .modal-close {
    top: 10px;
    right: 10px;
  }
  
  #modal-image {
    max-width: 95vw;
    max-height: 85vh;
  }
}

/* Gallery Card Styling */
.card {
  position: relative;
  overflow: hidden;
}

.card-image {
  position: relative;
}

.card-image figure {
  position: relative;
  margin-bottom: 0;
}

.card-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 0;
  pointer-events: none;
}

.card-content i {
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.card:hover .card-content {
  opacity: 1;
}

/* Dark Mode Support */
body.dark-mode {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .navbar {
  background-color: #0d0d0d !important;
  border-bottom: 1px solid #333;
}

body.dark-mode .navbar-item {
  color: #e0e0e0;
}

body.dark-mode .navbar-item strong {
  color: #ffffff;
}

body.dark-mode .navbar-burger {
  color: #e0e0e0;
}

body.dark-mode .logo img {
  filter: none;
}

body.dark-mode section {
  background-color: #1a1a1a;
  color: #e0e0e0;
}

body.dark-mode .has-background-info-light {
  background-color: #0a2540 !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode h5,
body.dark-mode h6 {
  color: #f0f0f0;
}

body.dark-mode p {
  color: #e0e0e0;
}

body.dark-mode .has-text-white {
  color: #f0f0f0 !important;
}

body.dark-mode a {
  color: #66b3ff;
}

body.dark-mode a:hover {
  color: #99ccff;
}

body.dark-mode .form-control {
  background-color: #2a2a2a;
  border-color: #444;
  color: #e0e0e0;
}

body.dark-mode .form-control:focus {
  background-color: #333;
  border-color: #0066cc;
  color: #e0e0e0;
}

body.dark-mode .form-control::placeholder {
  color: #999;
}

body.dark-mode .form-label {
  color: #e0e0e0;
}

body.dark-mode .input,
body.dark-mode .textarea,
body.dark-mode .select select {
  background-color: #2a2a2a !important;
  border-color: #444 !important;
  color: #e0e0e0 !important;
}

body.dark-mode .input:focus,
body.dark-mode .textarea:focus,
body.dark-mode .select select:focus {
  background-color: #333 !important;
  border-color: #0066cc !important;
  color: #e0e0e0 !important;
}

body.dark-mode .input::placeholder,
body.dark-mode .textarea::placeholder {
  color: #999 !important;
}

body.dark-mode hr {
  border-color: #444;
}

body.dark-mode .card {
  background-color: #2a2a2a;
  border-color: #444;
}

body.dark-mode .box {
  background-color: #2a2a2a !important;
  color: #e0e0e0;
}

body.dark-mode .has-background-light {
  background-color: #1a1a1a !important;
}

body.dark-mode .text-muted {
  color: #999 !important;
}

body.dark-mode footer {
  background-color: #0d0d0d !important;
  color: #e0e0e0;
  border-top: 1px solid #333;
}

body.dark-mode footer a {
  color: #66b3ff;
}

body.dark-mode footer a:hover {
  color: #99ccff;
}

/* Navbar menu styling in dark mode */
body.dark-mode .navbar-menu {
  background-color: #0d0d0d !important;
}

body.dark-mode .navbar-menu .navbar-item {
  color: #e0e0e0;
}

body.dark-mode .navbar-menu .navbar-item strong {
  color: #ffffff;
}

body.dark-mode .navbar-menu a.navbar-item:hover {
  background-color: #1a1a1a;
  color: #ffffff;
}

/* Navbar burger menu styling in dark mode */
body.dark-mode .navbar-burger {
  color: #e0e0e0;
}

body.dark-mode .navbar-burger span {
  background-color: #e0e0e0;
}

body.dark-mode .navbar-burger:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .navbar-burger.is-active span {
  background-color: #e0e0e0;
}

/* Gallery responsive layout - ensure 2 columns on mobile */
@media screen and (max-width: 768px) {
  .columns.is-multiline > .column.is-6-mobile {
    flex: none !important;
    width: 50% !important;
    min-width: 50% !important;
    max-width: 50% !important;
  }
}

@media screen and (min-width: 769px) and (max-width: 1023px) {
  .columns.is-multiline > .column.is-4-tablet {
    flex: none !important;
    width: 33.3333% !important;
  }
}

@media screen and (min-width: 1024px) {
  .columns.is-multiline > .column.is-2-desktop {
    flex: none !important;
    width: 16.6667% !important;
  }
}


/* Services section: equal height boxes */
#services .box {
  display: flex;
  flex-direction: column;
  height: 100%;
}
/* Services: center icons on tablet and mobile */
@media screen and (max-width: 1023px) {
  #services .column.is-6-tablet .has-text-centered,
  #services .column.is-12-mobile .has-text-centered {
    text-align: center !important;
    margin-bottom: 1rem;
  }
}

/* About section: equal size buttons */
#salle .has-text-centered .button {
  width: 200px;
  min-width: 200px;
}

/* Services: icon above text on mobile, centered */
@media screen and (max-width: 768px) {
  #services .box .columns {
    flex-direction: column !important;
  }
  
  #services .box .column.is-9-desktop {
    width: 100% !important;
  }
}
