/* Стили для шапки */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: #313a47;
  color: white;
  display: flex;
  align-items: center;
  z-index: 1000;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* Гарантирует вертикальное центрирование */
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
  position: relative;
}

.header img {
  height: 30px;
  background-color: transparent;
}

/* Навигация */
.header .nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.header .nav a {
  color: white;
  text-decoration: none;
  font-size: 18px;
  transition: color 0.3s ease;
}

.header .nav a:hover {
  color: #ff6347;
}

#user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

#user-photo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
}

.logout-button {
  background-color: #26243a;
  color: #ffffff;
  border: 1px solid #3f0505;
  padding: 6px 12px;
  font-size: 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.logout-button:hover {
  background-color: #7c5fe2;
  color: #1fa896;
  border-color: #6330da;
}

/* Языковое меню */
.lang-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.lang-btn {
  background: none;
  color: white;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 5px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: background-color 0.3s ease;
}

.lang-btn:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.lang-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background-color: rgba(49, 58, 71, 0.85);
  min-width: 30px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  border-radius: 6px;
  z-index: 1001;
  padding: 8px;
}


.lang-dropdown:hover .lang-menu {
  display: block;
}

.lang-menu a {
  display: block;
  padding: 6px 12px;
  color: white;
  text-decoration: none;
  font-size: 16px;
  border-radius: 4px;
  text-align: center;
  transition: background-color 0.3s ease;
}

.lang-menu a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Мобильное меню */
.menu-toggle {
  display: none;
  font-size: 24px;
  color: white;
  cursor: pointer;
  padding: 5px;
}

/* Медиа-запросы для мобильных устройств */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .header .nav {
    display: none;
    flex-direction: column;
    align-items: center;
    width: 100%;
    background-color: rgba(49, 58, 71, 0.8);
    position: absolute;
    top: 50px;
    left: 0;
    gap: 0;
    padding: 5px 0;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }

  .header .nav.active {
    display: flex;
  }

  .header .nav a {
    font-size: 16px;
    padding: 8px;
    width: 100%;
    margin: 2px 0;
    text-align: center;
  }

  #user-info {
    flex-direction: column;
    width: 100%;
    padding: 10px 0;
    align-items: center;
  }

  #user-photo {
    margin-bottom: 8px;
  }

  .logout-button {
    width: 120px;
    text-align: center;
  }

  .lang-dropdown {
    margin-left: 3px;
  }

  .lang-btn {
    padding: 8px;
    margin: 0 auto;
  }

  .lang-menu {
    right: 0;
    left: auto;
    transform: none;
    min-width: 40px;
    top: 30px;
  }

  .header h1 {
    font-size: 20px;
    top: 10px;
  }

  .header .subtitle {
    font-size: 14px;
    bottom: 8px;
  }

  .header .container {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
  }

  .header-left,
  .header-right {
    flex: 0 0 auto;
  }

  .header-center {
    display: none;
  }

  .header-left {
    justify-content: flex-start;
  }

  .header-right {
    justify-content: flex-end;
  }

}

/* Три зоны */
.header-left,
.header-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.header-center h1 {
  font-size: 30px;
  margin: 0 0 2px 0;
  /* уменьшен отступ снизу */
  font-weight: normal;
}

.header-center .subtitle {
  font-size: 16px;
  margin: 0;
  color: #ffffff;
}

.header-left img {
  height: 30px;
}

/* На больших экранах растягиваем */
@media (min-width: 1600px) {
  .header .container {
    max-width: none;
    padding: 0 40px;
  }
}
