.header {
  width: 100%;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Arial', sans-serif;
  padding: 15px 20px;
  position: relative;
}

.header__navbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  max-width: 80%;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.header__logo-container {
  display: flex;
  align-items: center;
}

.header__logo {
  font-size: 2rem;
  font-weight: bold;
  text-transform: uppercase;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
}

.header__logo-web {
  color: var(--primary-color);
}

.header__logo-hacker {
  color: var(--tertiary-color);
}

.header__toggle {
  background: none;
  border: none;
  cursor: pointer;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  height: 20px;
  width: 30px;
  z-index: 9999;
  position: relative;
}

.header__toggle-bar {
  width: 100%;
  height: 4px;
  background-color: var(--primary-color);
  transition: 0.3s ease;
  position: absolute;
}

.header__toggle-bar:nth-child(1) {
  top: 0;
}

.header__toggle-bar:nth-child(2) {
  top: 8px;
}

.header__toggle-bar:nth-child(3) {
  bottom: 0;
}

.header__toggle.active .header__toggle-bar:nth-child(1) {
  transform: rotate(-45deg);
  top: 8px;
}

.header__toggle.active .header__toggle-bar:nth-child(2) {
  opacity: 0;
}

.header__toggle.active .header__toggle-bar:nth-child(3) {
  transform: rotate(45deg);
  bottom: 8px;
}

.header__menu {
  display: flex;
  justify-content: flex-end;
  flex-grow: 1;
}

.header__nav {
  list-style: none;
  display: flex;
  padding: 0;
  align-items: baseline;
}

.header__nav-item {
  margin: 0 20px;
}

.header__nav-link {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  font-size: 1rem;
  padding: 8px 15px;
  border-radius: 5px;
  transition: all 0.3s ease;
  align-items: baseline;
}

.header__nav-link:hover {
  color: var(--white-color);
  background-color: var(--primary-color);
  transform: translateY(-2px);
}

.header__nav-item--dropdown {
  position: relative;
}

.header__nav-link--dropdown-toggle {
  cursor: pointer;
}

.header__dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--background-color);
  border: 1px solid var(--border-color);
  width: auto;
  min-width: 180px;
  list-style: none;
  margin: 0;
  padding: 10px 0;
  z-index: 10;
  border-radius: 5px;
  box-sizing: border-box;
}

.header__nav-item--dropdown:hover .header__dropdown-menu {
  display: block;
}

