/* Make the header sticky */
header {
  position: sticky;
  top: 0;
  z-index: 1030;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: #ffffff;
  padding: 0 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.topnav a {
  color: rgba(33, 37, 41, 0.9);
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;
  font-size: 17px;
  transition: all 0.3s ease;
  border-radius: 10px;
}

.topnav a:hover {
  background-color: rgba(43, 160, 132, 0.10);
  color: #1F7A63;
}

.topnav a.active {
  background: linear-gradient(135deg, rgba(67, 209, 175, 0.18), rgba(43, 160, 132, 0.10));
  color: #1F7A63;
  box-shadow: inset 0 0 0 1px rgba(31, 122, 99, 0.22);
}

/* User menu container on the right */
.topnav .user-menu {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* User greeting styling - clean and subtle */
.topnav .user-greeting {
  color: rgba(33, 37, 41, 0.85);
  padding: 10px 14px;
  font-size: 16px;
  font-weight: 400;
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
}

.topnav .user-greeting i {
  font-size: 1.1em;
  opacity: 0.9;
}

.topnav .user-menu-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(31, 122, 99, 0.25);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

/* Profile button special styling - matches logout */
.topnav a.profile-btn {
  background-color: rgba(43, 160, 132, 0.10);
  border-radius: 6px;
  border: 1px solid rgba(31, 122, 99, 0.18);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.topnav a.profile-btn .nav-link-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.topnav .notification-badge,
.nav-notifications .notification-badge {
  background-color: #ff6b35;
  color: #ffffff;
  border-radius: 999px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(31, 122, 99, 0.14);
}

.nav-notifications {
  position: relative;
}

.nav-notifications .notification-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(31, 122, 99, 0.18);
  border-radius: 50px;
  background: rgba(43, 160, 132, 0.10);
  color: rgba(33, 37, 41, 0.9);
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-notifications .notification-toggle:hover,
.nav-notifications .notification-toggle:focus {
  background: rgba(43, 160, 132, 0.16);
  color: rgba(33, 37, 41, 0.95);
  outline: none;
}

.nav-notifications .notification-toggle i {
  font-size: 1.2rem;
}

.notification-dropdown {
  width: min(360px, 90vw);
  padding: 0;
  border: none;
  border-radius: 12px;
  overflow: hidden;
}

.notification-dropdown-header {
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(67, 209, 175, 0.15), rgba(67, 209, 175, 0.05));
}

.notification-dropdown-header button {
  color: #ff6b35;
  font-weight: 600;
  text-decoration: none;
}

.notification-dropdown-header button:disabled {
  color: rgba(0, 0, 0, 0.35);
  cursor: default;
}

.notification-dropdown-body {
  max-height: 320px;
  overflow-y: auto;
  padding: 8px 0;
}

.notification-dropdown-item {
  padding: 10px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  padding-right: 44px;
}

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

.notification-dismiss-btn {
  position: absolute;
  top: 8px;
  right: 10px;
  border: none;
  background: transparent;
  color: #dc3545;
  padding: 0.15rem;
  line-height: 1;
  border-radius: 999px;
  opacity: 0.75;
  transition: transform 0.2s ease, opacity 0.2s ease, color 0.2s ease;
}

.notification-dismiss-btn:hover,
.notification-dismiss-btn:focus {
  color: #bb2d3b;
  opacity: 1;
  transform: scale(1.08);
}

.notification-dismiss-btn:focus-visible {
  outline: 2px solid rgba(220, 53, 69, 0.35);
  outline-offset: 2px;
}

.notification-dismiss-btn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.notification-dropdown-item .notification-content {
  flex: 1;
  min-width: 0;
}

.notification-dropdown-item .notification-content strong {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.9rem;
  line-height: 1.35;
  margin-bottom: 2px;
}

.notification-dropdown-item .notification-meta {
  font-size: 0.75rem;
  color: rgba(0, 0, 0, 0.55);
}

/* Message notification badge styling */
.notification-dropdown-item .notification-actions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.notification-dropdown-item .notification-actions .btn-link {
  padding: 0;
  font-size: 0.8rem;
}

.notification-dropdown-footer {
  padding: 10px 16px;
  background: rgba(0, 0, 0, 0.03);
  display: flex;
  justify-content: flex-end;
}

.notification-dropdown-footer .btn-link {
  font-size: 0.85rem;
  color: #2E7D32;
  font-weight: 600;
  text-decoration: none;
}

.dropdown-placeholder {
  padding: 16px;
  text-align: center;
}

.notification-empty {
  padding: 32px 16px;
  text-align: center;
  color: rgba(0, 0, 0, 0.5);
}

.topnav a.profile-btn:hover {
  background-color: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.topnav a.profile-btn.active {
  background-color: #2E7D32;
  color: white;
  border-color: #2E7D32;
}

/* Profile Dropdown Styling */
.nav-profile-dropdown {
  position: relative;
}

.nav-profile-dropdown .profile-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 14px;
  border: 1px solid rgba(31, 122, 99, 0.18);
  border-radius: 6px;
  background: rgba(43, 160, 132, 0.10);
  color: rgba(33, 37, 41, 0.9);
  cursor: pointer;
  font-size: 17px;
  transition: all 0.3s ease;
}

.nav-profile-dropdown .profile-toggle:hover,
.nav-profile-dropdown .profile-toggle:focus {
  background-color: rgba(43, 160, 132, 0.16);
  color: rgba(33, 37, 41, 0.95);
  border-color: rgba(31, 122, 99, 0.26);
  outline: none;
}

.nav-profile-dropdown .profile-toggle.active {
  background: linear-gradient(135deg, rgba(67, 209, 175, 0.18), rgba(43, 160, 132, 0.10));
  color: #1F7A63;
  border-color: rgba(31, 122, 99, 0.22);
}

.nav-profile-dropdown .profile-toggle i.bi-chevron-down {
  font-size: 0.8em;
  transition: transform 0.2s ease;
}

.nav-profile-dropdown .profile-toggle[aria-expanded="true"] i.bi-chevron-down {
  transform: rotate(180deg);
}

.profile-dropdown-menu {
  min-width: 240px;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-top: 8px;
}

.profile-dropdown-menu .dropdown-item {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  font-size: 16px;
  color: #333;
  transition: all 0.2s ease;
}

.profile-dropdown-menu .dropdown-item:hover {
  background-color: #f8f9fa;
  color: #4CAF50;
}

.profile-dropdown-menu .dropdown-item.active {
  background-color: #e8f5e9;
  color: #2E7D32;
  font-weight: 500;
}

.profile-dropdown-menu .dropdown-item i {
  font-size: 1.1em;
  width: 20px;
}

/* Logout button special styling */
.topnav a.logout-btn {
  background-color: rgba(43, 160, 132, 0.10);
  border-radius: 6px;
  border: 1px solid rgba(31, 122, 99, 0.18);
}

.topnav a.logout-btn:hover {
  background-color: #ff6b6b;
  color: white;
  border-color: #ff6b6b;
}

/* Icons in nav links */
.topnav a i {
  margin-right: 4px;
}

/* helper to push a link (like Login) to the right */
.topnav a.right {
  margin-left: auto;
}

/* Make the right-aligned auth link read like a button in the neutral header */
.topnav a.right {
  background-color: rgba(43, 160, 132, 0.10);
  border: 1px solid rgba(31, 122, 99, 0.18);
  border-radius: 999px;
}

.topnav a.right:hover {
  background-color: rgba(43, 160, 132, 0.16);
  color: rgba(33, 37, 41, 0.95);
}

/* small page utility used by a few templates */
.page-intro {
  padding-left: 16px;
}
