/* /css/header.css */

/* Pasek na górze */
.top-accent{
  height:6px;
  background:linear-gradient(90deg,var(--orange-1),var(--orange-2));
}

/* Nagłówek i kontener */
.site-header{
  background:#fff;
  border-bottom:1px solid var(--border);
  position:sticky;
  top:0;
  z-index:1000;
}
.header-container{
  max-width:1200px;
  margin:0 auto;
  padding:0 16px 8px;
}

/* Logo + nawigacja */
.brand-and-nav{
  display:grid;
  grid-template-columns: var(--logo-slot) 1fr;
  align-items:flex-start;
  gap:12px;
  padding:6px 0 6px;
}
.brand-and-nav-main{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:4px;
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  width: var(--logo-slot);
}
.logo-link{
  display:inline-flex;
  align-items:center;
}
.logo-img{
  width:var(--logo-w);
  height:var(--logo-h);
  object-fit:contain;
  transition:transform .25s ease;
}
.logo-img:hover{
  transform:scale(1.03);
}

/* Górny rząd – pasek użytkownika / ikon po prawej */
.authbar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
}
.authbar_actions{
  display:flex;
  align-items:center;
  gap:8px;
}

/* Przyciski / linki w authbarze */
.authbar_greeting{
  cursor:default;
  font-weight:500;
  font-size:.85rem;
  white-space:nowrap;
  text-overflow:ellipsis;
  overflow:hidden;
  max-width:160px;
  cursor:pointer;
}
.authbar_muted{ color:#555; }
.authbar_strong{
  font-weight:500;
  font-size:.7rem;
}

/* Avatary / przycisk użytkownika */
.authbar_user{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:2px 10px 2px 2px;
  border-radius:999px;
  border:1px solid var(--border);
  background:linear-gradient(135deg,#ffffff,#fafafa);
  cursor:pointer;
  text-decoration:none;
  max-width:240px;
  box-shadow:var(--shadow-soft, 0 1px 3px rgba(15,23,42,.08));
  transition:
    box-shadow .18s ease,
    background-color .18s ease,
    border-color .18s ease,
    transform .12s ease,
    filter .18s ease;
}
.authbar_user:hover{
  background:linear-gradient(135deg,#ffffff,#f3f3f3);
  border-color:rgba(0,0,0,.06);
  box-shadow:var(--shadow,0 6px 18px rgba(15,23,42,.12));
  filter:brightness(1.01);
}
.authbar_user:active{
  transform:translateY(1px);
  box-shadow:var(--shadow-soft,0 1px 3px rgba(15,23,42,.12));
}

/* Avatar w przycisku */
.authbar_avatar{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:var(--avatar-size-auth);
  height:var(--avatar-size-auth);
  border-radius:50%;
  overflow:hidden;
  border:1px solid var(--border);
  background:#fff;
  box-shadow:var(--shadow);
  flex:0 0 auto;
}
.authbar_avatar img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  border-radius:50%;
}
.authbar_avatar_fallback{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  border-radius:50%;
  color:#fff;
  font-weight:700;
  font-size:.72rem;
  background:linear-gradient(135deg,var(--orange-1),var(--orange-2));
}

/* Ujednolicone przyciski ikonkowe w nagłówku */
.header-iconbtn,
.authbar_iconbtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:10px;
  border:1px solid var(--border);
  background:linear-gradient(135deg,#ffffff,#fafafa);
  color:#333;
  cursor:pointer;
  text-decoration:none;
  padding:0;
  transition:
    box-shadow .18s ease,
    background-color .18s ease,
    border-color .18s ease,
    transform .12s ease,
    filter .18s ease;
}
.header-iconbtn:hover,
.authbar_iconbtn:hover{
  background:linear-gradient(135deg,#ffffff,#f3f3f3);
  box-shadow:var(--shadow);
  border-color:rgba(0,0,0,.04);
  filter:brightness(1.02);
}
.header-iconbtn:active,
.authbar_iconbtn:active{
  transform:translateY(1px);
}

/* Dropdown użytkownika */
.authbar_menu-wrap{
  position:relative;
}
.authbar_menu-dropdown{
  position:absolute;
  right:0;
  top:calc(100% + 8px);
  min-width:200px;
  background:#fff;
  border:1px solid var(--border);
  border-radius:12px;
  box-shadow:var(--shadow);
  padding:6px;
  z-index:1100;
}
.authbar_menu-item{
  display:block;
  width:100%;
  text-align:left;
  padding:8px 10px;
  border-radius:8px;
  color:var(--text);
  text-decoration:none;
  background:#fff;
  border:0;
  cursor:pointer;
  font-size:.92rem;
}
.authbar_menu-item:hover{
  background:#f7f7f7;
}
.authbar_menu-item.danger{
  color:#b42318;
}
.authbar_menu-form{ margin:0; }

/* Złota literka A – panel admin/mod */
.authbar_admin-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:26px;
  height:26px;
  margin-left:2px;
  border-radius:10px;
  background:linear-gradient(135deg,#fbbf24,#f59e0b);
  color:#fff;
  font-weight:700;
  font-size:.85rem;
  text-decoration:none;
  border:1px solid rgba(0,0,0,.08);
  box-shadow:var(--shadow);
  cursor:pointer;
  transition:
    box-shadow .18s ease,
    transform .12s ease,
    filter .18s ease;
}
.authbar_admin-badge:hover{
  filter:brightness(1.05);
  box-shadow:0 10px 24px rgba(245,158,11,.45);
  transform:translateY(-1px);
}
.authbar_admin-badge:active{
  transform:translateY(0);
  box-shadow:var(--shadow);
}
.authbar_admin-letter{
  display:inline-block;
  line-height:1;
}

/* DOLNY RZĄD – nawigacja */
.nav-row{
  display:flex;
  align-items:center;
  justify-content:flex-start;
  margin-top:2px;
}
.nav-bar{
  justify-self:stretch;
  background:#fff;
  flex:1 1 auto;
}

/* Nawigacja główna */
.nav-toggle{
  display:none;
  background:transparent;
  border:none;
  font-size:1.25rem;
  cursor:pointer;
  line-height:1;
}
.nav-nowrap{
  overflow-x:auto;
  overflow-y:hidden;
  -webkit-overflow-scrolling:touch;
  scrollbar-width:thin;
}
.nav-nowrap::-webkit-scrollbar{ height:8px; }
.nav-nowrap::-webkit-scrollbar-thumb{
  background:#ddd;
  border-radius:8px;
}
.nav-nowrap:hover::-webkit-scrollbar-thumb{
  background:#ccc;
}
.nav-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  align-items:center;
  gap:var(--nav-gap);
  flex-wrap:nowrap;
  white-space:nowrap;
  width:100%;
  justify-content:space-between;
}
@media (min-width: 881px){
  .nav-list{ margin-top:5px; }
}

/* Linki w nawigacji */
.nav-link{
  display:inline-block;
  text-decoration:none;
  cursor:pointer;
  padding:var(--nav-pad-y) var(--nav-pad-x);
  border-radius:10px;
  position:relative;
  font-size:var(--nav-fs);
  line-height:1.2;
  color:transparent;
  font-weight:700;
  border:1px solid transparent;
  background-image:linear-gradient(90deg, var(--cream), var(--cream));
  background-size:200% 100%;
  background-position:0% center;
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
  transition: background-position .35s ease;
}
.nav-link::after{ display:none !important; }
.nav-link:hover,
.nav-link:focus{
  border-color:transparent !important;
  transition: background-position 1.1s ease;
  background-position:100% center;
}
.nav-list li:nth-child(1) > .nav-link:hover,
.nav-list li:nth-child(2) > .nav-link:hover,
.nav-list li:nth-child(3) > .nav-link:hover,
.nav-list li:nth-child(4) > .nav-link:hover{
  background-image:linear-gradient(90deg,#deb887,#e6a65a,var(--orange-1),var(--orange-2));
}
.nav-list li:nth-child(1) > .nav-link,
.nav-list li:nth-child(2) > .nav-link,
.nav-list li:nth-child(3) > .nav-link,
.nav-list li:nth-child(4) > .nav-link{
  background-image:linear-gradient(90deg, var(--cream), var(--cream));
}
.nav-link:hover{ box-shadow:none; }

/* Kontekst: strona główna vs podstrony */
.site-header.is-home{
  --logo-slot: var(--logo-slot-base);
  --logo-w:    var(--logo-w-base);
  --logo-h:    var(--logo-h-base);
}
.site-header.is-inner{
  --logo-slot: var(--logo-slot-base);
  --logo-w:    calc(var(--logo-w-base) * 0.8);
  --logo-h:    calc(var(--logo-h-base) * 0.8);
  --nav-pad-y: 6px;
}
.site-header.is-inner .brand-and-nav{ padding:2px 0 4px; }
@media (min-width: 881px){
  .site-header.is-inner .nav-list{ margin-top:0; }
}

/* Animacje nagłówka */
html.anim-load .site-header{
  animation: fadeIn var(--intro-1) ease-out both;
}
html.anim-load .authbar{
  animation: fadeIn var(--intro-1) ease-out both;
}

/* POWIADOMIENIA (dzwonek + panel) */
.notifications-wrap{
  position:relative;
}
.notifications-toggle{
  position:relative;
}
.notifications-badge{
  position:absolute;
  top:-4px;
  right:-4px;
  min-width:16px;
  height:16px;
  padding:0 4px;
  border-radius:999px;
  background:linear-gradient(135deg,var(--orange-1),var(--orange-2));
  color:#fff;
  font-size:.65rem;
  font-weight:700;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 0 0 1px #fff, 0 4px 8px rgba(0,0,0,.18);
}
/* ZNIKAJĄCY BADGE przy hidden */
.notifications-badge[hidden]{
  display:none !important;
}

.notifications-panel{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  width:min(420px, 95vw);
  max-height:min(460px, 75vh);
  background:linear-gradient(180deg,#ffffff,#fef6ee);
  border-radius:18px 18px 22px 22px;
  border:1px solid rgba(0,0,0,.06);
  box-shadow:0 18px 40px rgba(15,23,42,.28);
  padding:0;
  transform-origin:top center;
  transform:translateY(-4px) scale(.96);
  opacity:0;
  pointer-events:none;
  transition:
    opacity .16s ease-out,
    transform .16s ease-out,
    box-shadow .16s ease-out;
  z-index:1200;
}
.notifications-panel.is-open{
  opacity:1;
  pointer-events:auto;
  transform:translateY(0) scale(1);
}

/* "Odwrócony prostokąt" – strzałka */
.notifications-panel__arrow{
  position:absolute;
  top:-8px;
  right:22px;
  width:18px;
  height:18px;
  background:linear-gradient(180deg,#ffffff,#fef6ee);
  border-top:1px solid rgba(0,0,0,.06);
  border-left:1px solid rgba(0,0,0,.06);
  transform:rotate(45deg);
  border-radius:4px 0 0 0;
  box-shadow:-4px -4px 10px rgba(15,23,42,.06);
}
.notifications-panel__body{
  position:relative;
  padding:10px 10px 10px;
}
.notifications-panel__header{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  padding:4px 6px 6px;
}
.notifications-panel__header h2{
  margin:0;
  font-size:.95rem;
  font-weight:700;
}
.notifications-panel__header p{
  margin:2px 0 0;
  font-size:.8rem;
  color:#6b7280;
}
.notifications-panel__list{
  margin-top:4px;
  border-radius:14px;
  background:rgba(255,255,255,.85);
  padding:4px 2px 4px;
  max-height:min(360px, 65vh);
  overflow:auto;
}
.notifications-items{
  list-style:none;
  margin:0;
  padding:0;
}
.notifications-item{
  display:flex;
  align-items:flex-start;
  gap:8px;
  padding:8px 10px;
  border-radius:10px;
  cursor:pointer;
  transition:background-color .16s ease, transform .08s ease;
}
.notifications-item:hover{
  background:rgba(249,250,251,.95);
  transform:translateY(-1px);
}
.notifications-item.is-read{
  opacity:.8;
}
.notifications-item__link{
  display:flex;
  align-items:flex-start;
  gap:8px;
  text-decoration:none;
  color:inherit;
  width:100%;
}
.notifications-item__icon{
  flex:0 0 auto;
  width:26px;
  height:26px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg,#fee2c5,#fdba74);
  box-shadow:0 4px 10px rgba(248,171,105,.55);
  position:relative;
}
.notifications-item__icon::before{
  content:'\1F514';
  font-size:1rem;
}
.notifications-item__icon--message::before{
  content:'\2709';
}
.notifications-item__icon--paw::before{
  content:'\1F43E';
}
.notifications-item__content{
  flex:1 1 auto;
}
.notifications-item__text{
  font-size:.85rem;
  line-height:1.35;
  margin-bottom:2px;
}
.notifications-item__meta{
  font-size:.75rem;
  color:#9ca3af;
}
.notifications-empty{
  padding:18px 12px;
  text-align:center;
  font-size:.82rem;
  color:#6b7280;
}
.notifications-loading{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  padding:14px 10px;
}
.notifications-loading .dot{
  width:6px;
  height:6px;
  border-radius:999px;
  background:#f97316;
  opacity:.4;
  animation: notifDot 1s infinite ease-in-out;
}
.notifications-loading .dot:nth-child(2){ animation-delay:.12s; }
.notifications-loading .dot:nth-child(3){ animation-delay:.24s; }

@keyframes notifDot{
  0%, 100%{ transform:translateY(0); opacity:.4; }
  50%{ transform:translateY(-4px); opacity:1; }
}

/* Responsywność nagłówka / logo */
@media (max-width: 1024px){
  :root{
    --logo-slot-base: 170px;
    --logo-w-base:    170px;
    --logo-h-base:     28px;
  }
}
@media (max-width: 880px){
  .nav-toggle{
    display:inline-flex;
  }
  .brand-and-nav{
    position:relative;
    grid-template-columns:auto 1fr;
  }
  .brand{ width:auto; }

  .nav-row{
    align-items:flex-start;
  }
  .nav-bar{
    position:absolute;
    left:0;
    right:0;
    top:100%;
    background:#fff;
    border:1px solid var(--border);
    border-radius:12px;
    box-shadow:var(--shadow);
    display:none;
    max-width:100%;
    z-index:1001;
  }
  .nav-bar.active{ display:block; }
  .nav-list{
    flex-direction:column;
    align-items:stretch;
    padding:10px;
    white-space:normal;
    gap:10px;
  }

  .header-container{ padding-bottom:12px; }
  .authbar_actions{ gap:6px; }
}
