/* ===== Scoped Header Styles ===== */

html, body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
}

.site-header {
  background-color: #1e40af; /* Indigo 700 */
  color: #fff;
  font-family: 'Inter', 'Noto Sans Sinhala', sans-serif;
  position: sticky;
  top: 0;
  z-index: 9999;
  user-select: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  width: 100vw;         /* Full viewport width */
  max-width: 100vw;     /* Prevent wider than viewport */
  overflow-x: hidden;   /* Hide any horizontal overflow */
  box-sizing: border-box;
}

.site-header .header-container {
  max-width: 1200px;
  width: 100%;          /* Full width inside container */
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-sizing: border-box;
}

/* Logo */
.site-header .logo {
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.site-header .logo i {
  font-size: 1.7rem;
  color: #60a5fa; /* Indigo 400 */
}

/* Main navigation */
.site-header .main-nav {
  flex: 1;
  margin-left: 2rem;
}

.site-header .nav-items {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header .nav-items li a {
  color: #e0e7ff;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0;
  border-bottom: 3px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.site-header .nav-items li a:hover,
.site-header .nav-items li a:focus {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
  outline: none;
}

/* User actions */
.site-header .user-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  flex-shrink: 0;
}

/* Buttons */
.site-header .btn {
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 9999px;
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  user-select: none;
  transition: background-color 0.3s ease;
  border: none;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: 2px solid transparent;
}

.site-header .btn-login {
  background-color: transparent;
  color: #e0e7ff;
  border: 2px solid #e0e7ff;
}

.site-header .btn-login:hover,
.site-header .btn-login:focus {
  background-color: #e0e7ff;
  color: #1e40af;
  outline: none;
}

.site-header .btn-register {
  background-color: #60a5fa;
  color: #fff;
  border: 2px solid #60a5fa;
  width: 25vw; /* 1/4th of viewport width */
  max-width: 150px; /* optional max to avoid too big */
  min-width: 100px; /* optional min for small devices */
  text-align: center;
}

.site-header .btn-register:hover,
.site-header .btn-register:focus {
  background-color: #2563eb;
  border-color: #2563eb;
  outline: none;
}

/* Dropdown */
.site-header .nav-dropdown {
  position: relative;
}

.site-header .dropdown-toggle {
  background: none;
  border: none;
  color: #e0e7ff;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  user-select: none;
  padding: 0.4rem 0.5rem;
  border-radius: 0.5rem;
  transition: background-color 0.3s ease;
}

.site-header .dropdown-toggle:hover,
.site-header .dropdown-toggle:focus {
  background-color: #3b82f6;
  outline: none;
}

.site-header .dropdown-toggle i:last-child {
  margin-left: 0.15rem;
}

.site-header .dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background-color: #1e40af;
  border-radius: 0.5rem;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  min-width: 190px;
  display: none;
  flex-direction: column;
  z-index: 10000;
}

.site-header .dropdown-menu li a {
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #e0e7ff;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.site-header .dropdown-menu li a:hover,
.site-header .dropdown-menu li a:focus {
  background-color: #3b82f6;
  outline: none;
}

/* Show dropdown when open */
.site-header .nav-dropdown.open .dropdown-menu {
  display: flex;
}

/* Mobile Menu Toggle Button */
.site-header .mobile-menu-toggle {
  background: none;
  border: none;
  color: #e0e7ff;
  font-size: 1.6rem;
  cursor: pointer;
  display: none;
  user-select: none;
}

/* Mobile Navigation */
.site-header .mobile-nav {
  display: none;
  background-color: #1e40af;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border-radius: 0 0 1rem 1rem;
  z-index: 9998;
}

.site-header .mobile-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-left: 0;
  margin: 0;
}

.site-header .mobile-nav ul li a {
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: #e0e7ff;
  border-top: 1px solid rgba(255 255 255 / 0.15);
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.site-header .mobile-nav ul li a:hover,
.site-header .mobile-nav ul li a:focus {
  background-color: #3b82f6;
  outline: none;
}

/* Responsive styles */
@media (max-width: 900px) {
  .site-header .main-nav {
    display: none;
  }
  .site-header .mobile-menu-toggle {
    display: block;
  }
  .site-header .mobile-nav[hidden] {
    display: none;
  }
  .site-header .mobile-nav:not([hidden]) {
    display: flex;
    flex-direction: column;
  }
  .site-header .header-container {
    position: relative;
  }
}
