/* ===================== */
/* PARTNERZY - STYLE BAZOWE (DLA WSZYSTKICH STRON) */

.partner-group,
.partner-subgroup {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.partners-section {
  display: flex;
  flex-wrap: wrap;
  align-items: center; /* ZMIANA: Wyśrodkowanie w pionie dla elementów w tym samym wierszu */
  justify-content: center;
  gap: 40px;
  width: 95%;
  max-width: 1800px;
  margin: 0 auto 40px;
}

.logo-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-weight: 700;
  color: var(--color-1);
  line-height: 1.2;
  min-height: 2.8em;
  margin-bottom: 8px;
  font-size: clamp(10px, 1.04vw, 20px);
}

.partner-main .logo-caption {
  font-size: clamp(15px, 1.5vw, 30px);
  min-height: auto; /* ZMIANA: Usunięcie wymuszonej wysokości dla opisu głównego partnera */
}

.logo-wrapper img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--white);
  border-radius: var(--logo-radius);
  box-shadow: var(--shadow-light);
}

.logo-wrapper.large {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 16 / 9;
  height: auto;
}

.logo-wrapper.small {
  width: 100%;
  max-width: 100px;
  aspect-ratio: 1 / 1;
  height: auto;
}

.logos-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 20px;
  max-width: 800px;
}

.logos-row-2 {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.side-by-side {
  display: flex !important;
  align-items: stretch;
}

.partner-group.side-by-side {
  flex-direction: row; 
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 40px; 
}

/* ===================== */
/* FIX TYLKO DLA DASHBOARDU (IZOLOWANE STYLE) */

.dashboard .partners-dashboard {
  position: absolute;
  bottom: 40px; 
  left: 50%;
  transform: translateX(-50%);
  width: 1800px; 
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 0; 
  flex-wrap: nowrap; 
}

/*.dashboard .partners-dashboard * {
  max-width: none !important;
}*/

.dashboard .partners-dashboard .partner-group.side-by-side {
  flex-direction: row;
  align-items: flex-start;
  gap: 50px; 
}

.dashboard .partners-dashboard .side-by-side {
  margin-left: 40px; 
}

.dashboard .partners-dashboard .logo-caption {
  font-size: 24px; 
  min-height: 48px;
  margin-bottom: 15px;
  line-height: 1.1;
  white-space: nowrap;
  background: radial-gradient(ellipse at center, rgba(255,255,255,1) 0%, rgba(255,255,255,0) 80%);
  padding: 5px 20px;
  border-radius: 50%; 
  text-shadow: none;
}

.dashboard .partner-main .logo-caption {
  font-size: 32px; 
  min-height: auto;
}

.dashboard .logos-row {
  gap: 10px; 
}

.dashboard .logo-wrapper.large {
  width: 320px;  
  height: 170px; 
}

.dashboard .logo-wrapper.small {
  width: 120px;  
  height: 120px; 
}

.dashboard .partners-dashboard .partner-group:not(.partner-main) {
  margin-top: 20px; 
}

/* ===================== */
/* WYKRES W DASHBOARDZIE I TRYB CHART-MODE */

/* 1. Płynne zwijanie tytułu bez "odbijania" */
.title-container {
  transition: max-height 0.8s ease, opacity 0.8s ease, margin 0.8s ease, padding 0.8s ease;
  max-height: 500px; /* bufor dla animacji */
  overflow: hidden;
}

/* Kiedy dodamy klasę do body, tytuł płynnie się kurczy */
body.chart-mode .title-container {
  max-height: 0;
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  border: none;
}

/* Płynne dojechanie zegara z ładnym odstępem od góry */
body.chart-mode #clock2 {
  margin-top: 20px;
  transition: margin-top 0.8s ease;
}

/* 2. Zabezpieczenie przed nachodzeniem wykresu na zegar */
.dashboard .chart-scroller {
  position: absolute;
  /* KOTWICZYMY Z OBU STRON! Zamiast ustalać "height", mówimy mu, 
     że ma zaczynać się na 500px od góry i kończyć 40px od dołu. */
  top: 565px; 
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  width: 1650px; 
  height: auto !important; /* Nadpisuje wszelkie poprzednie sztywne wysokości */
  
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 15px 20px;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-dark, 0 10px 30px rgba(0,0,0,0.2));
  z-index: 10;
}

.dashboard .chart-scroller .chart-container {
  width: 100%;
  position: relative;
}

.dashboard .chart-scroller canvas {
  width: 100% !important; 
}

/* --- PASEK PRZEWIJANIA --- */
.dashboard .chart-scroller::-webkit-scrollbar {
  width: 14px;
}
.dashboard .chart-scroller::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}
.dashboard .chart-scroller::-webkit-scrollbar-thumb {
  background: #c1c1c1; 
  border-radius: 10px;
  border: 3px solid #f1f1f1; 
}
.dashboard .chart-scroller::-webkit-scrollbar-thumb:hover {
  background: var(--color-2, #FF8C61); 
}