/* Shared app header (dashboard, tenant-dashboard, admin, response, tenant-listing) */

:root {
  --primary: #1F6E73;
  --primary-900: #145359;
  --accent: #F5A54A;
  --tenant: #8B5CF6;
  --tenant-dark: #7C3AED;
  --tenant-soft: rgba(139, 92, 246, 0.1);
  --dark: #0F172A;
  --text: #22303A;
  --text-light: #64748B;
  --border: #E2EAE8;
  --header-height: 80px;
}

html {
  scroll-padding-top: calc(var(--header-height) + env(safe-area-inset-top, 0px));
}

#header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  align-self: flex-start;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(226, 234, 232, 0.6);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

#header.scrolled {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

#header .container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 40px;
  min-width: 0;
}

.header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 28px;
  min-height: var(--header-height);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}

.brand img {
  height: 56px;
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

nav.main-nav {
  display: flex;
  gap: 26px;
  align-items: center;
  flex-wrap: wrap;
}

nav.main-nav a {
  font-weight: 500;
  color: var(--dark);
  font-size: 14px;
  white-space: nowrap;
  position: relative;
  padding: 8px 0;
  text-decoration: none;
  transition: color 0.25s;
}

nav.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 3px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-900) 100%);
  border-radius: 3px 3px 0 0;
  transition: width 0.3s ease;
}

nav.main-nav a:hover {
  color: var(--primary);
}

nav.main-nav a:hover::after,
nav.main-nav a.active::after {
  width: 100%;
}

nav.main-nav a.active {
  color: var(--primary);
}

nav.main-nav a.nav-featured {
  color: var(--primary);
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  min-width: 0;
}

.header-auth-user {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: transform 0.2s ease, filter 0.2s ease;
  flex-shrink: 0;
}

.header-auth-user:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.header-auth-logout {
  padding: 10px 16px;
  font-size: 14px;
}

#header .header-auth-logout.btn-outline,
#header .btn-outline.header-auth-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  background: #fff;
  color: var(--dark);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: none;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

#header .header-auth-logout.btn-outline:hover,
#header .btn-outline.header-auth-logout:hover {
  background: #f7f7f7;
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--dark);
  transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
}

#header .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 999px;
  background: #fff;
  color: var(--dark);
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: none;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  letter-spacing: -0.01em;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

#header .btn-primary:hover {
  background: #f7f7f7;
  transform: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.05);
}

#header .btn-primary i {
  font-size: 16px;
  opacity: 0.85;
}

@media (max-width: 968px) {
  :root {
    --header-height: 52px;
  }

  #header {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  }

  #header .container {
    padding-right: max(60px, calc(16px + env(safe-area-inset-right)));
  }

  .header-wrap {
    padding: 6px 0;
    gap: 12px;
    min-height: var(--header-height);
  }

  .brand img {
    height: 40px;
  }

  nav.main-nav {
    display: none;
  }

  #headerAuthActions {
    display: none;
  }
}

@media (max-width: 768px) {
  #header .container {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(60px, calc(16px + env(safe-area-inset-right)));
  }

  .header-auth-logout,
  #header .header-auth-logout.btn-outline {
    padding: 10px 16px;
    font-size: 13px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-height: 48px;
  }

  #header .container {
    padding-right: max(56px, calc(12px + env(safe-area-inset-right)));
  }

  .header-wrap {
    padding: 4px 0;
  }

  .brand img {
    height: 36px;
  }
}
