/* header.css - UPDATED WITH LOGO CAPTION FIX & MODERN MENU ICON */
:root {
  --black: #000000;
  --red: #BB0000;
  --green: #006600;
  --white: #FFFFFF;
  --light-red: #e60000;
  --light-green: #008000;
  --dark-red: #800000;
  --dark-green: #004d00;
  --gold: #FFD700;
  --gradient-black: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
  --gradient-red: linear-gradient(135deg, #BB0000 0%, #800000 100%);
  --gradient-green: linear-gradient(135deg, #006600 0%, #004d00 100%);
}

/* NAVBAR STYLES - Premium Design */
.navbar {
  background: var(--gradient-black);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 3px solid var(--red);
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  position: relative;
  gap: 15px;
}

/* Logo Styling */
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 12px;
  position: relative;
  flex-shrink: 0;
  z-index: 1003;
}

.logo::before {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--green));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.logo:hover::before {
  opacity: 1;
}

.logo img {
  height: 45px;
  width: auto;
  border-radius: 10px;
  background: var(--white);
  padding: 5px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px solid transparent;
}

.logo img:hover {
  transform: scale(1.05) rotate(2deg);
  box-shadow: 0 6px 20px rgba(187, 0, 0, 0.4);
  border-color: var(--red);
}

.brand-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--white);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.4);
  letter-spacing: -0.5px;
  background: linear-gradient(90deg, var(--white), #ffd700, var(--white));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
  position: relative;
  white-space: nowrap;
  display: inline-block; /* Ensure it displays */
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Welcome Message */
.welcome-message {
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.95;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 16px;
  border-radius: 18px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  white-space: nowrap;
  margin: 0 15px;
  flex-shrink: 0;
}

.welcome-message.desktop-only {
  display: none;
}

.welcome-message.mobile-only {
  display: none;
  width: 100%;
  text-align: center;
  margin: 12px 0 20px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(187, 0, 0, 0.2), rgba(0, 102, 0, 0.2));
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 1rem;
}

/* DESKTOP NAVIGATION */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex-shrink: 1;
  min-width: 0;
}

.desktop-nav a,
.auth-section a {
  color: var(--white);
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

.desktop-nav a::before,
.auth-section a::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.desktop-nav a:hover::before,
.auth-section a:hover::before {
  left: 100%;
}

.desktop-nav a:hover,
.auth-section a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.desktop-nav a i,
.auth-section a i {
  font-size: 1em;
  transition: transform 0.3s ease;
}

.desktop-nav a:hover i,
.auth-section a:hover i {
  transform: scale(1.15);
}

/* Dropdown Styles */
.dropdown {
  position: relative;
}

.dropbtn {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--white);
  padding: 10px 16px;
  border-radius: 25px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}

.dropbtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.dropbtn:hover::before {
  left: 100%;
}

.dropbtn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  border-color: rgba(255, 255, 255, 0.3);
}

.dropbtn i:last-child {
  transition: transform 0.3s ease;
  font-size: 0.85em;
  margin-left: 2px;
}

.dropdown.active .dropbtn i:last-child {
  transform: rotate(180deg);
}

.dropdown-content {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--gradient-black);
  min-width: 220px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  border-radius: 14px;
  overflow: hidden;
  z-index: 1001;
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0;
  transform: translateY(-8px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropdown.active .dropdown-content {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.dropdown-content a {
  color: var(--white);
  padding: 12px 20px;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.25s ease;
  background: transparent;
  border: none;
  width: 100%;
  text-align: left;
  position: relative;
  border-radius: 0;
  backdrop-filter: none;
  margin: 0;
  font-size: 0.95rem;
}

.dropdown-content a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background: linear-gradient(to bottom, var(--red), var(--green));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dropdown-content a:hover::before {
  opacity: 1;
}

.dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(5px);
  padding-left: 25px;
}

/* Auth Section */
.auth-section {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 6px;
  flex-shrink: 0;
}

/* MODERN MOBILE MENU TOGGLE - ENHANCED DESIGN */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px; /* Better touch target */
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  cursor: pointer;
  padding: 0;
  z-index: 1002;
  position: relative;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.menu-toggle:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(187, 0, 0, 0.3);
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  margin: 3px 0;
}

