/**
 * NEW GLOBAL HEADER - FULLY ISOLATED STYLES
 * 
 * ALL styles are scoped under .new-global-header
 * This prevents ANY conflicts with existing page styles
 * 
 * Namespace: ngh- (new-global-header)
 */

/* ============================================
   RESET & ISOLATION - Prevent inheritance
   ============================================ */
.new-global-header,
.new-global-header * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ============================================
   CONTAINER & LAYOUT
   ============================================ */
.new-global-header {
  position: relative;
  z-index: 9999; /* Very high to stay on top */
  width: 100%;
  background: transparent;
  /* Prevent any bleeding into page content */
  margin: 0 !important;
  padding: 0 !important;
}

.ngh-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}

/* ============================================
   ANNOUNCEMENT BAR
   ============================================ */
.ngh-announcement-bar {
  background: linear-gradient(135deg, #172a74, #21a9af);
  color: #ffffff;
  padding: 12px 0;
  text-align: center;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.ngh-announcement-text {
  display: inline-block;
  font-weight: 500;
  margin-bottom: 8px;
}

.ngh-announcement-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ngh-announcement-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  text-decoration: none;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ngh-announcement-link:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
  color: #ffffff;
  text-decoration: none;
}

/* ============================================
   MAIN NAVBAR
   ============================================ */
.ngh-navbar {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 9998;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scrolled state */
.ngh-navbar.ngh-scrolled {
  padding: 10px 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Hidden state (scroll down) */
.ngh-navbar.ngh-hidden {
  transform: translateY(-100%);
}

.ngh-navbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* ============================================
   LOGO
   ============================================ */
.ngh-logo {
  flex-shrink: 0;
}

.ngh-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #172a74;
  font-weight: 700;
  font-size: 18px;
  transition: opacity 0.2s;
}

.ngh-logo-link:hover {
  opacity: 0.8;
  text-decoration: none;
  color: #172a74;
}

.ngh-logo-img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.ngh-logo-text {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

/* ============================================
   MOBILE TOGGLE
   ============================================ */
.ngh-mobile-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 8px;
  cursor: pointer;
  z-index: 10000;
}

.ngh-toggle-icon {
  display: block;
  width: 25px;
  height: 3px;
  background: #172a74;
  border-radius: 2px;
  transition: all 0.3s;
}

.ngh-mobile-toggle.ngh-active .ngh-toggle-icon:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.ngh-mobile-toggle.ngh-active .ngh-toggle-icon:nth-child(2) {
  opacity: 0;
}

.ngh-mobile-toggle.ngh-active .ngh-toggle-icon:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   NAVIGATION MENU
   ============================================ */
.ngh-nav-collapse {
  display: flex;
  align-items: center;
  gap: 30px;
  flex: 1;
  justify-content: flex-end;
}

.ngh-nav-menu {
  display: flex;
  align-items: center;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ngh-nav-item {
  position: relative;
  list-style: none;
}

.ngh-nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  color: #374151;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.ngh-nav-link:hover {
  background: #f3f4f6;
  color: #172a74;
  text-decoration: none;
}

.ngh-nav-link .ngh-icon {
  font-size: 14px;
  opacity: 0.7;
}

/* ============================================
   DROPDOWN MENUS
   ============================================ */
.ngh-dropdown {
  position: relative;
}

.ngh-dropdown-toggle::after {
  content: '\25BC';
  font-size: 10px;
  margin-left: 6px;
  opacity: 0.6;
  transition: transform 0.2s;
}

.ngh-dropdown.ngh-active .ngh-dropdown-toggle::after {
  transform: rotate(180deg);
}

.ngh-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  padding: 8px;
  margin-top: 8px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
}

.ngh-dropdown.ngh-active .ngh-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.ngh-dropdown-menu-right {
  left: auto;
  right: 0;
}

.ngh-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.2s;
  white-space: nowrap;
}

.ngh-dropdown-item:hover {
  background: linear-gradient(135deg, #172a74, #21a9af);
  color: #ffffff;
  text-decoration: none;
  transform: translateX(4px);
}

.ngh-dropdown-item i {
  font-size: 14px;
  width: 18px;
  text-align: center;
}

.ngh-dropdown-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 8px 0;
  list-style: none;
}

/* ============================================
   MEGAMENU STYLES
   ============================================ */
