/* ==========================================================================
   GŁÓWNY ARKUSZ STYLÓW - BIBLIOTEKA SŁOWIAŃSKA
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 15% 20%, rgba(212, 163, 89, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(78, 159, 115, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Typografia */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  letter-spacing: 0.02em;
  font-weight: 600;
}

h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.5vw, 3rem);
  color: var(--amber-light);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

h2 {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  margin-bottom: 0.8rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--amber-gold);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--amber-light);
}

/* ==========================================================================
   NAGŁÓWEK I NAWIGACJA (HEADER & NAV)
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  transition: background-color var(--transition-normal);
}

.header-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  text-decoration: none;
  cursor: pointer;
}

.brand-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle, var(--amber-dark) 0%, rgba(20, 34, 27, 0.8) 100%);
  border: 1px solid var(--border-highlight);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  color: var(--amber-light);
  font-size: 1.4rem;
  animation: pulse-glow 4s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 5px rgba(212, 163, 89, 0.2); }
  100% { box-shadow: 0 0 16px rgba(212, 163, 89, 0.45); }
}

.brand-text h1 {
  font-size: 1.25rem;
  line-height: 1.1;
  margin: 0;
  color: var(--text-gold);
}

.brand-text span {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  font-weight: 500;
}

/* Przyciski w nagłówku */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  background: rgba(212, 163, 89, 0.08);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: rgba(212, 163, 89, 0.16);
  border-color: var(--border-highlight);
  color: var(--amber-light);
  transform: translateY(-1px);
}

.action-btn .badge {
  background: var(--terracotta);
  color: #fff;
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-full);
  font-weight: 700;
}

/* ==========================================================================
   BELKA ZAKŁADEK (NAVIGATION TABS BAR)
   ========================================================================== */

.nav-tabs-wrapper {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: var(--header-height);
  z-index: 90;
}

.nav-tabs {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.1rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: all var(--transition-fast);
}

.nav-tab:hover {
  color: var(--text-gold);
}

.nav-tab.active {
  color: var(--amber-light);
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--amber-gold), transparent);
  box-shadow: 0 0 8px var(--amber-gold);
}

/* ==========================================================================
   HERO BANNER & STATS
   ========================================================================== */

.hero-banner {
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, rgba(20, 34, 27, 0.6) 0%, transparent 100%);
  border-bottom: 1px solid var(--border-subtle);
}

.hero-content {
  max-width: 860px;
  margin: 0 auto;
}

.hero-title {
  margin-bottom: 0.8rem;
  position: relative;
  display: inline-block;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 1.8rem;
  font-weight: 300;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.1rem 0.9rem;
  backdrop-filter: blur(8px);
  cursor: pointer;
  user-select: none;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.stat-card:hover,
.stat-card:focus-visible {
  border-color: var(--amber-gold);
  background: rgba(212, 163, 89, 0.12);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 12px rgba(212, 163, 89, 0.25);
  outline: none;
}

.stat-card:active {
  transform: translateY(-1px);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--amber-light);
  line-height: 1;
  margin-bottom: 0.35rem;
  transition: color var(--transition-fast);
}

.stat-card:hover .stat-number {
  color: #fff;
}

.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
  transition: color var(--transition-fast);
}

.stat-card:hover .stat-label {
  color: var(--amber-light);
}

/* ==========================================================================
   GŁÓWNA ZAWARTOŚĆ (MAIN CONTAINER & SECTIONS)
   ========================================================================== */

.main-content {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.tab-section {
  display: none;
  animation: fadeIn 0.35s ease-out;
}

.tab-section.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.8rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.section-header-text h2 {
  margin: 0;
}

.section-header-text p {
  margin: 0.3rem 0 0;
  font-size: 0.95rem;
}

/* ==========================================================================
   STOPKA (FOOTER)
   ========================================================================== */

.app-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  padding: 2.5rem 1.5rem 1.8rem;
  margin-top: 4rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.footer-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h4 {
  color: var(--text-gold);
  font-size: 0.98rem;
  margin-bottom: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 0.45rem;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(212, 163, 89, 0.1);
  text-align: center;
  font-size: 0.8rem;
}

/* ==========================================================================
   RESPONSYWNOŚĆ I STYLIZACJA MOBILNA
   ========================================================================== */

@media (max-width: 1024px) {
  .hero-banner {
    padding: 3rem 1.5rem 2.5rem;
  }
  
  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 64px;
  }
  
  .header-container {
    padding: 0 1rem;
  }

  .brand {
    gap: 0.6rem;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
    font-size: 1.15rem;
  }

  .brand-text h1 {
    font-size: 1.05rem;
  }
  
  .brand-text span {
    display: none;
  }

  .action-btn {
    padding: 0.45rem 0.75rem;
    font-size: 0.8rem;
  }

  #global-search-trigger kbd {
    display: none;
  }
  
  .nav-tabs-wrapper {
    overflow: hidden;
  }

  .nav-tabs {
    padding: 0 0.8rem;
    gap: 0.35rem;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }

  .nav-tab {
    padding: 0.75rem 0.9rem;
    font-size: 0.82rem;
    min-height: 44px;
    scroll-snap-align: start;
    flex-shrink: 0;
  }
  
  .hero-banner {
    padding: 2.2rem 1rem 1.8rem;
  }

  .hero-title {
    font-size: clamp(1.6rem, 5vw, 2.2rem);
  }

  .hero-subtitle {
    font-size: 0.92rem;
    margin-bottom: 1.5rem;
  }
  
  .hero-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.8rem;
  }

  .stat-card {
    padding: 1rem 0.8rem;
  }

  .stat-number {
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.72rem;
  }

  .main-content {
    padding: 1.5rem 1rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.8rem;
    margin-bottom: 1.4rem;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 58px;
  }

  .header-actions {
    gap: 0.4rem;
  }

  .action-btn {
    padding: 0.4rem 0.6rem;
    font-size: 0.78rem;
  }

  .brand-text h1 {
    font-size: 0.92rem;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .nav-tab {
    padding: 0.65rem 0.75rem;
    font-size: 0.78rem;
  }

  .nav-tab span {
    font-size: 0.95rem;
  }
}