/* Modern animated stripes */
.menu-toggle span:nth-child(1) {
  width: 24px;
  background: linear-gradient(90deg, var(--white) 0%, #ffd700 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.menu-toggle span:nth-child(2) {
  width: 20px;
  background: linear-gradient(90deg, #ffd700 0%, var(--white) 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.menu-toggle span:nth-child(3) {
  width: 16px;
  background: linear-gradient(90deg, var(--white) 0%, var(--red) 100%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Animated X transformation */
.menu-toggle.active {
  background: rgba(187, 0, 0, 0.2);
  border-color: rgba(187, 0, 0, 0.4);
  transform: rotate(180deg);
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
  width: 24px;
  background: linear-gradient(90deg, var(--red) 0%, #ffd700 100%);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
  width: 24px;
  background: linear-gradient(90deg, #ffd700 0%, var(--red) 100%);
}

/* MOBILE NAVIGATION */
.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.95) 100%);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 998;
}

.mobile-nav-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 88%;
  max-width: 320px;
  height: 100vh;
  background: var(--gradient-black);
  padding: 25px 20px;
  overflow-y: auto;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.4);
  border-left: 4px solid var(--red);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: slideInRight 0.6s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.mobile-nav-content a,
.mobile-dropbtn {
  color: var(--white);
  text-decoration: none;
  padding: 14px 18px;
  border-radius: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  position: relative;
  overflow: hidden;
  font-size: 0.95rem;
}

.mobile-nav-content a::before,
.mobile-dropbtn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.mobile-nav-content a:hover::before,
.mobile-dropbtn:hover::before {
  left: 100%;
}

.mobile-nav-content a:hover,
.mobile-dropbtn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateX(5px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  border-color: rgba(255, 255, 255, 0.3);
}

.mobile-dropdown {
  position: relative;
}

.mobile-dropbtn {
  width: 100%;
  justify-content: space-between;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: left;
}

.mobile-dropdown-arrow {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 0.85em;
}

.mobile-dropdown.active .mobile-dropdown-arrow {
  transform: rotate(180deg);
}

.mobile-dropdown-content {
  display: none;
  margin-top: 6px;
  margin-bottom: 6px;
  padding-left: 18px;
  border-left: 3px solid var(--green);
  animation: fadeIn 0.3s ease;
}

.mobile-dropdown.active .mobile-dropdown-content {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* RESPONSIVE DESIGN - UPDATED BREAKPOINTS */

/* Show desktop navigation on larger screens */
@media (min-width: 1024px) {
  .desktop-nav,
  .auth-section,
  .welcome-message.desktop-only {
    display: flex;
  }
  
  .welcome-message.desktop-only {
    display: block;
  }
  
  .menu-toggle,
  .mobile-nav-overlay,
  .mobile-nav {
    display: none;
  }
  
  /* Ensure logo caption shows on desktop */
  .brand-name {
    display: inline-block !important;
  }
}

/* MOBILE STYLES - CRITICAL FIX */
@media (max-width: 1023px) {
  /* Reset nav-container for mobile */
  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    width: 100%;
  }

  /* Force logo to left and menu to right */
  .logo {
    flex: 0 0 auto;
    margin-right: auto; /* Push menu toggle to right */
  }
  
  /* FIX: Show brand name on mobile */
  .brand-name {
    display: inline-block !important; /* Force show on mobile */
    font-size: 1.4rem; /* Slightly smaller on mobile */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    background: linear-gradient(90deg, var(--white), #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 3s ease infinite;
  }

  /* Show menu toggle button on mobile */
  .menu-toggle {
    display: flex;
    flex: 0 0 auto;
    margin-left: auto; /* Ensure it's pushed to right */
  }

  /* Hide all desktop elements on mobile */
  .desktop-nav,
  .auth-section,
  .welcome-message.desktop-only {
    display: none !important;
  }
  
  /* Show mobile welcome message */
  .welcome-message.mobile-only {
    display: block;
  }
  
  /* Adjust logo size for mobile */
  .logo img {
    height: 42px;
  }
  
  /* Ensure menu toggle is positioned correctly */
  .menu-toggle {
    position: relative;
    right: 0;
    top: 0;
    transform: none;
    z-index: 1002;
  }
}

/* Large Desktop */
@media (min-width: 1200px) {
  .nav-container {
    padding: 0 40px;
  }
  
  .desktop-nav {
    gap: 8px;
  }
  
  .welcome-message.desktop-only {
    display: block;
    font-size: 1.05rem;
    padding: 8px 20px;
  }
  
  .brand-name {
    font-size: 1.7rem;
  }
}

/* Medium Desktop */
@media (min-width: 1024px) and (max-width: 1199px) {
  .nav-container {
    padding: 0 30px;
  }
  
  .desktop-nav {
    gap: 6px;
  }
  
  .desktop-nav a,
  .auth-section a,
  .dropbtn {
    padding: 9px 14px;
    font-size: 0.92rem;
  }
  
  .brand-name {
    font-size: 1.5rem;
  }
  
  .welcome-message.desktop-only {
    display: block;
    font-size: 0.95rem;
    padding: 6px 14px;
    margin: 0 10px;
  }
}

/* Tablets (768px - 1023px) */
@media (min-width: 768px) and (max-width: 1023px) {
  .brand-name {
    font-size: 1.6rem;
  }
  
  .logo img {
    height: 44px;
  }
  
  .menu-toggle {
    width: 48px;
    height: 48px;
  }
  
  .menu-toggle span {
    width: 26px;
  }
  
  .menu-toggle span:nth-child(2) {
    width: 22px;
  }
  
  .menu-toggle span:nth-child(3) {
    width: 18px;
  }
}

/* Small phones (480px - 767px) */
@media (max-width: 767px) {
  body {
    padding-top: 65px;
  }
  
  .navbar {
    padding: 0;
  }
  
  .nav-container {
    padding: 0 16px;
    height: 65px;
  }
  
  .logo {
    gap: 10px;
  }
  
  .logo img {
    height: 40px;
  }
  
  .brand-name {
    font-size: 1.3rem;
  }
  
  .mobile-nav {
    width: 92%;
    max-width: 300px;
    padding: 20px 16px;
  }
  
  .mobile-nav-content {
    gap: 8px;
  }
  
  .mobile-nav-content a,
  .mobile-dropbtn {
    padding: 12px 16px;
    font-size: 0.9rem;
  }
  
  .menu-toggle {
    width: 40px;
    height: 40px;
  }
  
  .menu-toggle span {
    width: 20px;
    height: 2px;
    margin: 2px 0;
  }
  
  .menu-toggle span:nth-child(2) {
    width: 16px;
  }
  
  .menu-toggle span:nth-child(3) {
    width: 12px;
  }
}

/* Very small phones (below 480px) */
@media (max-width: 480px) {
  body {
    padding-top: 60px;
  }
  
  .nav-container {
    padding: 0 14px;
    height: 60px;
    gap: 10px;
  }
  
  .logo {
    gap: 8px;
  }
  
  .logo img {
    height: 38px;
  }
  
  .brand-name {
    font-size: 1.2rem;
    letter-spacing: -0.3px;
  }
  
  /* Hide brand name on very small screens if needed */
  @media (max-width: 380px) {
    .brand-name {
      font-size: 1.1rem;
    }
  }
  
  @media (max-width: 340px) {
    .brand-name {
      display: none; /* Hide on extremely small screens */
    }
    
    .logo {
      gap: 0;
    }
  }
  
  .menu-toggle {
    width: 36px;
    height: 36px;
  }
  
  .menu-toggle span {
    width: 18px;
    height: 2px;
    margin: 2px 0;
  }
  
  .menu-toggle span:nth-child(2) {
    width: 14px;
  }
  
  .menu-toggle span:nth-child(3) {
    width: 10px;
  }
  
  .mobile-nav {
    width: 100%;
    max-width: none;
    right: -100%;
    padding: 70px 12px 20px;
  }
  
  .mobile-nav.active {
    right: 0;
  }
  
  .welcome-message.mobile-only {
    padding: 10px;
    margin: 10px 0 15px;
    font-size: 0.95rem;
  }
}

/* Extra small devices */
@media (max-width: 360px) {
  .nav-container {
    padding: 0 12px;
  }
  
  .brand-name {
    font-size: 1.1rem;
  }
  
  .logo img {
    height: 36px;
  }
}

/* ADDITIONAL STYLING */
a:focus,
button:focus {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
  border-radius: 8px;
}

/* Scrollbar styling */
.mobile-nav::-webkit-scrollbar {
  width: 6px;
}

.mobile-nav::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

.mobile-nav::-webkit-scrollbar-thumb {
  background: var(--red);
  border-radius: 4px;
  border: 2px solid rgba(0, 0, 0, 0.2);
}

/* Kenyan flag inspired decorative elements */
.navbar::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red) 0%, var(--white) 50%, var(--green) 100%);
}

/* Body lock when menu is open */
body.menu-open {
  overflow: hidden;
}

/* Prevent text selection */
.dropbtn, .mobile-dropbtn, .menu-toggle {
  user-select: none;
}

/* Smooth transitions */
.desktop-nav a,
.dropbtn,
.mobile-nav a,
.mobile-dropbtn,
.menu-toggle {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading animation for menu toggle */
@keyframes pulse {
  0% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow: 0 6px 20px rgba(187, 0, 0, 0.4);
  }
  100% {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  }
}

.menu-toggle:hover {
  animation: pulse 1.5s infinite;
}