/* shared-header.css - Unified header styles */

.app-header {
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, #2a4d8f 0%, #1f3a6d 100%);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  border-bottom: 3px solid #4a6fa5;
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: #fff;
  white-space: nowrap;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.brand-icon {
  font-size: 1.5rem;
}

.brand-text {
  font-size: 1.1rem;
}

/* Navigation */
.main-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
  flex: 1;
  justify-content: center;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid transparent;
}

.nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.1rem;
}

.nav-label {
  font-size: 0.85rem;
}

/* Navigation Dropdowns */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-trigger {
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.nav-arrow {
  font-size: 0.7rem;
  margin-left: 0.2rem;
  transition: transform 0.2s;
}

.nav-dropdown-trigger:hover .nav-arrow,
.nav-dropdown-menu.show ~ .nav-dropdown-trigger .nav-arrow {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.nav-dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: background 0.2s;
  border-bottom: 1px solid #f0f0f0;
}

.nav-dropdown-item:last-child {
  border-bottom: none;
}

.nav-dropdown-item:hover {
  background: #f7f9fc;
  color: #2a4d8f;
}

.nav-dropdown-item.active {
  background: #e8eef8;
  color: #2a4d8f;
  font-weight: 600;
}

.nav-dropdown-item .nav-icon {
  font-size: 1rem;
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Printer Select */
.printer-select-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.printer-select-header label {
  margin: 0;
  font-weight: 600;
  font-size: 0.85rem;
  color: #fff;
  white-space: nowrap;
}

.printer-select-header select {
  width: auto;
  min-width: 180px;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  color: #2a4d8f;
  font-weight: 500;
}

.printer-select-header button {
  width: auto;
  padding: 0.35rem 0.6rem;
  font-size: 0.85rem;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.printer-select-header button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(180deg);
}

/* User Menu */
.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
  font-size: 0.9rem;
}

.user-menu-trigger:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.user-avatar {
  font-size: 1.2rem;
}

.user-name {
  font-size: 0.9rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-role-badge {
  padding: 0.15rem 0.4rem;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* User Dropdown */
.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 220px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.user-dropdown-header {
  padding: 1rem;
  background: linear-gradient(135deg, #f7f9fc 0%, #eef2f7 100%);
  border-bottom: 1px solid #e0e0e0;
}

.user-dropdown-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: #2a4d8f;
  margin-bottom: 0.25rem;
}

.user-dropdown-email {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.25rem;
}

.user-dropdown-role {
  font-size: 0.75rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-dropdown-divider {
  height: 1px;
  background: #e0e0e0;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: #333;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.user-dropdown-item:hover {
  background: #f7f9fc;
}

.user-dropdown-item span {
  font-size: 1rem;
}

/* Responsive */
@media (max-width: 1200px) {
  .nav-label {
    display: none;
  }
  
  .nav-link {
    padding: 0.5rem;
  }
}

@media (max-width: 950px) {
  .header-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }
  
  .header-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .printer-select-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .printer-select-header select {
    width: 100%;
  }
  
  .user-name {
    max-width: none;
  }
}

@media (max-width: 600px) {
  .brand-text {
    font-size: 0.9rem;
  }
  
  .nav-icon {
    font-size: 1.3rem;
  }
}
