/* Header Navigation Styles */

/* Header Layout */
.header-left {
  flex: 0 0 auto;
  min-width: 0;
}


.header-right {
  flex: 0 0 auto;
  min-width: 0;
}


/* Специальные отступы для разных элементов */
.header-categories {
  margin-left: 20px;
}

.header-nav-menu {
  margin-left: 20px;
}

/* Header Categories */
.header-categories {
  display: flex;
  align-items: center;
}

.header-categories .king-cat {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.header-categories .king-cat a {
  font-size: 12px;
  padding: 4px 8px;
  background-color: #f6f7f9;
  color: #646373;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.header-categories .king-cat a:hover {
  background-color: #635bff;
  color: white;
}

/* Header Navigation Menu */
.header-nav-menu {
  display: flex;
  align-items: center;
}

.header-nav-menu ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 10px;
}

.header-nav-menu li {
  display: block;
}

.header-nav-menu a {
  font-size: 14px;
  padding: 8px 16px;
  color: #646373;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.header-nav-menu a:hover {
  color: #0c0b0d;
  background-color: #f6f7f9;
}


/* User Avatar in Header */
.user-avatar {
  position: relative;
  display: flex;
  align-items: center;
  height: 60px;
}

.user-avatar .king-havatar {
  background: #f1f3f5;
  width: 40px;
  height: 40px;
  cursor: pointer;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #000;
}

.user-avatar .king-havatar img {
  object-fit: cover;
  width: 40px;
  height: 40px;
}

/* Dropdown Menu Positioning */
.user-avatar {
  position: relative;
}

.user-avatar .king-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 200px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(-5px);
  transition: all 0.2s ease;
  margin-top: 8px;
}

.user-avatar .king-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.user-avatar .king-dropdown h3 {
  margin: 12px 16px 4px;
  color: #353535;
  font-size: 18px;
  line-height: 22px;
}

.user-avatar .user-box-point {
  margin: 0 16px 12px;
  color: #646373;
  font-size: 14px;
}

.user-avatar .king-dropdown ul {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.user-avatar .king-dropdown li a {
  display: block;
  padding: 0px 16px;
  color: #1d1d1f;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s ease;
}

.user-avatar .king-dropdown li a:hover {
  background-color: #f6f7f9;
}

/* Admin в выпадающем меню пользователя */
.user-admin-link {
  margin: 8px 0;
  padding: 8px 0;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.user-admin-link .admin-link {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  color: #646373;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  border-radius: 6px;
}

.user-admin-link .admin-link:hover,
.user-admin-link .admin-selected {
  color: #635bff;
  background-color: #f0f0ff;
}

.user-admin-link .admin-link i {
  margin-right: 8px;
  font-size: 14px;
}

/* Login Button in Header */
.login-button {
  position: relative;
  margin-left: 9px;
  display: flex;
  align-items: center;
  height: 60px;
}

.login-button .open-login-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  height: 40px;
  line-height: 40px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 14px;
  transition: all 0.2s ease;
  min-width: 100px;
}

.login-button .open-login-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.login-button .open-login-button i {
  font-size: 16px;
}

/* Search Button in Header */
.search-button {
  display: flex;
  align-items: center;
  height: 60px;
}

.search-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background-color: #f6f7f9;
  color: #0c0b0d;
  text-decoration: none;
  transition: all 0.2s ease;
}

.search-toggle:hover {
  border-color: #635bff;
  color: #635bff;
  background-color: #f0f0ff;
}

/* AI Limits in Header */
.user-avatar .ailimit {
  margin: 12px 16px;
  padding: 12px;
  background: #f6f7f9;
  border-radius: 6px;
}

.user-avatar .ailimit h5 {
  margin: 0 0 8px;
  font-size: 12px;
  color: #646373;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-avatar .ailimit h4 {
  margin: 0 0 8px;
  font-size: 16px;
  color: #0c0b0d;
}

.user-avatar .ailimits {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  overflow: hidden;
}

.user-avatar .ailimits span {
  display: block;
  height: 100%;
  background: #635bff;
  transition: width 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-left,
  .header-right {
    flex: none;
  }
  
  .header-left {
    order: 1;
  }
  
  .header-right {
    order: 3;
  }
  
  /* Убираем отступы на мобильных */
  .header-categories,
  .header-nav-menu {
    margin-left: 0;
  }
  
}

@media (max-width: 480px) {
  .header-nav-main .king-nav-main-list {
    flex-direction: column;
    width: 100%;
  }
  
  .header-nav-main .king-nav-main-link {
    text-align: center;
  }
}
