/* Shared Unified Header Styles */

/* Hide content until auth verified - prevents flash of interface */
body.auth-pending { visibility: hidden; }
body.auth-ready { visibility: visible; }

/* Unified Header */
.unified-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 1000;
}

.unified-header .header-left {
  display: flex;
  align-items: center;
  gap: 24px;
}

.unified-header .logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
}

.unified-header .logo-link img {
  width: 24px;
  height: 24px;
}

.unified-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
}

.unified-header .logo-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.3px;
}

.unified-header .search-container {
  position: relative;
}

.unified-header .global-search {
  width: 280px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  font-size: 13px;
  color: #ffffff;
  transition: all 0.15s;
}

.unified-header .global-search::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.unified-header .global-search:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.unified-header .search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-height: 400px;
  overflow-y: auto;
  z-index: 1001;
}

.unified-header .search-dropdown.hidden {
  display: none;
}

.unified-header .search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: #111827;
  text-decoration: none;
}

.unified-header .search-result-item:hover {
  background: #f3f4f6;
}

.unified-header .search-result-name {
  font-weight: 500;
  font-size: 13px;
}

.unified-header .search-result-domain {
  font-size: 12px;
  color: #6b7280;
}

.unified-header .header-nav {
  display: flex;
  gap: 8px;
}

.unified-header .nav-link {
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.15s;
}

.unified-header .nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.unified-header .nav-link.active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.unified-header .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.unified-header .user-email {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.unified-header .logout-btn {
  padding: 5px 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.15s;
}

.unified-header .logout-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* Logo Navigation Dropdown */
.unified-header .logo-container {
  position: relative;
}

.unified-header .logo-dropdown-arrow {
  margin-left: 4px;
  opacity: 0.6;
  transition: transform 0.15s;
}

.unified-header .logo-container.open .logo-dropdown-arrow {
  transform: rotate(180deg);
}

.unified-header .nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 200px;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  padding: 6px;
  z-index: 1002;
  display: none;
}

.unified-header .logo-container.open .nav-dropdown {
  display: block;
}

.unified-header .nav-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  color: #374151;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.1s;
  cursor: pointer;
}

.unified-header .nav-dropdown-item:hover {
  background: #f5f5f5;
}

.unified-header .nav-dropdown-item.active {
  color: #dc2626;
  background: #fef2f2;
}

.unified-header .nav-dropdown-item .item-icon {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  opacity: 0.7;
}

.unified-header .nav-dropdown-item .item-label {
  flex: 1;
  display: flex;
  align-items: center;
}

.unified-header .nav-dropdown-item .expand-icon {
  width: 16px;
  height: 16px;
  opacity: 0.4;
  transition: transform 0.2s ease;
}

.unified-header .nav-dropdown-group.expanded .nav-dropdown-item .expand-icon {
  transform: rotate(180deg);
}

.unified-header .nav-dropdown-subitems {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.2s ease;
}

.unified-header .nav-dropdown-group.expanded .nav-dropdown-subitems {
  max-height: 200px;
}

.unified-header .nav-dropdown-subitem {
  display: block;
  padding: 8px 12px 8px 40px;
  font-size: 13px;
  font-weight: 450;
  color: #6b7280;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.1s;
}

.unified-header .nav-dropdown-subitem:hover {
  color: #374151;
  background: #f5f5f5;
}

.unified-header .nav-dropdown-subitem.active {
  color: #dc2626;
  background: #fef2f2;
}

.unified-header .nav-dropdown-divider {
  height: 1px;
  background: #f0f0f0;
  margin: 6px 0;
}
