/* копия из news_bot/static/css/components/navigation.css */
/* navigation.css - стили хедера и навигации */
.header {
  border-bottom: 1px solid #eee;
  padding: 10px 26px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden;
  min-height: 90px;
  position: relative;   
  z-index: 10;         
  background: #fff;    
  flex: 0 0 auto;       
}
.header .nav-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-link {
  text-decoration: none;
  color: #333;
  font-weight: 600;
}
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;       
  max-width: 100%;
  overflow-x: hidden; 
  justify-content: flex-end;
  font-size: 12px;  
}
/* Кнопка Инструкция в навигации */
.btn-instruction {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #56ab2f;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(86, 171, 47, 0.3);
}
.btn-instruction:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(86, 171, 47, 0.4);
}
.btn-instruction:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(86, 171, 47, 0.3);
}

/* Стили для кнопки Техподдержка */
.btn-support {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
  text-decoration: none;
}
.btn-support:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.4);
  color: white;
}
.btn-support:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}
.nav-settings {
  text-decoration: none;
  color: #333;
  display: inline-flex;
  align-items: center;
  /* eliminate extra line box that can cause vertical jiggle */
  line-height: 0;
}
.user-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 4px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.user-name {
    font-size: 12px;
    color: #555;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-align: center;
}

.user-label:hover .user-avatar {
    transform: scale(1.1);
}

.logout-form { 
    margin: 0; 
}

.btn-logout {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, transform 0.2s ease;
}

.btn-logout:hover {
    color: #ffffff;
    transform: scale(1.1);
}

.btn-logout svg {
    fill: currentColor;
}

/* Единый синий стиль для кнопок "Сохраненные" */
.btn-saved {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #2b6cb0;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(43, 108, 176, 0.3);
  text-decoration: none;
}
.btn-saved:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(43, 108, 176, 0.4);
}
.btn-saved:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(43, 108, 176, 0.3);
}

/* Кнопка выхода в навигации */
.btn-logout {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-logout:hover {
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.25);
  transform: translateY(-1px);
}
.btn-logout:active {
  transform: translateY(0);
}

/* Кнопки входа и регистрации в навигации */
.btn-auth {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #667eea;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}
.btn-auth:hover {
  box-shadow: 0 6px 12px rgba(102, 126, 234, 0.25);
  transform: translateY(-1px);
}
.btn-auth:active {
  transform: translateY(0);
}
 /* Keep settings icon, user label and logout together */
 .header .user-info {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 6px 22px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(8px) saturate(180%);
  transition: all 0.3s ease;
}

.header .user-info:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.98);
}

.header .user-info .user-label {
  font-weight: 500;
  color: #333;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 0;
}

/* Анимация для иконки настроек при наведении */
.header .user-info:hover .nav-settings svg {
  transform: rotate(90deg);
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .header .user-info {
    padding: 24px 18px;
    gap: 8px;
    border-radius: 12px;
  }
  
  .header .user-info .user-label {
    max-width: 150px;
    font-size: 13px;
  }
}

/* Улучшенная доступность для фокуса */
.header .user-info .nav-settings:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
  border-radius: 8px;
}
.btn-auth,
.btn-saved,
.btn-instruction {
  white-space: normal; /* allow label to wrap */
}
/* Responsive fixes to avoid overflow */
@media (max-width: 768px) {
  .header {
    flex-wrap: wrap;
    gap: 8px;
  }
  .header .nav-left {
    min-width: 0;
  }
  .header .nav-actions {
    justify-content: center;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .btn-auth,
  .btn-saved,
  .btn-instruction {
    padding-left: 12px;
    padding-right: 12px; /* slightly reduce horizontal padding on very small screens */
  }
}

#authBox .btn-auth,
#authBox .btn-saved,
#authBox .btn-instruction,
#authBox .btn-logout,
#authBox .btn-support {
    height: 40px; /* Установите одинаковую высоту */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px; /* Добавьте отступы для текста */
    box-sizing: border-box; /* Учитывайте отступы в общей высоте */
}