.header__dropdown-item {
  text-decoration: none;
  color: var(--text-color);
  padding: 8px 15px;
  display: block;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.header__dropdown-item:hover {
  background-color: var(--primary-color);
  color: var(--white-color);
}

.header__nav-link {
  display: flex;
  align-items: baseline;
}

.header__dropdown-indicator {
  font-size: 1rem;
  margin-left: 8px;
  color: var(--primary-color);
}

.header__nav-link:hover .header__dropdown-indicator {
  color: var(--white-color);
}

.header__user-name {
  display: inline-block;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
}

.header__nav-item--icons {
  margin-left: 15px;
  margin: 0;

}

.search-modal.active + .header__nav-item--icons .header__search-icon {
  transform: scale(1.2);
}

.header__nav-item-group {
  display: flex;
  gap: 5px;
}

.header__notification-icon,
.header__search-icon {
  font-size: 1rem;
  color: var(--text-color);
  transition: transform 0.3s ease, color 0.3s ease;
}

.search-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(15px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s ease 0.3s;
}

.search-modal.active {
  display: flex;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.3s ease;
  z-index: 10000;
}

.search-modal-content {
  padding: 15px;
  width: 50%;
  display: flex;
  justify-content: center;
  animation: scaleIn 0.3s ease-out;
}

.search-modal input {
  width: 100%;
  padding: 15px;
  font-size: 1.5rem;
  border: none;
  border-radius: 50px;
  background-color: rgba(255, 255, 255, 0.8);
  color: rgb(36, 36, 36);
  transition: background-color 0.3s ease;
  outline: none;
  box-sizing: border-box;
}

.search-modal input:focus {
  background-color: rgba(255, 255, 255, 0.5);
}

@keyframes scaleIn {
  0% {
      transform: scale(0.5);
      opacity: 0;
  }
  100% {
      transform: scale(1);
      opacity: 1;
  }
}

.header__notification-icon {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background-color: var(--red-color);
  color: var(--white-color);
  border-radius: 50%;
  font-size: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: bold;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.header__notification-icon.new-notifications .notification-badge {
  opacity: 1;
  transform: scale(1.2);
  animation: pulse 1.2s infinite ease-in-out;
}

@keyframes pulse {
  0% {
      transform: scale(1);
      opacity: 1;
  }
  50% {
      transform: scale(1.3);
      opacity: 0.9;
  }
  100% {
      transform: scale(1);
      opacity: 1;
  }
}

.header__notification-icon.new-notifications .notification-badge {
  animation: fadeIn 0.6s ease-out, pulse 1.2s infinite ease-in-out;
}

@keyframes fadeIn {
  0% {
      opacity: 0;
      transform: scale(0.8);
  }
  100% {
      opacity: 1;
      transform: scale(1.2);
  }
}

.notification-badge.new {
  animation: notification-pop 0.3s ease;
}

.header__notification-popover {
  position: absolute;
  top: 40px;
  right: 0;
  width: 280px;
  background-color: var(--white-color);
  color: var(--text-color);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  padding: 12px;
  max-height: 300px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.header__notification-popover.show {
  opacity: 1;
  pointer-events: auto;
}

.header__notification-popover p {
  margin: 0;
  padding: 10px 0;
  font-size: 0.9rem;
  line-height: 1.4;
  border-bottom: 1px solid #f0f0f0;
}

.header__notification-popover p:last-child {
  border-bottom: none;
}

.header__notification-popover p:hover {
  background-color: #fdfdfd;
  cursor: pointer;
}

.header__notification-popover p .notification-icon {
  margin-right: 8px;
  font-size: 1.1rem;
  color: var(--primary-color);
}

@media (max-width: 768px) {
  .notification-badge {
    font-size: 10px;
    width: 18px;
    height: 18px;
  }

  .header__notification-popover {
    min-width: 200px;
    max-width: 85vw;
    top: calc(100% + 5px);
  }
  
  .header__navbar {
      max-width: 100%;
  }

  .header__toggle {
      display: flex;
  }

  .header__menu {
      position: absolute;
      top: 50px;
      right: 0;
      width: 100%;
      background-color: var(--background-color);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      display: none;
      flex-direction: column;
      padding-top: 20px;
      z-index: 9999;
      border-radius: 10px;
      transform: translateX(100%);
      transition: transform 0.3s ease;
  }

  .header__menu.active {
      display: flex;
      transform: translateX(0);
  }

  .header__nav {
      flex-direction: column;
      padding: 0;
      width: 100%;
  }

  .header__nav-item {
      margin: 10px 0;
  }

  .header__nav-link {
      font-size: 1.2rem;
      padding: 12px 20px;
      text-align: center;
  }

  .header__logo {
      font-size: 1.8rem;
  }

  .header__dropdown-menu {
      width: 100%;
  }
}

.header__badge {
  background-color: #6C5CE7;
  color: var(--white-color);
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 10px;
  margin-left: 10px;
  line-height: 1;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-wrapper input {
  width: 100%;
  padding-right: 96px;
  padding-left: 20px;
}

.search-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  font-size: 1rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.search-btn--close {
  right: 52px;
  background: transparent;
  color: #aaa;
}

.search-btn--close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #666;
}

.search-btn--submit {
  right: 8px;
  background: #6C5CE7;
  color: var(--white-color);
}

.search-btn--submit:hover {
  background: #5b4ad4;
  transform: translateY(-50%) scale(1.05);
}

.search-btn--submit:active {
  transform: translateY(-50%) scale(0.95);
}

.badge-upcoming {
  display: inline-block;
  background: #fea530;
  color: var(--white-color);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}