/**
 * template-header.css
 * Styling for the header template, navigation, and dropdown menus
 */

/* =========================================
 * Top Bar Styles
 * ========================================= */
 .top-bar {
  font-size: 0.85rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.top-bar-contact span {
  display: inline-block;
  margin-right: 15px;
}

.top-bar-contact i {
  margin-right: 5px;
  color: var(--accent-gold, #f8b400);
}

/* Language and Theme Selectors */
#languageSelect, #themeSelect {
  font-size: 0.85rem;
  padding: 0 10px;
  height: 28px;
  background-position: right 5px center;
  transition: all 0.3s ease;
}

#themeSelect {
  width: 60px;
}

/* =========================================
* Navbar Styles
* ========================================= */
.navbar {
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.navbar-brand {
  padding: 0;
}

.navbar-brand img {
  height: 50px;
  transition: all 0.3s ease;
}

.navbar-nav {
  margin-left: auto;
}

.nav-item {
  position: relative;
  margin: 0 5px;
}

.nav-link {
  font-weight: 500;
  padding: 0.8rem 1rem !important;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--accent-gold, #f8b400) !important;
}

/* =========================================
* Dropdown Styles - CORE FUNCTIONALITY
* ========================================= */

/* Main dropdown styling */
.dropdown-menu {
  padding: 0.5rem 0;
  border: none;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  margin-top: 10px;
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, margin-top 0.3s ease;
}

/* Dropdown menu arrow */
.dropdown-menu:before {
  content: '';
  position: absolute;
  top: -10px;
  left: 20px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid var(--bg-primary, #212529);
}

.dropdown-item {
  padding: 0.7rem 1.5rem;
  font-weight: 400;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.dropdown-item:hover, .dropdown-item:focus {
  background-color: rgba(var(--accent-gold-rgb, 255, 215, 0), 0.1);
  color: var(--accent-gold, #f8b400);
}

.dropdown-divider {
  margin: 0.5rem 0;
  opacity: 0.2;
}

/* Dropdown button icon */
.dropdown-toggle::after {
  display: inline-block;
  margin-left: .255em;
  vertical-align: .255em;
  content: "";
  border-top: .3em solid;
  border-right: .3em solid transparent;
  border-bottom: 0;
  border-left: .3em solid transparent;
  transition: transform 0.3s ease;
}

.dropdown-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

/* =========================================
* Dropdown Submenu (Nested Dropdowns)
* ========================================= */
.dropdown-submenu {
  position: relative;
}

.dropdown-submenu .dropdown-menu {
  top: 0;
  left: 100%;
  margin-top: 0;
  margin-left: 0.1rem;
}

.dropdown-submenu .dropdown-toggle::after {
  border-top: .3em solid transparent;
  border-right: 0;
  border-bottom: .3em solid transparent;
  border-left: .3em solid;
  float: right;
  margin-top: .5em;
  margin-left: .5em;
}

/* =========================================
* HOVER FUNCTIONALITY - This is the key part for fixing the submenu
* ========================================= */
@media (min-width: 992px) {
  /* 1. Regular Dropdown Hover */
  .navbar .nav-item.dropdown:hover > .dropdown-menu,
  .navbar .nav-item.dropdown:focus-within > .dropdown-menu,
  .navbar .nav-item.dropdown > .dropdown-menu.show {
      display: block;
      opacity: 1;
      visibility: visible;
      margin-top: 0;
      pointer-events: auto;
  }
  
  /* 2. Submenu Dropdown Hover */
  .navbar .dropdown-submenu:hover > .dropdown-menu,
  .navbar .dropdown-submenu:focus-within > .dropdown-menu,
  .navbar .dropdown-submenu > .dropdown-menu.show {
      display: block;
      opacity: 1;
      visibility: visible;
      margin-left: 0;
      pointer-events: auto;
  }
  
  /* 3. Hidden state for all dropdown menus */
  .navbar .dropdown-menu {
      display: block;
      opacity: 0;
      visibility: hidden;
      margin-top: 10px;
      pointer-events: none;
      transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, margin-top 0.2s ease-in-out;
  }
  
  /* 4. Hidden state for submenu dropdown menus */
  .navbar .dropdown-submenu > .dropdown-menu {
      margin-left: 10px;
      transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out, margin-left 0.2s ease-in-out;
  }
  
  /* 5. Make sure dropdown items are clickable while visible */
  .dropdown-menu.show .dropdown-item {
      pointer-events: auto;
  }
}

/* =========================================
* Book Now Button
* ========================================= */
.btn-book-now {
  display: inline-block;
  background: linear-gradient(-45deg, #FFD700, #FFA500, #FF4500, #FF8C00);
  background-size: 300% 300%;
  border: none;
  color: #fff !important; /* Force white text */
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 0.8rem 1.8rem;
  border-radius: 50px;
  position: relative;
  overflow: hidden;
  z-index: 1;
  box-shadow: 0 5px 15px rgba(255, 69, 0, 0.5);
  animation: gradientShift 4s ease infinite, pulse 2s infinite alternate;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  isolation: isolate;
}

/* Background gradient animation */
@keyframes gradientShift {
  0% {
      background-position: 0% 50%;
  }
  50% {
      background-position: 100% 50%;
  }
  100% {
      background-position: 0% 50%;
  }
}

/* Pulsing shadow animation */
@keyframes pulse {
  0% {
      box-shadow: 0 5px 15px rgba(255, 69, 0, 0.5);
  }
  100% {
      box-shadow: 0 5px 30px rgba(255, 69, 0, 0.8), 0 0 20px rgba(255, 165, 0, 0.6);
  }
}

/* Shine effect */
.btn-book-now:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-25deg);
  animation: shine 3s infinite;
  z-index: 0;
  pointer-events: none;
}

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

/* Enhanced hover effects */
.btn-book-now:hover {
  transform: translateY(-3px) scale(1.05);
  animation: gradientShift 3s ease infinite, pulseHover 1s infinite alternate;
  color: #fff !important;
  text-decoration: none;
}

@keyframes pulseHover {
  0% {
      box-shadow: 0 7px 20px rgba(255, 69, 0, 0.6);
  }
  100% {
      box-shadow: 0 7px 30px rgba(255, 69, 0, 0.9), 0 0 25px rgba(255, 140, 0, 0.7);
  }
}

/* Button text styling */
.btn-book-now .btn-text {
  position: relative;
  display: inline-block;
  z-index: 1;
}

/* Active state for when button is clicked */
.btn-book-now:active {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 3px 15px rgba(255, 69, 0, 0.4);
}

/* =========================================
* Responsive Adjustments
* ========================================= */
@media (max-width: 991.98px) {
  /* Navbar toggler styling */
  .navbar-toggler {
      border: none;
      padding: 0.5rem;
      margin-right: 0.5rem;
  }
  
  .navbar-toggler:focus {
      box-shadow: none;
  }
  
  /* Mobile dropdown styling */
  .dropdown-menu {
      border: none;
      background-color: rgba(255, 255, 255, 0.05);
      margin-top: 0;
      padding-left: 1rem;
  }
  
  .dropdown-menu:before {
      display: none;
  }
  
  /* Modify submenu behavior on mobile */
  .dropdown-submenu .dropdown-menu {
      left: 0;
      top: 100%;
      margin-left: 1rem;
      border-radius: 0;
  }
  
  /* Make Book Now button smaller on mobile */
  .btn-book-now {
      padding: 0.6rem 1.2rem;
      font-size: 0.9rem;
      margin-top: 10px;
  }
  
  /* Full-width nav items on mobile */
  .navbar-nav .nav-item {
      width: 100%;
      margin: 0;
  }
  
  /* Center logo on mobile */
  .navbar-brand {
      margin-right: auto;
      margin-left: auto;
      text-align: center;
  }
  
  /* Make top bar responsive */
  .top-bar {
      font-size: 0.75rem;
  }
  
  .top-bar-contact span {
      display: block;
      margin-bottom: 5px;
  }
}

/* =========================================
* Light Theme Adjustments
* ========================================= */
body.light-theme .navbar-light .nav-link {
  color: rgba(0, 0, 0, 0.7);
}

body.light-theme .navbar-light .nav-link:hover,
body.light-theme .navbar-light .nav-link:focus {
  color: var(--accent-gold) !important;
}

body.light-theme .dropdown-menu {
  background-color: #f8f9fa;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

body.light-theme .dropdown-menu:before {
  border-bottom-color: #f8f9fa;
}

body.light-theme .dropdown-item {
  color: #212529;
}

body.light-theme .dropdown-item:hover,
body.light-theme .dropdown-item:focus {
  background-color: rgba(var(--accent-gold-rgb, 255, 215, 0), 0.1);
  color: var(--accent-gold, #f8b400);
}

/* =========================================
* Animation Helpers
* ========================================= */
.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

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

/* =========================================
* Accessibility Improvements
* ========================================= */
.nav-link:focus, 
.dropdown-item:focus,
.btn-book-now:focus {
  outline: 2px solid var(--accent-gold);
  outline-offset: 2px;
}

/* Skip to content link for keyboard users */
.skip-to-content {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
}

.skip-to-content:focus {
  left: 0;
  top: 0;
  width: auto;
  height: auto;
  padding: 10px 15px;
  background-color: var(--accent-gold);
  color: #000;
  font-weight: bold;
  text-decoration: none;
}