/* 
 * Corpify Enhanced Navbar Styles
 * Improved dropdown system with better hover accessibility
 */

/* Main Navbar Styling */
.navbar {
  background: linear-gradient(135deg, #004080, #003366);
  padding: 0.75rem 0;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1030;
}

/* Brand/Logo Styling */
.navbar-brand {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 1.8rem;
  color: white !important;
  display: flex;
  align-items: center;
}

.navbar-brand img {
  margin-right: 8px;
  height: 32px;
}

/* Navigation Links */
.nav-link {
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  padding: 0.75rem 1rem !important;
  color: rgba(255,255,255,0.9) !important;
  position: relative;
}

.nav-link:hover, .nav-link:focus {
  color: #ffffff !important;
}

.nav-link.active {
  color: #ffffff !important;
  font-weight: 600;
}

/* Active indicator */
.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background-color: #ffffff;
  border-radius: 3px;
}

/* ======= IMPROVED DROPDOWN SYSTEM ======= */

/* Dropdown container - add padding to increase hover area */
.nav-item.dropdown {
  position: static;
  padding-bottom: 20px; /* Add padding to create a larger hover area */
  margin-bottom: -20px; /* Offset the padding to maintain layout */
}

/* Dropdown toggle styling */
.dropdown-toggle {
  display: flex;
  align-items: center;
}

/* Custom dropdown arrow */
.dropdown-toggle::after {
  display: inline-block;
  margin-left: 0.5em;
  content: "▾";
  border: none;
  font-size: 0.8em;
  vertical-align: middle;
}

/* Dropdown panel - completely new approach */
.dropdown-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background-color: #ffffff;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border-radius: 0 0 10px 10px;
  padding: 1.5rem;
  display: none;
  z-index: 1031;
  border-top: 3px solid #ff6b35;
  /* Add a buffer zone at the top to make it easier to reach */
  margin-top: -5px;
  padding-top: 20px;
}

/* Show dropdown panel on hover with a delay for closing */
@media (min-width: 992px) {
  .nav-item.dropdown:hover .dropdown-panel {
    display: block;
  }
  
  /* Create a buffer zone between navbar and dropdown */
  .dropdown-panel::before {
    content: '';
    position: absolute;
    top: -20px; /* Match the padding-top */
    left: 0;
    right: 0;
    height: 20px;
    background: transparent; /* Invisible buffer */
  }
  
  /* Keep dropdown visible when hovering over it */
  .dropdown-panel:hover {
    display: block;
  }
}

/* Standard dropdown panel */
.dropdown-panel.standard-panel {
  width: 250px;
  left: auto;
  right: auto;
}

/* Mega menu panel */
.dropdown-panel.mega-panel {
  width: 100%;
}

/* Panel header */
.panel-header {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e9ecef;
  color: #004080;
  font-weight: 600;
  font-size: 1.1rem;
}

/* Panel items */
.panel-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Standard panel item */
.panel-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  color: #495057;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.panel-item:hover {
  background-color: #e6f0ff;
  color: #004080;
  transform: translateX(5px);
}

.panel-item i {
  margin-right: 10px;
  color: #004080;
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

/* Mega panel columns */
.mega-columns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
}

.mega-column {
  display: flex;
  flex-direction: column;
}

.mega-column-header {
  font-weight: 600;
  color: #004080;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e6f0ff;
}

.mega-column-items {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mega-item {
  color: #495057;
  text-decoration: none;
  padding: 0.5rem 0;
  transition: all 0.2s ease;
  display: block;
}

.mega-item:hover {
  color: #004080;
  transform: translateX(5px);
}

/* Mobile navigation */
@media (max-width: 991.98px) {
  .navbar-collapse {
    background-color: #004080;
    padding: 1rem;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  }
  
  .nav-item.dropdown {
    padding-bottom: 0;
    margin-bottom: 0;
  }
  
  .dropdown-panel {
    position: static;
    box-shadow: none;
    border-radius: 8px;
    margin: 0.5rem 0;
    padding: 1rem;
    background-color: rgba(255,255,255,0.95);
    border-top: none;
    border-left: 3px solid #ff6b35;
    margin-top: 0;
    padding-top: 1rem;
  }
  
  .dropdown-panel.standard-panel {
    width: 100%;
  }
  
  .mega-columns {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .mega-column {
    margin-bottom: 1rem;
  }
  
  /* Mobile dropdown toggle */
  .mobile-dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    color: rgba(255,255,255,0.9);
    padding: 0.75rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    font-size: 1rem;
  }
  
  .mobile-dropdown-toggle:focus {
    outline: none;
  }
  
  .mobile-dropdown-toggle i {
    transition: transform 0.3s ease;
  }
  
  .mobile-dropdown-toggle.active i {
    transform: rotate(180deg);
  }
}

/* Navbar Toggler (Mobile) */
.navbar-toggler {
  border: none;
  padding: 0.5rem;
  border-radius: 8px;
  background-color: rgba(255,255,255,0.1);
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255, 255, 255, 0.9)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Search Form in Navbar */
.navbar-search {
  position: relative;
  margin-right: 0.75rem;
}

.navbar-search .form-control {
  background-color: rgba(255,255,255,0.1);
  border: none;
  border-radius: 50px;
  color: white;
  padding-left: 2.5rem;
  padding-right: 1rem;
  height: calc(1.5em + 0.75rem + 2px);
  font-size: 0.9rem;
}

.navbar-search .form-control:focus {
  background-color: rgba(255,255,255,0.2);
  box-shadow: 0 0 0 0.25rem rgba(255,255,255,0.1);
}

.navbar-search .form-control::placeholder {
  color: rgba(255,255,255,0.6);
}

.navbar-search .search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}

/* CTA Button in Navbar */
.navbar-cta {
  background-color: #ff6b35;
  color: white !important;
  border-radius: 50px;
  padding: 0.5rem 1rem !important;
  margin-left: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.5;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(255,107,53,0.3);
  transition: all 0.2s ease;
}

.navbar-cta:hover {
  background-color: #e55a2a;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255,107,53,0.4);
}

/* Progress Bar on Scroll */
.scroll-progress-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background-color: rgba(255,255,255,0.1);
  z-index: 1030;
}

.scroll-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff6b35, #2ec4b6);
  width: 0%;
}
