/**
 * Navbar Styles
 * Custom styling for the navigation bar
 */

/* Font Family */
.navbar,
.navbar *,
.nav-link,
.navbar-brand,
.dropdown-menu,
.dropdown-item {
  font-family: 'Tajawal', Arial, Helvetica, sans-serif !important;
}

/* Navbar Container */
.navbar {
  background-color: var(--navy-blue);
  padding: 1rem 0;
  box-shadow: 0 2px 8px rgba(10, 15, 60, 0.15);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.8s ease,
    background-color 0.8s ease,
    backdrop-filter 0.8s ease;
  transform: translateY(0);
  opacity: 1;
  will-change: transform, opacity;
}

/* Navbar Auto-Hide on Scroll */
.navbar-scrollable.navbar-hidden {
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

/* Navbar scrolled - solid navy background */
.navbar-scrollable.navbar-scrolled {
  box-shadow: 0 4px 12px rgba(10, 15, 60, 0.2);
  background-color: var(--navy-blue);
}

/* Transparent Navbar on Hero Section */
.navbar.navbar-transparent {
  background-color: transparent;
  box-shadow: none;
}

/* Transparent navbar - better colors for visibility */
.navbar.navbar-transparent .nav-link:not(.active) {
  color: #274261 !important;
  background-color: transparent !important;
  background-image: none !important;
  background: transparent !important;
  box-shadow: none !important;
  font-weight: 800;
}

.navbar.navbar-transparent .nav-link:not(.active):hover {
  color: #3b4f62 !important;
  background-color: rgba(232, 196, 106, 0.2) !important;
  background-image: none !important;
  background: rgba(232, 196, 106, 0.2) !important;
  box-shadow: none !important;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

/* Active link styling when transparent */
.navbar.navbar-transparent .nav-link.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light)) !important;
  background-color: var(--gold-dark) !important;
  color: var(--navy-blue) !important;
  box-shadow: 0 4px 12px rgba(200, 160, 65, 0.4) !important;
  text-shadow: none !important;
}

.navbar.navbar-transparent .nav-link.active:hover {
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark)) !important;
  background-color: var(--gold-light) !important;
  box-shadow: 0 6px 16px rgba(200, 160, 65, 0.5) !important;
}

/* Remove background when navbar is transparent */
.navbar.navbar-transparent .navbar-logo {
  background-image: none;
  background-color: transparent;
}

/* Transparent navbar - login icon styling */
.navbar.navbar-transparent .btn-login-icon i {
  color: #c8a041 !important;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.navbar.navbar-transparent .btn-login-icon:hover i {
  color: #e8c46a !important;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4));
}

/* Transparent navbar - dropdown arrow */
.navbar.navbar-transparent .dropdown-arrow {
  color: #274261;
}

/* Brand Section */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--white) !important;
  transition: all 0.3s ease;
}

.navbar-brand:hover {
  color: var(--gold-light) !important;
  transform: translateY(-2px);
}

.navbar-logo {
  height: 100px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.4));
  background-image: linear-gradient(rgba(117, 117, 117, 0.53), rgba(194, 194, 194, 0.497)), url('../images/slide 1.PNG');
  background-size: cover;
  background-position: center;
  border-radius: 25px;
  padding: 0rem 1rem;
  transition: background-image 0.3s ease;
}

/* Navigation Links */
.navbar-nav {
  gap: 0.5rem;
}

.nav-item {
  list-style: none;
}

.nav-link {
  color: var(--white) !important;
  font-weight: 500;
  padding: 0.5rem 1rem !important;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
  text-decoration: none !important;
  border-bottom: none !important;
}

.nav-link::after {
  display: none !important;
}

.nav-link:hover {
  color: var(--gold-light) !important;
  background-color: rgba(200, 160, 65, 0.1);
  transform: translateY(-2px);
  text-decoration: none !important;
  border-bottom: none !important;
}

/* Active Link with Gold Gradient */
.nav-link.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  color: var(--navy-blue) !important;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(200, 160, 65, 0.3);
  text-decoration: none !important;
  border-bottom: none !important;
}

.nav-link.active::after {
  display: none !important;
}

.nav-link.active:hover {
  color: var(--navy-blue) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(200, 160, 65, 0.4);
  text-decoration: none !important;
  border-bottom: none !important;
}

/* Login Icon Styles */
.login-btn-container {
  margin-right: 2rem;
  display: flex;
  align-items: center;
}

.btn-login-icon {
  background: transparent;
  border: none;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  text-decoration: none;
  position: relative;
  top: 4px;
}

.btn-login-icon i {
  font-size: 1.6rem;
  color: #c8a041 !important;
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(200, 160, 65, 0.3));
}

.btn-login-icon:hover i {
  transform: scale(1.15);
  color: #e8c46a !important;
  filter: drop-shadow(0 4px 8px rgba(200, 160, 65, 0.5));
}