.ngh-megamenu .dropdown-toggle::after {
  content: '\25BC';
  font-size: 10px;
  margin-left: 6px;
  opacity: 0.6;
  transition: transform 0.2s;
}

.ngh-megamenu-container {
  position: absolute;
  top: 100%;
  left: 0;
  width: 90vw;
  max-width: 1200px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  padding: 30px;
  margin-top: 15px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10000;
  border: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(20px);
}

/* Bootstrap 4 compatibility */
.ngh-megamenu.show .ngh-megamenu-container,
.ngh-megamenu .dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  display: block !important;
}

/* Override Bootstrap dropdown styles */
.ngh-megamenu .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 90vw;
  max-width: 1200px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  padding: 30px;
  margin-top: 15px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(20px);
  border: none !important;
  min-width: auto !important;
  transform: none !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure megamenu is visible when Bootstrap adds .show class */
.ngh-megamenu.show .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) !important;
}

/* Position fix for Bootstrap dropdown */
@media (min-width: 992px) {
  .ngh-megamenu .dropdown-menu {
    left: 0 !important;
    right: auto !important;
    transform: translateY(-20px) !important;
  }
  
  .ngh-megamenu.show .dropdown-menu {
    transform: translateY(0) !important;
  }
}

.ngh-megamenu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.ngh-megamenu-column {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.ngh-megamenu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f3f4f6;
}

.ngh-megamenu-header i {
  font-size: 18px;
  color: #172a74;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #172a74, #21a9af);
  color: #ffffff;
  border-radius: 6px;
}

.ngh-megamenu-header h6 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: #1f2937;
  letter-spacing: -0.3px;
}

.ngh-megamenu-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ngh-megamenu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: #4b5563;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ngh-megamenu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: linear-gradient(135deg, #172a74, #21a9af);
  transform: scaleY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ngh-megamenu-item:hover {
  background: linear-gradient(135deg, rgba(23, 42, 116, 0.05), rgba(33, 169, 175, 0.05));
  color: #172a74;
  text-decoration: none;
  transform: translateX(8px);
  padding-left: 20px;
}

.ngh-megamenu-item:hover::before {
  transform: scaleY(1);
}

.ngh-megamenu-item i {
  font-size: 16px;
  width: 20px;
  text-align: center;
  color: #6b7280;
  transition: color 0.3s;
}

.ngh-megamenu-item:hover i {
  color: #172a74;
}

.ngh-megamenu-item.ngh-featured {
  background: linear-gradient(135deg, rgba(23, 42, 116, 0.08), rgba(33, 169, 175, 0.08));
  border: 1px solid rgba(23, 42, 116, 0.1);
  color: #172a74;
  font-weight: 600;
}

.ngh-megamenu-item.ngh-featured:hover {
  background: linear-gradient(135deg, rgba(23, 42, 116, 0.12), rgba(33, 169, 175, 0.12));
  transform: translateX(8px) scale(1.02);
}

