/* --- Header Top Bar --- */
header {
  background-color: #1c3faa;
  color: white;
  font-family: 'Inter', sans-serif;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 0 20px;
  direction: ltr; /* حل انعكاس الهيدر */
}

/* Top Bar Container */
.top-bar.container {
  display: flex;
  justify-content: space-between; /* الشعار على اليسار، باقي العناصر على اليمين */
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

/* Site Name */
.site-name {
  font-size: 22px;
  font-weight: 700;
}

.site-name a {
  text-decoration: none;
  color: white;
}

/* Navigation Links */
nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s;
}

nav a:hover {
  color: #ffcc00;
}

/* Header Actions Buttons */
.header-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.notification-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.header-actions button {
  background: none;
  border: none;
  color: white;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background 0.3s;
}

.header-actions button:hover {
  background: rgba(255, 255, 255, 0.15);
}

.header-actions button i {
  font-size: 18px;
}

/* Notification Badge */
.notification-badge {
  background: #ffcc00;
  color: #1c3faa;
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 50%;
  position: absolute;
  top: -6px;
  right: -6px;
  font-weight: bold;
}

.notification-menu {
  position: absolute;
  top: 46px;
  right: 0;
  width: 320px;
  background: #ffffff;
  color: #1f2937;
  border-radius: 12px;
  box-shadow: 0 16px 30px rgba(0,0,0,0.18);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1200;
}

.notification-menu.active {
  display: flex;
}

.notification-title {
  padding: 12px 16px;
  font-weight: 700;
  border-bottom: 1px solid #e5e7eb;
}

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

.notification-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 16px;
  text-decoration: none;
  color: inherit;
  border-right: 4px solid transparent;
  transition: background 0.2s ease;
}

.notification-item:hover {
  background: #f3f4f6;
}

.notification-item.unread {
  background: #eef2ff;
  border-right-color: #1c3faa;
}

.notification-item .notification-message {
  font-size: 14px;
  line-height: 1.6;
}

.notification-item .notification-time {
  font-size: 12px;
  color: #6b7280;
}

.notification-empty {
  padding: 16px;
  text-align: center;
  color: #6b7280;
  font-size: 14px;
}

.notification-footer {
  padding: 10px 16px;
  text-align: center;
  font-weight: 600;
  color: #1c3faa;
  text-decoration: none;
  border-top: 1px solid #e5e7eb;
}

/* Login Button */
#login-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background-color: #ffcc00;
  color: #1c3faa;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.3s;
}

#login-link:hover {
  background-color: #e6b800;
}

/* User Info */
.user-info-container {
  display: none;
  align-items: center;
  gap: 10px;
  position: relative;
  cursor: pointer;
}

.user-info-container.active {
  display: flex;
}

.user-info-container img.user-pic {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #ffcc00;
  object-fit: cover;
}

.user-info-container .user-name {
  font-weight: 600;
}

.user-info-container .dropdown-menu {
  display: none;
  position: absolute;
  top: 50px;
  right: 0;
  background: white;
  color: #333;
  border-radius: 8px;
  overflow: hidden;
  min-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
}

.user-info-container.active .dropdown-menu {
  display: block;
}

.user-info-container .dropdown-menu a {
  display: block;
  padding: 10px 15px;
  text-decoration: none;
  color: #333;
  font-weight: 600;
  transition: background 0.3s;
}

.user-info-container .dropdown-menu a:hover {
  background-color: #f0f0f0;
}

/* Search Bar */
.search-bar {
  display: flex;
  align-items: center;
  gap: 5px;
}

.search-bar input {
  width: 200px;
  padding: 6px 10px;
  border-radius: 6px 0 0 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.search-bar button {
  background-color: #ffcc00;
  border: none;
  color: #1c3faa;
  padding: 6px 10px;
  font-weight: 700;
  border-radius: 0 6px 6px 0;
  cursor: pointer;
}

/* Responsive */
@media(max-width:800px){
  .top-bar.container {
    flex-direction: column;
    align-items: flex-end;
  }
  nav {
    margin-top: 10px;
    flex-wrap: wrap;
  }
  .header-actions {
    margin-top: 10px;
    flex-wrap: wrap;
  }
  .search-bar {
    width: 100%;
    margin-bottom: 10px;
  }
  .search-bar input, .search-bar button {
    width: 100%;
  }
}