.btn-login-icon:active i {
  transform: scale(1.05);
}

/* Language Toggle Button */
.btn-language-toggle {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  color: var(--navy-blue);
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(200, 160, 65, 0.2);
}

.btn-language-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(200, 160, 65, 0.4);
  background: linear-gradient(135deg, var(--gold-light), var(--gold-dark));
}

.btn-language-toggle:active {
  transform: translateY(0);
}

.btn-language-toggle i {
  font-size: 1.1rem;
}

.lang-text {
  font-size: 0.9rem;
  font-weight: 600;
}

/* Mobile Menu Toggle */
.navbar-toggler {
  border: 2px solid var(--gold-light);
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.navbar-toggler:hover {
  background-color: rgba(200, 160, 65, 0.1);
  border-color: var(--gold-dark);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.25rem rgba(200, 160, 65, 0.25);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28232, 196, 106, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}


/* ===================================
   Responsive Styles - Mobile Menu
   =================================== */

/* Toggle menu appears on screens below 1200px (xl breakpoint) */
@media (max-width: 1199px) {
  .navbar-collapse {
    background-color: rgba(220, 227, 229, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(10, 15, 60, 0.2);
  }
  
  /* Mobile menu nav links - dark text for blur background */
  .navbar-collapse .nav-link {
    color: var(--navy-blue) !important;
    font-weight: 600;
  }
  
  .navbar-collapse .nav-link:hover {
    color: var(--gold-dark) !important;
    background-color: rgba(232, 196, 106, 0.2);
  }
  
  .navbar-collapse .nav-link.active {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
    color: var(--navy-blue) !important;
  }
  
  /* Blur background for mobile menu when navbar is transparent */
  .navbar.navbar-transparent .navbar-collapse {
    background-color: rgba(220, 227, 229, 0.9) !important;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .navbar-nav {
    gap: 0.25rem;
  }

  .nav-link {
    padding: 0.75rem 1rem !important;
    margin-bottom: 0.25rem;
    margin-left: 0 !important;
  }

  .btn-language-toggle {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    position: static !important;
    left: auto !important;
  }

  .brand-text {
    max-width: 200px;
    font-size: 0.95rem;
  }

  .navbar-logo {
    height: 75px;
  }
  
  .login-btn-container {
    margin-right: 0;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    justify-content: center;
  }

  .btn-login-icon i {
    font-size: 1.6rem;
    color: var(--gold-dark) !important;
  }
}

@media (max-width: 576px) {
  .brand-text {
    max-width: 150px;
    font-size: 0.85rem;
  }

  .navbar-logo {
    height: 65px;
  }

  .navbar {
    padding: 0.75rem 0;
  }
}

/* Smooth Transitions */
.navbar-collapse.collapsing {
  transition: height 0.35s ease;
}

.navbar-collapse.show {
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===================================
   Dropdown Menu Styles - Services
   =================================== */

/* Dropdown Container */
.nav-item.dropdown {
  position: relative;
}

/* Dropdown Arrow Icon */
.dropdown-arrow {
  font-size: 0.75rem;
  margin-right: 0.25rem;
  transition: transform 0.3s ease;
  display: inline-block;
}

[dir="ltr"] .dropdown-arrow {
  margin-right: 0;
  margin-left: 0.25rem;
}

/* Rotate arrow when dropdown is open */
.nav-item.dropdown .nav-link[aria-expanded="true"] .dropdown-arrow {
  transform: rotate(180deg);
}

/* Dropdown Menu Container */
.dropdown-menu {
  background: rgba(10, 15, 60, 0.95);
  border: 1px solid rgba(200, 160, 65, 0.2);
  border-radius: 12px;
  padding: 0.5rem;
  margin-top: 1rem;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  min-width: 260px;
  display: block;
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  position: absolute;
  top: 100%;
  right: 50%;
  left: auto;
}

/* Show dropdown class (toggled by JS) */
.dropdown-menu.show {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  margin-top: 0.5rem;
}

/* RTL positioning */
.navbar[dir="rtl"] .dropdown-menu,
html[dir="rtl"] .navbar .dropdown-menu {
  right: 0;
  left: auto;
  transform: translateY(10px);
}

.navbar[dir="rtl"] .dropdown-menu.show,
html[dir="rtl"] .navbar .dropdown-menu.show {
  transform: translateY(0);
}

/* LTR positioning */
[dir="ltr"] .dropdown-menu,
html[dir="ltr"] .navbar .dropdown-menu {
  right: auto;
  left: 0;
  transform: translateY(10px);
}

[dir="ltr"] .dropdown-menu.show,
html[dir="ltr"] .navbar .dropdown-menu.show {
  transform: translateY(0);
}

/* Dropdown Items */
.dropdown-item {
  color: rgba(255, 255, 255, 0.85) !important;
  padding: 0.8rem 1.2rem;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 8px;
  margin-bottom: 2px;
  position: relative;
  overflow: hidden;
  background: transparent;
}

.dropdown-item:last-child {
  margin-bottom: 0;
}

/* Hover Effect */
.dropdown-item:hover,
.dropdown-item:focus {
  background: rgba(255, 255, 255, 0.05);
  color: var(--gold-light) !important;
  padding-right: 1.5rem;
}

[dir="ltr"] .dropdown-item:hover,
[dir="ltr"] .dropdown-item:focus {
  padding-right: 1.2rem;
  padding-left: 1.5rem;
}

/* Active State */
.dropdown-item.active {
  background: linear-gradient(135deg, var(--gold-dark), var(--gold-light));
  color: var(--navy-blue) !important;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(200, 160, 65, 0.3);
}


/* Mobile Dropdown Styles */
@media (max-width: 1199px) {
  .dropdown-menu {
    position: static !important;
    transform: none !important;
    background: rgba(10, 15, 60, 0.9) !important;
    border: 1px solid rgba(200, 160, 65, 0.2) !important;
    border-radius: 8px !important;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    padding: 0.5rem !important;
    margin: 0.5rem 0 0.5rem 1rem !important;
    display: none;
    visibility: visible !important;
    opacity: 1 !important;
    transition: none !important;
    float: none !important;
    width: calc(100% - 1rem) !important;
    pointer-events: auto !important;
  }

  .dropdown-menu.show {
    display: block !important;
  }

  .nav-item.dropdown.show .dropdown-menu {
    display: block !important;
  }

  .dropdown-item {
    padding: 0.75rem 1rem !important;
    margin: 0.25rem 0 !important;
    border-radius: 6px !important;
    color: rgba(255, 255, 255, 0.9) !important;
    background: transparent !important;
  }

  .dropdown-item:hover {
    background: rgba(200, 160, 65, 0.15) !important;
    color: var(--gold-light) !important;
    transform: none !important;
    padding-right: 1rem !important;
  }
  
  .dropdown-item.active {
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-light)) !important;
    color: var(--navy-blue) !important;
  }
}

/* Arrow on top of dropdown (Desktop only) */
@media (min-width: 1200px) {
  .dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 20px;
    width: 12px;
    height: 12px;
    background: rgba(10, 15, 60, 0.95);
    border-top: 1px solid rgba(200, 160, 65, 0.2);
    border-left: 1px solid rgba(200, 160, 65, 0.2);
    transform: rotate(45deg);
    z-index: -1;
  }

  [dir="ltr"] .dropdown-menu::before {
    right: auto;
    left: 20px;
  }
}

/* Smooth Dropdown Animation */
.dropdown-menu.show {
  animation: dropdownFadeIn 0.3s ease;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Icon in Dropdown Items */
.dropdown-item i {
  margin-left: 0.5rem;
  font-size: 1rem;
  opacity: 0.7;
  transition: all 0.3s ease;
}

[dir="ltr"] .dropdown-item i {
  margin-left: 0;
  margin-right: 0.5rem;
}

.dropdown-item:hover i {
  opacity: 1;
  transform: translateX(-3px);
}

[dir="ltr"] .dropdown-item:hover i {
  transform: translateX(3px);
}

/* ===================================
   Nest Hub Specific Styles
   =================================== */

/* Nest Hub Max (1280x800) */
@media (width: 1280px) and (height: 800px) {
  .navbar-logo {
    height: 70px;
  }

  .navbar-collapse {
    background-color: rgba(220, 227, 229, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(10, 15, 60, 0.2);
  }

  .navbar-nav {
    gap: 0.25rem;
  }

  .nav-link {
    padding: 0.7rem 1rem !important;
    margin-bottom: 0.25rem;
    margin-left: 0 !important;
    font-size: 0.95rem;
  }

  .btn-language-toggle {
    justify-content: center;
    position: static !important;
    left: auto !important;
  }
  
  .dropdown-menu {
    min-width: 240px;
  }
}

/* Nest Hub (1024x600) */
@media (width: 1024px) and (height: 600px) {
  .navbar-logo {
    height: 60px;
  }

  .navbar {
    padding: 0.5rem 0;
  }

  .navbar-collapse {
    background-color: rgba(220, 227, 229, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 1rem;
    margin-top: 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(10, 15, 60, 0.2);
  }

  .navbar-nav {
    gap: 0.2rem;
  }

  .nav-link {
    padding: 0.6rem 1rem !important;
    margin-bottom: 0.2rem;
    margin-left: 0 !important;
    font-size: 0.9rem;
  }

  .btn-language-toggle {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    position: static !important;
    left: auto !important;
  }
  
  .dropdown-menu {
    min-width: 240px;
  }
}
