/* src/frontend/static/css/header.css */

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  background: var(--panel);
  flex-wrap: wrap;
  border-radius: 12px;
}

.header-left,
.header-center,
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* nav links (Изображения / Видео) */
.top-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-weight: 600;
}

.top-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 12px;
}

.top-nav a.active {
  background: var(--border-weak);
  color: var(--muted);
}

/* login button */
.btn-login {
  background: var(--accent);
  color: #111111;
  border: 1px solid rgba(214, 255, 63, 0.18);
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* .brand */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 20px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  display: inline-block;
}

.brand-title {
  color: var(--text);
  line-height: 1;
  font-weight: 700;
  font-size: 20px;
}

.search-icon {
  width: 18px;
  height: 18px;
  opacity: 0.85;
  display: inline-block;
  flex: 0 0 auto;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  object-fit: cover;
  border: 2px solid rgba(255, 255, 255, 0.15);
  transition: transform .12s ease, box-shadow .12s ease;
}

#authArea {
  display: flex;
  align-items: center;
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.theme-toggle-btn {
  width: 30px;
  height: 30px;
  border: none;
  border-radius: 100%;
  cursor: pointer;
  margin-left: 7px;
  background: #bdbdbd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: background .12s ease;
}

.theme-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.03);
}


/* LEFT RAIL WRAP - фон + кнопки снизу */
.left-rail-wrap {
  display: none;
  /* hidden by default, shown for authorized users in JS */
  position: fixed;
  left: 25px;
  bottom: 24px;
  /* top: 150px; */
  z-index: 17000;
  align-items: flex-end;
  pointer-events: auto;
}

.left-rail-bg {
  background: var(--panel);
  border-radius: 12px;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 14px;
  overflow: hidden;
  transition: height 0.3s ease;
}

.left-rail-bg.rail-3-icons {
  height: calc(100% - 64%);
}

.left-rail-bg.rail-4-icons {
  height: calc(100% - 50%);
}

/* уменьшенный rail-inner: это контейнер кнопок */
.left-rail-bg .rail-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: flex-end;
}

/* кнопки */
.rail-btn {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: transparent;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #cfcfcf;
  cursor: pointer;
  position: relative;
  transition: transform .12s ease, background .12s ease, color .12s ease;
}

.rail-btn:hover,
.rail-btn.active {
  transform: translateY(-3px);
  background: rgba(80, 30, 160, 0.95);
  color: #fff;
}

/* tooltip справа */
.rail-btn::after {
  content: attr(data-title);
  position: absolute;
  left: 82px;
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: rgba(20, 20, 20, 0.95);
  color: #ddd;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .12s ease, transform .12s ease;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

.rail-btn:hover::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* LEFT SLIDING PANEL REMOVED */

/* если нужно — изменение позиции на мобильных */
@media (max-width: 900px) {
  .left-rail-wrap {
    left: 8px;
    bottom: 12px;
    top: auto;
  }
}

/* Sub-navigation block under header */
.sub-nav {
  display: flex;
  gap: 30px;
  padding: 0 20px;
  margin: 20px 0 15px 0px;
}

.sub-nav-item {
  color: var(--muted);
  text-decoration: none;
  font-size: 17px;
  font-weight: 400;
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s ease;
  cursor: pointer;
}

.sub-nav-item:hover {
  color: var(--text);
}

.sub-nav-item.active {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Header Copy button Icon */
.btn-copy-header {
  background: var(--border-weak);
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.1s ease;
  min-width: 32px;
  min-height: 32px;
}

.btn-copy-header:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.05);
}

.btn-copy-header:active {
  transform: scale(0.95);
}

.btn-copy-header img {
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

.btn-copy-header:hover img {
  opacity: 1;
}