/* =========================================
   NAVBAR
   ========================================= */

.navbar {
  backdrop-filter: blur(18px);
  background-color: rgba(15, 23, 42, 0.96) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  padding: 0.5rem 0;
  min-height: 56px;
}

[data-bs-theme="light"] .navbar {
  background-color: rgba(255, 255, 255, 0.96) !important;
  border-bottom: 1px solid rgba(203, 213, 225, 0.5);
}

[data-bs-theme="light"] .navbar .navbar-text,
[data-bs-theme="light"] .navbar .text-light {
  color: #1e293b !important;
}

[data-bs-theme="light"] .navbar .btn-outline-light {
  color: #1e293b;
  border-color: #cbd5e1;
}

[data-bs-theme="light"] .navbar .btn-outline-light:hover {
  background-color: #f1f5f9;
  color: #0f172a;
}

.navbar-brand {
  display: flex;
  align-items: center;
  padding: 0;
  margin: 0;
}

/* LOGO - odpowiedni rozmiar */
.planin-logo {
  height: 52px;
  width: auto;
}

/* Domyślnie (dark mode) - pokazuj light logo, ukryj dark */
.planin-logo-light {
  display: block;
}

.planin-logo-dark {
  display: none;
}

/* Light mode - ukryj light logo, pokazuj dark */
[data-bs-theme="light"] .planin-logo-light {
  display: none;
}

[data-bs-theme="light"] .planin-logo-dark {
  display: block;
}

/* PANEL PRAWEJ STRONY */
.planin-nav-controls {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

[data-bs-theme="light"] .planin-nav-controls {
  background: rgba(241, 245, 249, 0.9);
  border-color: rgba(148, 163, 184, 0.4);
}

/* LANGUAGE SELECT */
.planin-lang-select {
  background: transparent;
  border: none;
  color: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.2rem 0.5rem;
  cursor: pointer;
}

[data-bs-theme="light"] .planin-lang-select {
  color: #1e293b;
}

.planin-lang-select:focus {
  outline: none;
  box-shadow: none;
}

.planin-lang-select option {
  background: #1e293b;
  color: #f1f5f9;
}

[data-bs-theme="light"] .planin-lang-select option {
  background: #ffffff;
  color: #1e293b;
}

/* THEME TOGGLE */
.planin-theme-toggle {
  position: relative;
  width: 44px;
  height: 22px;
  flex-shrink: 0;
}

.planin-theme-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.planin-theme-label {
  cursor: pointer;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: #334155;
  border: 1px solid rgba(148, 163, 184, 0.4);
  position: relative;
  transition: background 0.3s ease;
}

[data-bs-theme="light"] .planin-theme-label {
  background: #cbd5e1;
  border-color: rgba(100, 116, 139, 0.4);
}

/* Ukryj spany z ikonami - użyjemy pseudo-elementów */
.planin-theme-icon {
  display: none;
}

/* knob - domyślnie dark mode (słońce po lewej = przełącz na jasny) */
.planin-theme-label::before {
  content: "☀️";
  position: absolute;
  top: 1px;
  left: 1px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fbbf24;
  transition: transform 0.3s ease, background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Light mode - księżyc po prawej */
.planin-theme-checkbox:checked + .planin-theme-label::before {
  transform: translateX(22px);
  content: "🌙";
  background: #6366f1;
}

/* =========================================
   AUTH BUTTONS (Login, Logout, Register)
   ========================================= */

/* Styl bazowy dla przycisków w navbarze */
.navbar .btn {
  font-weight: 500;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border-radius: 8px;
  transition: all 0.2s ease;
}

/* Login / Logout button - outline style */
.navbar .btn-outline-light {
  background: transparent;
  border: 1.5px solid rgba(148, 163, 184, 0.5);
  color: #e2e8f0;
}

.navbar .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(148, 163, 184, 0.8);
  color: #ffffff;
  transform: translateY(-1px);
}

[data-bs-theme="light"] .navbar .btn-outline-light {
  background: transparent;
  border-color: rgba(100, 116, 139, 0.4);
  color: #475569;
}

[data-bs-theme="light"] .navbar .btn-outline-light:hover {
  background: rgba(15, 23, 42, 0.05);
  border-color: #64748b;
  color: #1e293b;
}

/* Register button - primary style */
.navbar .btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  border: none;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.navbar .btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

[data-bs-theme="light"] .navbar .btn-primary {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

[data-bs-theme="light"] .navbar .btn-primary:hover {
  background: linear-gradient(135deg, #4338ca 0%, #6d28d9 100%);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

/* Admin button */
.navbar .btn-admin {
  background: rgba(37, 99, 235, 0.15);
  border: 1.5px solid rgba(37, 99, 235, 0.4);
  color: #60a5fa;
}

.navbar .btn-admin:hover {
  background: rgba(37, 99, 235, 0.25);
  border-color: rgba(37, 99, 235, 0.6);
  color: #93c5fd;
  transform: translateY(-1px);
}

[data-bs-theme="light"] .navbar .btn-admin {
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.3);
  color: #2563eb;
}

[data-bs-theme="light"] .navbar .btn-admin:hover {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(37, 99, 235, 0.5);
  color: #1d4ed8;
}

/* HAMBURGER MENU - widoczność w light mode */
.navbar-toggler {
  border-color: rgba(148, 163, 184, 0.5);
}

[data-bs-theme="light"] .navbar-toggler {
  border-color: rgba(15, 23, 42, 0.3);
}

[data-bs-theme="light"] .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(15, 23, 42, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* MOBILE MENU - układ pionowy */
@media (max-width: 990px) {
  /* Szybsza animacja Bootstrap */
  .navbar-collapse {
    transition: height 0.15s ease;
  }

  .navbar-collapse.collapsing {
    transition: height 0.15s ease;
  }

  /* Style dla rozwiniętego menu */
  .navbar-collapse > .d-flex {
    background: var(--planin-surface-bg);
    border-radius: 1rem;
    padding: 1rem;
    margin-top: 0.5rem;
    border: 1px solid var(--planin-border-subtle);
    flex-direction: column;
    align-items: stretch !important;
    gap: 1rem !important;
  }

  /* Info o użytkowniku */
  .navbar-collapse .navbar-text {
    display: block !important;
    text-align: center;
    padding: 0.5rem;
    background: var(--planin-surface-soft);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
  }

  /* Kontrolki (język + theme) */
  .planin-nav-controls {
    justify-content: center;
    width: 100%;
    padding: 0.5rem 1rem;
  }

  /* Przyciski auth */
  .navbar-collapse .d-flex:last-child {
    flex-direction: column;
    gap: 0.5rem;
  }

  .navbar-collapse .d-flex:last-child .btn {
    width: 100%;
    margin: 0 !important;
  }

  .navbar-collapse .d-flex:last-child form {
    width: 100%;
  }

  .navbar-collapse .d-flex:last-child form .btn {
    width: 100%;
  }
}
