/* ─────────────────────────────────────────────────────────────────────────
   Katalogi Raporty — custom styles + print stylesheet (PDF export)
   ──────────────────────────────────────────────────────────────────────── */

/* ─── Mont font (brand Freedom — pliki dostarczone przez Avigonmedia) ─── */
@font-face {
  font-family: 'Mont';
  src: url('fonts/Mont-Regular.otf') format('opentype');
  font-weight: 400 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Mont';
  src: url('fonts/Mont-SemiBold.otf') format('opentype');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Mont';
  src: url('fonts/Mont-Bold.otf') format('opentype');
  font-weight: 700 900;
  font-style: normal;
  font-display: swap;
}

/* Smooth fonts */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Mont', 'Manrope', 'Inter', system-ui, -apple-system, sans-serif;
  font-weight: 600;  /* tak jak na freedom.pl — base weight 600, nie 400 */
  line-height: 1.6;
  color: #1F2937;  /* freedom.pl body color */
}

/* Dokładnie jak na freedom.pl — ale BEZ forsowania koloru (Tailwind wygrywa) */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Mont', 'Manrope', sans-serif;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
}
/* Kolor tylko gdy Tailwind go nie ustawia */
:where(h1, h2, h3, h4, h5, h6):not([class*="text-"]) {
  color: #111827;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

/* Freedom button — border-radius 6px, pink bg z hover reverse */
.btn-freedom {
  background: #E50071;
  color: #fff;
  border: 1px solid #E50071;
  border-radius: 6px;
  padding: 8.5px 25px;
  font-weight: 700;
  font-size: 14px;
  line-height: 20px;
  transition: all 0.4s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-freedom:hover {
  background: #fff;
  color: #E50071;
}

/* Card hover */
.kpi-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.12);
}

/* Tabela top ofert */
.offers-table thead th {
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
}

/* Pasek postępu w komórkach (wykorzystanie max impressions) */
.bar-cell {
  position: relative;
}
.bar-cell::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #FFE0EF 0%, #FFE0EF var(--bar-width, 0%), transparent var(--bar-width, 0%));
  z-index: 0;
  border-radius: 4px;
}
.bar-cell > * {
  position: relative;
  z-index: 1;
}

/* Wykres canvas — rozmiar */
.chart-container {
  position: relative;
  width: 100%;
}

/* ─────────────────────────────────────────────────────────────────────────
   PRINT STYLESHEET — generowanie PDF z poziomu przeglądarki (Cmd+P → Save as PDF)
   ──────────────────────────────────────────────────────────────────────── */
@media print {
  @page {
    size: A4;
    margin: 12mm 10mm;
  }

  html, body {
    background: white !important;
    color: #0F172A !important;
    font-size: 10pt;
  }

  /* Schowaj wszystko co interaktywne */
  .print\:hidden,
  nav, button, .no-print {
    display: none !important;
  }

  /* Rozmiary kart KPI mniejsze */
  .kpi-card {
    box-shadow: none !important;
    border: 1px solid #E2E8F0 !important;
    page-break-inside: avoid;
  }

  /* Każda sekcja na osobnej stronie jeśli jest długa */
  .section {
    page-break-inside: avoid;
  }
  .section.big {
    page-break-before: auto;
  }

  /* Nie tnij wykresów ani tabel */
  canvas, table, .chart-container, .kpi-card, tr {
    page-break-inside: avoid !important;
  }

  /* Linki bez podkreślenia w PDF */
  a {
    color: inherit !important;
    text-decoration: none !important;
  }

  /* Header z brandingiem */
  header {
    border-bottom: 2px solid #EF0081 !important;
  }

  /* Bez animacji w druku */
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Skeleton loading (na przyszłość — gdy przejdziemy na async)
   ──────────────────────────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #F1F5F9 0%, #E2E8F0 50%, #F1F5F9 100%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: 6px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Ładny scrollbar (mac-like) dla tabeli ofert */
.offers-scroll {
  max-height: 600px;
  overflow-y: auto;
}
.offers-scroll::-webkit-scrollbar {
  width: 8px;
}
.offers-scroll::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 4px;
}
.offers-scroll::-webkit-scrollbar-thumb:hover {
  background: #94A3B8;
}
