/* Header Bar Navigation Styles */

.header-bar {
  background-color: #fff;
  padding: 0.8rem 0;
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 auto;
  padding: 0 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--primary-color);
  margin-right: 1rem;
}

.header-logo h1 {
  margin: 0;
  font-size: 1.4rem;
  white-space: nowrap;
}

.header-logo .subtitle {
  display: none; /* Hide on mobile */
  font-size: 0.8rem;
  opacity: 0.8;
  margin: 0;
}

/* Mobile toggle button */
.nav-toggle {
  background-color: rgba(255, 255, 255, 0.1);
  color: #333;
  border: none;
  padding: 0.5rem;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.nav-toggle:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.nav-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.5);
}

.nav-toggle-icon {
  transition: transform 0.3s;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  transform: rotate(180deg);
}

/* Navigation in header */
.nav-buttons {
  display: none; /* Hidden by default on mobile */
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
}

.nav-buttons.expanded {
  display: flex; /* Show when expanded */
}

.nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  text-decoration: none;
  color: #333;
  font-weight: 500;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex: 1;
  min-width: 100px;
  text-align: center;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -2px;
    left: 0;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s;
}

.nav-link:hover::after {
    transform: scaleX(1);
} 
.nav-link:hover {
  color: var(--primary-color);
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.nav-link.active::after {
    transform: scaleX(1);
}
.nav-link.active {
  color: var(--primary-color);
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.nav-link i {
  font-size: 0.9em;
}

/* User role indicator in header */
.user-role {
  font-size: 0.8rem;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Container for the main content area below header */
.main-content {
  padding-top: 1.5rem;
  padding-bottom: 9.5rem;
}

/* Role-specific styles */
.role-systemowner {
  background-color: rgba(190, 10, 60, 0.9);
  color: white;
}

.role-owner {
  background-color: rgba(110, 30, 165, 0.9);
  color: white;
}

.role-admin {
  background-color: rgba(185, 90, 0, 0.9);
  color: white;
}

.role-contributor {
  background-color: rgba(13, 100, 190, 0.9);
  color: white;
}

.role-viewer {
  background-color: rgba(22, 115, 75, 0.9);
  color: white;
}

.role-public {
  background-color: rgba(90, 90, 90, 0.9);
  color: white;
}

/* Mobile styles */
@media (max-width: 768px) {

/* Container for the main content area below header */
  .main-content {
    padding-top: 2rem;
    /* padding-bottom: 10rem; */
  	padding-bottom: 9.5rem;
  }

  .header-container {
    padding: 0.5rem 1rem;
  }
  
  .nav-buttons {
    margin-top: 0.5rem;
    flex-direction: column; /* Stack vertically on mobile */
  }
  
  .nav-link {
    font-size: 0.9rem;
    padding: 0.7rem 1rem;
    border-radius: 0;
    margin: 0 -1rem; /* Extend full width */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .nav-link:last-child {
    border-bottom: none;
  }
  
  .nav-link:hover {
    transform: none; /* No hover animation on mobile */
    background-color: rgba(255, 255, 255, 0.15);
  }
}

/* Desktop enhancements */
@media (min-width: 769px) {
  .header-logo .subtitle {
    display: inline; /* Show on desktop */
  }
  
  .nav-toggle {
    display: none; /* Hide toggle on desktop */
  }
  
  .nav-buttons {
    display: flex; /* Always show on desktop */
    justify-content: center;
    margin: 0 auto;
  }
  
  .nav-link {
    padding: 0.6rem 1.2rem;
    flex: initial; /* Don't stretch links on desktop */
  }
}

/* ─── Gallery Nav Dropdown ───────────────────────────────────────────────────── */
.nav-dropdown {
  position: relative;
  display: flex;
  align-items: stretch;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-dropdown-caret {
  font-size: 0.65rem;
  opacity: 0.65;
  transition: transform 0.2s;
}

.nav-dropdown:hover .nav-dropdown-caret,
.nav-dropdown.open .nav-dropdown-caret {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  min-width: 230px;
  background: var(--bg-surface, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  z-index: 1001;
  display: none;
  list-style: none;
  margin: 0;
  padding: 0.35rem 0;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu {
  display: block;
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.5rem 1rem;
  color: var(--text-primary, #333);
  text-decoration: none;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: background 0.12s;
}

.nav-dropdown-item:hover {
  background: var(--bg-hover, #f3f4f6);
  color: var(--primary-color, #4361ee);
}

.nav-dropdown-footer {
  border-top: 1px solid var(--border-color, #e5e7eb);
  margin-top: 0.25rem;
  padding-top: 0.45rem;
  color: var(--text-secondary, #888);
  font-size: 0.85rem;
}

.nav-dropdown-empty,
.nav-dropdown-placeholder {
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary, #888);
}

/* Mobile: dropdown as inline list (no absolute positioning) */
@media (max-width: 768px) {
  .nav-dropdown {
    flex-direction: column;
    align-items: stretch;
  }
  .nav-dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--primary-color, #4361ee);
    border-radius: 0;
    margin-left: 1rem;
    padding: 0;
    background: transparent;
  }
  .nav-dropdown:hover .nav-dropdown-menu {
    display: none; /* hover doesn't work on mobile — use .open class */
  }
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
  .nav-dropdown-item {
    font-size: 0.88rem;
    padding: 0.45rem 0.75rem;
  }
}

/* ─── Auth-gated nav items ───────────────────────────────────────────────────
   Hidden by default. Shown when .authorized class is added (user logged in). */
[data-auth-required] {
  display: none !important;
}

[data-auth-required].authorized {
  display: flex !important;
}

/* Links with auth gate use inline/block instead of flex */
a[data-auth-required].authorized {
  display: inline-flex !important;
}

