/* ===== Navbar ===== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: 64px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

/* Apply top offset for pages that don't set it inline */
.with-navbar-offset {
  padding-top: 72px;
}
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-right: 16px;
}
.navbar-logo svg { width: 24px; height: 24px; color: var(--primary); }
.navbar-logo span { font-family: var(--font-display); font-weight: 800; font-size: 18px; }
.navbar-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}
.navbar-links a {
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted-fg);
  position: relative;
  transition: color var(--transition);
}
.navbar-links a:hover { color: var(--fg); }
.navbar-links a.active { color: var(--fg); }
.navbar-links a.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--secondary);
  border-radius: 1px;
}
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.icon-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--muted-fg);
  transition: all var(--transition);
  position: relative;
}
.icon-btn:hover { background: var(--muted); color: var(--fg); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn--heart { color: var(--destructive); }
.icon-btn--heart:hover { color: var(--destructive); opacity: 0.8; }
.icon-btn--notif .notif-dot,
.icon-btn--notif .notif-badge,
.icon-btn--chat .notif-badge {
  position: absolute;
  top: 5px;
  right: 5px;
}
.icon-btn--notif .notif-dot {
  width: 8px;
  height: 8px;
  background: var(--destructive);
  border-radius: 50%;
}
.notif-badge {
  min-width: 16px;
  height: 16px;
  background: var(--destructive);
  color: white;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  padding: 0 4px;
  pointer-events: none;
}
.notif-badge.hidden { display: none; }

/* ===== Real-time toast notifications ===== */
.ws-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}
.ws-toast {
  display: flex;
  align-items: stretch;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  overflow: hidden;
  min-width: 280px;
  max-width: 360px;
  pointer-events: all;
  transform: translateX(120%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(.22,1,.36,1), opacity 0.3s ease;
}
.ws-toast.ws-toast--in {
  transform: translateX(0);
  opacity: 1;
}
.ws-toast-accent {
  width: 4px;
  flex-shrink: 0;
  background: var(--primary);
}
.ws-toast.ws-toast--message .ws-toast-accent { background: var(--primary); }
.ws-toast.ws-toast--mention .ws-toast-accent { background: #f59e0b; }
.ws-toast-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  flex: 1;
  text-decoration: none;
  color: inherit;
}
.ws-toast-link:hover { background: var(--muted); }
.ws-toast-icon {
  font-size: 20px;
  flex-shrink: 0;
  line-height: 1;
}
.ws-toast-body { flex: 1; min-width: 0; }
.ws-toast-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-toast-msg {
  font-size: 12px;
  color: var(--muted-fg);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ws-toast-close {
  padding: 12px 10px;
  font-size: 16px;
  color: var(--muted-fg);
  background: none;
  border: none;
  cursor: pointer;
  line-height: 1;
  flex-shrink: 0;
}
.ws-toast-close:hover { color: var(--fg); }
@media (max-width: 480px) {
  .ws-toast-container { left: 16px; right: 16px; bottom: 16px; }
  .ws-toast { min-width: unset; max-width: unset; width: 100%; }
}
.avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  margin-left: 4px;
  transition: transform var(--transition);
}
.avatar-btn:hover { transform: scale(1.05); }

/* ===== Hamburger Button ===== */
.hamburger-btn {
  display: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--fg);
  transition: background var(--transition);
}
.hamburger-btn:hover { background: var(--muted); }
.hamburger-btn svg { width: 22px; height: 22px; }

.navbar-auth-mobile { display: none; }