.ngh-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: linear-gradient(135deg, #172a74, #21a9af);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-left: auto;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* ============================================
   MEGAMENU FEATURED SECTION
   ============================================ */
.ngh-megamenu-featured {
  padding-top: 25px;
  border-top: 2px solid #f3f4f6;
}

.ngh-featured-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.ngh-featured-header i {
  font-size: 20px;
  color: #f59e0b;
}

.ngh-featured-header h6 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

.ngh-featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.ngh-featured-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(135deg, #ffffff, #f9fafb);
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ngh-featured-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #172a74, #21a9af);
  transform: scaleX(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ngh-featured-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
  border-color: #172a74;
  text-decoration: none;
}

.ngh-featured-card:hover::before {
  transform: scaleX(1);
}

.ngh-featured-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #172a74, #21a9af);
  color: #ffffff;
  border-radius: 12px;
  font-size: 20px;
  flex-shrink: 0;
}

.ngh-featured-content {
  flex: 1;
}

.ngh-featured-content h7 {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 4px 0;
}

.ngh-featured-content p {
  font-size: 13px;
  color: #6b7280;
  margin: 0;
  line-height: 1.4;
}

.ngh-featured-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 16px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ngh-featured-badge:contains('NEW') {
  background: linear-gradient(135deg, #172a74, #21a9af);
}

.ngh-featured-badge:contains('PRO') {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* ============================================
   MEGAMENU RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
  .ngh-megamenu-container {
    width: 95vw;
    padding: 25px;
  }
  
  .ngh-megamenu-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
  }
  
  .ngh-featured-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 991px) {
  .ngh-megamenu-container {
    position: static;
    width: 100%;
    max-width: none;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border-radius: 0;
    padding: 20px;
    margin: 0;
    display: none;
    background: #f9fafb;
  }
  
  .ngh-megamenu.ngh-active .ngh-megamenu-container {
    display: block;
  }
  
  .ngh-megamenu-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .ngh-featured-grid {
    grid-template-columns: 1fr;
  }
  
  .ngh-megamenu-featured {
    margin-top: 20px;
    padding-top: 20px;
  }
  
  .ngh-featured-card {
    padding: 16px;
  }
}

@media (max-width: 576px) {
  .ngh-megamenu-container {
    padding: 15px;
  }
  
  .ngh-megamenu-header {
    gap: 10px;
  }
  
  .ngh-megamenu-header h6 {
    font-size: 15px;
  }
  
  .ngh-megamenu-item {
    padding: 12px 14px;
    font-size: 13px;
  }
  
  .ngh-featured-card {
    padding: 14px;
    gap: 12px;
  }
  
  .ngh-featured-icon {
    width: 40px;
    height: 40px;
    font-size: 18px;
  }
  
  .ngh-featured-content h7 {
    font-size: 14px;
  }
  
  .ngh-featured-content p {
    font-size: 12px;
  }
}

/* ============================================
   AUTH BUTTONS
   ============================================ */
.ngh-auth-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ngh-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.ngh-btn .ngh-icon {
  font-size: 14px;
}

.ngh-btn-primary {
  background: linear-gradient(135deg, #172a74, #21a9af);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(23, 42, 116, 0.2);
}

.ngh-btn-primary:hover {
  box-shadow: 0 4px 16px rgba(23, 42, 116, 0.3);
  transform: translateY(-2px);
  color: #ffffff;
}

.ngh-btn-outline {
  background: transparent;
  color: #172a74;
  border: 2px solid #172a74;
}

.ngh-btn-outline:hover {
  background: #172a74;
  color: #ffffff;
}

.ngh-btn-user {
  background: #f3f4f6;
  color: #374151;
  padding: 8px 16px;
}

.ngh-btn-user:hover {
  background: #e5e7eb;
}

.ngh-user-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 991px) {
  .ngh-mobile-toggle {
    display: flex;
  }
  
  .ngh-nav-collapse {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: #ffffff;
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 30px 30px;
    gap: 20px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    z-index: 9999;
  }
  
  .ngh-nav-collapse.ngh-active {
    transform: translateX(0);
  }
  
  .ngh-nav-menu {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    gap: 0;
  }
  
  .ngh-nav-item {
    width: 100%;
    border-bottom: 1px solid #f3f4f6;
  }
  
  .ngh-nav-link {
    width: 100%;
    padding: 15px 0;
  }
  
  .ngh-dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: #f9fafb;
    margin: 10px 0;
    display: none;
  }
  
  .ngh-dropdown.ngh-active .ngh-dropdown-menu {
    display: block;
  }
  
  .ngh-auth-buttons {
    width: 100%;
    flex-direction: column;
    padding-top: 20px;
    border-top: 2px solid #f3f4f6;
  }
  
  .ngh-btn {
    width: 100%;
    justify-content: center;
  }
  
  /* Mobile menu backdrop */
  .ngh-nav-collapse.ngh-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: -1;
  }
}

@media (max-width: 576px) {
  .ngh-container {
    padding: 0 15px;
  }
  
  .ngh-logo-text {
    font-size: 16px;
  }
  
  .ngh-logo-img {
    height: 32px;
  }
  
  .ngh-announcement-bar {
    font-size: 12px;
    padding: 10px 0;
  }
  
  .ngh-announcement-text {
    margin-bottom: 6px;
  }
  
  .ngh-announcement-actions {
    gap: 12px;
  }
  
  .ngh-announcement-link {
    font-size: 12px;
    padding: 5px 10px;
  }
  
  .ngh-navbar {
    padding: 12px 0;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.ngh-btn:focus,
.ngh-nav-link:focus,
.ngh-dropdown-item:focus {
  outline: 2px solid #21a9af;
  outline-offset: 2px;
}

/* Skip to content link */
.ngh-skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #172a74;
  color: #ffffff;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 10001;
}

.ngh-skip-link:focus {
  top: 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .new-global-header {
    display: none;
  }
}