/* ===== Mobile Nav Overlay ===== */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.mobile-nav-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.mobile-nav-panel {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 100%;
  background: var(--card);
  box-shadow: 4px 0 24px rgba(0,0,0,0.12);
  transform: translateX(-100%);
  transition: transform 300ms cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.mobile-nav-overlay.open .mobile-nav-panel {
  transform: translateX(0);
}
.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.mobile-nav-header .navbar-logo { margin-right: 0; }
.mobile-nav-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--muted-fg);
  transition: all var(--transition);
}
.mobile-nav-close:hover { background: var(--muted); color: var(--fg); }
.mobile-nav-close svg { width: 20px; height: 20px; }
.mobile-nav-links {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}
.mobile-nav-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted-fg);
  transition: all var(--transition);
}
.mobile-nav-links a:hover { background: var(--muted); color: var(--fg); }
.mobile-nav-links a.active {
  color: var(--fg);
  background: var(--muted);
  border-right: 3px solid var(--secondary);
}
.mobile-nav-links a svg { width: 20px; height: 20px; flex-shrink: 0; }
.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 20px;
}
.mobile-nav-footer {
  padding: 16px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--border);
}
.mobile-nav-footer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  color:#fff;
  background-color: oklch(58% 0.233 277.117);;
}

/* ===== Account Drawer ===== */
.account-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 300ms ease;
}
.account-drawer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}
.account-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 360px;
  max-width: 90vw;
  height: 100%;
  background: var(--card);
  box-shadow: -4px 0 24px rgba(0,0,0,0.12);
  transform: translateX(100%);
  transition: transform 300ms cubic-bezier(0.4,0,0.2,1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}
.account-drawer-overlay.open .account-drawer {
  transform: translateX(0);
}
.account-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.account-drawer-header h2 {
  font-size: 18px;
  font-weight: 700;
}
.account-drawer-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--muted-fg);
  transition: all var(--transition);
}
.account-drawer-close:hover { background: var(--muted); color: var(--fg); }
.account-drawer-close svg { width: 20px; height: 20px; }
.account-drawer-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px;
  border-bottom: 1px solid var(--border);
}
.account-drawer-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}
.account-drawer-info h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}
.account-drawer-info p {
  font-size: 13px;
  color: var(--muted-fg);
}
.account-drawer-section {
  padding: 16px 24px 8px;
}
.account-drawer-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-fg);
  margin-bottom: 8px;
}
.account-drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  transition: all var(--transition);
  width: 100%;
  text-align: left;
}
.account-drawer-item:hover {
  background: var(--muted);
}
.account-drawer-item svg {
  width: 18px;
  height: 18px;
  color: var(--muted-fg);
  flex-shrink: 0;
}
.account-drawer-item--danger { color: var(--destructive); }
.account-drawer-item--danger svg { color: var(--destructive); }

/* Badge licznika w linku drawerze */
.drawer-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--primary-fg);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Odznaka planu subskrypcji w nagłówku drawera */
.drawer-sub-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.drawer-sub-badge--premium {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}
.drawer-sub-badge--business {
  background: linear-gradient(135deg, var(--primary), oklch(45% 0.233 277));
  color: #fff;
}
.account-drawer-footer {
  margin-top: auto;
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
}

.navbar-actions a.btn-primary{
  background-color: oklch(58% 0.233 277.117);
}
/* ===== Responsive ===== */

@media (max-width: 768px) {
  .navbar-links { display: none; }
  .hamburger-btn { display: flex; }
  .navbar-actions { margin-left: auto; }
  .navbar-actions a{
    font-size: 12px;
  }
  .navbar-auth-desktop { display: none; }
  .navbar-auth-mobile { display: inline-flex; align-items: center; }
}

/* ===== Lightbox ===== */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 200ms ease;
}
.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
}
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: white;
  transition: background var(--transition);
}
.lightbox-close:hover { background: rgba(255,255,255,0.2); }
.lightbox-close svg { width: 22px; height: 22px; }
.lightbox-img-wrap {
  position: relative;
  z-index: 5;
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  animation: slideUp 250ms ease;
}
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  color: white;
  transition: background var(--transition);
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-nav:disabled { opacity: 0.3; cursor: default; }
.lightbox-nav:disabled:hover { background: rgba(255,255,255,0.1); }
.lightbox-nav svg { width: 24px; height: 24px; }
.lightbox-nav--prev { left: 16px; }
.lightbox-nav--next { right: 16px; }
.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
  background: rgba(0,0,0,0.4);
  padding: 4px 14px;
  border-radius: 999px;
}
