/* ============================================================
   🌿 FLORA PARK – TABELA LOKALI (WERSJA FINALNA 2025-10-10)
   ============================================================ */

/* ========== PODSTAWA ========== */
@media (max-width: 768px) {

  .tabela-lokali th {
    white-space: normal !important;
    word-break: normal !important;
    hyphens: auto;
  }

  .tabela-lokali td {
    white-space: nowrap !important;
  }

}

.tabela-lokali {
  width: 100%;
  border-collapse: collapse;
  margin: 25px 0;
  font-size: 15px;
  line-height: 1.35;
  color: #222;
}

.tabela-lokali thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f7f9;
  color: #111;
  font-weight: 500;
  padding: 10px 12px;
  text-align: center;
  border-bottom: 1px solid #e5e7eb;
}

/* ========== KOLUMNOWANIE ========== */
.tabela-lokali td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
  white-space: nowrap !important;
  text-overflow: ellipsis;
  overflow: hidden;
  text-align: center;
}

/* Kolumna „Przynależne” – może się łamać */
.tabela-lokali td:nth-child(7) {
  white-space: normal !important;
  word-break: break-word;
}

/* Kolumny liczbowe – do prawej */
.tabela-lokali td:nth-child(6),
.tabela-lokali td:nth-child(7) {
  text-align: right !important;
}

/* Hover głównego wiersza */
.tabela-lokali tbody tr:hover {
  background: #fffefc;
  transition: background 0.25s ease;
}

/* ========== STATUSY ========== */
.row-rezerwacja td {
  background: #fff8d7 !important;
  color: #7c6800;
}
.row-sprzedane td {
  background: #f9d6d9 !important;
  color: #6b5557;
}


/* ========== RAZEM ========== */
.jc-suma-lokalu {
  font-size: 14px !important;
  color: #333 !important;
  text-align: right;
  margin-top: 6px !important;
}
.jc-suma-lokalu small {
  font-weight: 500;
  color: #111;
}
.jc-suma-wartosc {
  font-weight: 600;
  color: #000;
}



/* ========== PAGINACJA ========== */
.dataTables_wrapper .dataTables_paginate {
  text-align: center;
  margin-top: 20px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button {
  background: none !important;
  border: none !important;
  color: #6c584c !important;
  font-size: 14px;
  font-weight: 500;
  text-decoration: underline;
  margin: 0 3px;
}
.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  color: #000 !important;
  text-decoration: none;
}
.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  color: #000 !important;
  font-weight: 600;
  text-decoration: underline;
}
/* ============================================================
   🧩 FIX: Child-row width + kolorystyka
   ============================================================ */

/* Pełna szerokość child-row i wyrównanie */
table.dataTable tr.child td {
  display: table-cell !important;
  width: 100% !important;
  padding: 10px 20px !important;
  background: #fffefb !important; /* jasne, ciepłe, czyste tło */
  border-left: 3px solid #b79f82 !important;
  border-top: 1px solid #eee;
  border-bottom: 1px solid #eee;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

/* Naprawa tła dla całego wiersza child */
table.dataTable tr.child {
  background: #fffefb !important;
}

/* Subtelny hover, bez przeskoków */
table.dataTable tr.child:hover td {
  background: #fffefc !important;
}
/* ============================================================
   🧩 FIX: rozmiar selecta (pole wyboru miejsca)
   ============================================================ */

.jc-select-miejsce {
  width: auto !important;         /* nie rozciągaj na 100% */
  max-width: 220px !important;    /* typowa szerokość */
  min-width: 160px;
  display: inline-block !important;
  padding: 4px 8px;
  font-size: 14px;
  line-height: 1.3;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: #fff;
  color: #222;
  transition: border-color 0.2s ease;
}

.jc-select-miejsce:hover {
  border-color: #aaa;
}

.jc-select-miejsce:focus {
  border-color: #666;
  outline: none;
}

/* wyrównanie komórki, żeby select był po lewej, a "Razem:" pod nim */
.tabela-lokali td select.jc-select-miejsce {
  margin-bottom: 2px;
}

/* na mniejszych ekranach — 100% */
@media (max-width: 768px) {
  .jc-select-miejsce {
    width: 100% !important;
    max-width: 100% !important;
    font-size: 13px;
  }
}

/* ==================== ANIMACJA POJAWIANIA SIĘ HISTORII CEN ==================== */
#historyTable tbody {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#historyTable tbody.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==================== FIX MOBILNY – BEZ POZIOMEGO SCROLLA ==================== */
@media (max-width: 768px) {

  /* 🔹 Kontener DataTables — przewijanie tylko w tabeli */
  .dataTables_wrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* 🔹 Tabela dopasowana do szerokości ekranu */
  .tabela-lokali {
    width: 100% !important;
    min-width: unset !important;
    max-width: 100% !important;
    table-layout: auto !important;
  }

  /* 🔹 Komórki i nagłówki mogą się łamać */
  .tabela-lokali th,
  .tabela-lokali td {
    white-space: normal !important;
    word-break: break-word;
    font-size: 13px;
    padding: 8px 6px;
  }

  /* 🔹 Kolumna z selectem – nie za szeroka */
  .jc-select-miejsce {
    width: 100% !important;
    max-width: 150px !important;
    font-size: 12px;
  }

  /* 🔹 Lekko zmniejszone czcionki w sumie */
  .jc-suma-lokalu {
    font-size: 12px !important;
  }
}
/* ==================== UX: subtelny efekt hover na ikonach statusów ==================== */
.tabela-lokali td.status i {
  display: inline-block;
  font-size: 13px;
  vertical-align: middle;
  margin-right: 5px;
  opacity: 0.9;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.tabela-lokali td.status i:hover {
  transform: scale(1.25);
  opacity: 1;
}
/* ==================== UX: łagodne zaokrąglenie i cień wierszy ==================== */
.tabela-lokali tbody tr {
  border-radius: 6px;
 
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

/* delikatny cień i podniesienie przy hoverze */
.tabela-lokali tbody tr:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);

}
/* ==================== UX: cień dopasowany do koloru statusu ==================== */

/* 🟢 Dostępne – neutralny, lekko zielonkawy cień */
.row-dostepne:hover td {
  box-shadow: 0 2px 6px rgba(50, 130, 50, 0.15);
}

/* 🟡 Rezerwacja – cień w ciepłym, złotym tonie */
.row-rezerwacja:hover td {
  box-shadow: 0 2px 6px rgba(184, 134, 11, 0.18);
}

/* 🔴 Sprzedane – cień lekko malinowy, chłodniejszy */
.row-sprzedane:hover td {
  box-shadow: 0 2px 6px rgba(163, 58, 58, 0.18);
}
/* ==================== UX: dopracowanie child-row (szczegóły lokalu) ==================== */
table.dataTable tr.child ul.dtr-details {
  margin: 6px 0 8px 14px;
  padding: 0;
  list-style: none;
  width: calc(100% - 14px);
}

table.dataTable tr.child ul.dtr-details > li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.4;
  border-bottom: 1px dashed #e8dfcf;
}

table.dataTable tr.child ul.dtr-details > li:last-child {
  border-bottom: none;
}

/* tytuły po lewej */
table.dataTable tr.child ul.dtr-details > li span.dtr-title {
  font-weight: 600;
  color: #4b3e2e;
}

/* dane po prawej */
table.dataTable tr.child ul.dtr-details > li span.dtr-data {
  color: #222;
  text-align: right;
}

/* linki w child-row – bardziej eleganckie */
table.dataTable tr.child ul.dtr-details a {
  color: #0044cc;
  text-decoration: none;
  font-weight: 500;
}
table.dataTable tr.child ul.dtr-details a:hover {
  text-decoration: underline;
  color: #000;
}

/* === PODSTAWA MODALA – WYMAGANA PRZEZ JS === */
#priceHistoryModal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

#priceHistoryModal.active {
  display: flex !important;
}

/* blokuj scroll strony */
body.modal-open {
  overflow: hidden;
}


/* ==================== UX: dopracowany modal historii cen ==================== */

#priceHistoryModal .modal-content {
  background: #fff;
  padding: 28px 32px;
  border-radius: 12px;
  max-width: 540px;
  width: 90%;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
  position: relative;
  animation: fadeInUp 0.25s ease;
  border: 1px solid #eee;
}

#priceHistoryModal h3 {
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 20px;
  text-align: center;
  color: #222;
  font-weight: 600;
}

/* tabela w modalu */
#priceHistoryModal table {
  width: 100%;
  border-collapse: collapse;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #ddd;
}

#priceHistoryModal th,
#priceHistoryModal td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}

#priceHistoryModal th {
  background: #f7f7f9;
  font-weight: 600;
  color: #333;
}

#priceHistoryModal tr:last-child td {
  border-bottom: none;
}

/* przycisk zamknięcia */
#priceHistoryModal .close {
  position: absolute;
  top: 10px;
  right: 16px;
  font-size: 22px;
  color: #888;
  cursor: pointer;
  transition: color 0.15s ease;
}
#priceHistoryModal .close:hover {
  color: #000;
}

/* efekt „pojawienia się” */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}
#priceHistoryModal h3 {
  position: relative;
  padding-left: 26px;
}
#priceHistoryModal h3::before {
  content: "\f201"; /* Font Awesome chart-line */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  position: absolute;
  left: 0;
  top: 1px;
  font-size: 18px;
  color: #0066cc;
}
#priceHistoryModal th {
  background: linear-gradient(to bottom, #fafafa, #f3f3f3);
  border-bottom: 2px solid #e5e5e5;
}
#priceHistoryModal td:last-child {
  font-weight: 500;
}
/* =====================
   Linki: POBIERZ + Historia cen
   Flora Park – złoty kolor brandu
   ===================== */

.tabela-lokali td a,
.show-history {
    color: #B79F82 !important;     /* złoty brand */
    font-weight: 600;              /* wyraźniejsze */
    text-decoration: none;
}

.tabela-lokali td a:hover,
.show-history:hover {
    color: #8D6F54 !important;     /* ciemniejszy złoty */
    text-decoration: underline;
}
table.dataTable thead th {
    white-space: normal;      /* pozwala łamać tekst */
    text-align: center;
    font-weight: 500;
    font-size: 13.5px;
    letter-spacing: 0.2px;
    vertical-align: middle;
}
/* 🔒 NIE ZAWIJAJ CEN */
.tabela-lokali td:nth-child(6),
.tabela-lokali td:nth-child(7),
.tabela-lokali td:nth-child(8),
.tabela-lokali td:nth-child(9) {
  white-space: nowrap !important;
}
/* Ikona rozwijania – kursor */
table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child {
  cursor: pointer;
}

/* Tooltip */
table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child {
  position: relative;
  cursor: pointer;
  overflow: visible;
}

table.dataTable.dtr-inline.collapsed > tbody > tr > td:first-child:hover::after {
  content: "Kliknij, aby zobaczyć szczegóły";
  position: absolute;
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  color: #333;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
  white-space: nowrap;
  z-index: 9999;
}

/* === Badge informacyjny (nagłówek + legenda) === */
.th-info-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    font-size: 11px;
    font-weight: 700;
    color: #555;
    background: #dedede;
    border-radius: 50%;
    border: 1px solid #d0d0d0;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.03);
    line-height: 1;
}
.tabela-lokali th .th-info-circle {
    margin-left: 4px;
    vertical-align: middle;
}
.tabela-lokali-info .th-info-circle {
    flex: 0 0 16px;
    margin-top: 2px;
}
.tabela-lokali-info {
    margin-top: 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

.tabela-lokali-info .info-line {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.tabela-lokali-info .info-mark {
    min-width: 22px;
    text-align: right;
    font-weight: 700;
    color: #444;
}

.tabela-lokali-info .info-text {
    flex: 1;
}

.tabela-lokali-info hr {
    margin: 10px 0;
    opacity: 0.3;
}


td.jc-razem {
  font-size: 15px; /* bazowy rozmiar w komórce */
}

td.jc-razem .jc-suma-wartosc {
  font-size: 16px;
  font-weight: 600;
}

td.jc-razem .jc-suma-wartosc {
  letter-spacing: 0.2px;
}



/* =========================
   TOOLBAR – HARD RESET
   ========================= */

.tabela-toolbar,
.tabela-toolbar * {
  box-sizing: border-box;
}

/* reset WSZYSTKIEGO co było wcześniej */
.tabela-toolbar {
  display: flex !important;
  align-items: flex-end !important;
  gap: 12px;
  margin-bottom: 6px;
}

/* filtry */
.tabela-toolbar .tabela-filters {
  margin: 0 !important;
  padding: 0 !important;
  gap: 10px;
}

/* label */
.tabela-toolbar .dataTables_filter label {
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: flex-end !important;
}

.tabela-toolbar .dataTables_filter input[type="search"] {
  height: 36px;
  line-height: 36px;
  padding: 0 14px 0 36px;
  width: 220px;

  border-radius: 6px;
  border: 1px solid #cfc7b8;
  background-color: #f6f3ee;

  font-size: 14px;
  font-weight: 400;
  color: #222;

  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%238d6f54'%3E%3Cpath d='M15.5 14h-.79l-.28-.27a6.471 6.471 0 1 0-.71.71l.27.28v.79l5 4.99L20.49 19l-4.99-5zM10 15a5 5 0 1 1 0-10 5 5 0 0 1 0 10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 16px;
}
/* =========================
   PRZYCISKI FILTRÓW – STYL FINALNY
   ========================= */

.tabela-filters button {
  height: 36px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;

  border: 1px solid #cfc7b8;
  background: #f6f3ee;
  border-radius: 6px;

  font-size: 14px;
  font-weight: 400;
  color: #222;
  cursor: pointer;

  line-height: 1.2;
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

/* hover */
.tabela-filters button:hover {
  background: #ede6dc;
  border-color: #b7aa94;
}

/* active */
.tabela-filters button.active {
  background: #e3d7c6;
  border-color: #8d6f54;
  color: #000;
  font-weight: 400;
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}

/* disabled */
.tabela-filters button.disabled,
.tabela-filters button:disabled {
  background: #f3f3f3;
  border-color: #ddd;
  color: #aaa;
  cursor: default;
  pointer-events: none;
  box-shadow: none;
}

/* brak hovera dla disabled */
.tabela-filters button.disabled:hover,
.tabela-filters button:disabled:hover {
  background: #f3f3f3;
  border-color: #ddd;
}

/* tekst pomocniczy w przycisku */
.tabela-filters button .available {
  margin-top: 2px;
  font-size: 12.5px;
  color: #777;
  font-weight: 400;
}

.tabela-filters .avail {
  font-size: 13px;
  color: #666;
  font-weight: 400;
}

/* === FIX FUNKCJONALNY MODALA (PO USUNIĘCIU DUPLIKATU) === */

/* loader – wymagany przez JS */
#priceHistoryModal .loader {
  text-align: center;
  margin: 15px 0 10px;
}

#priceHistoryModal .loader .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #ccc;
  border-top-color: #666;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
  margin-bottom: 6px;
}

#priceHistoryModal .loader p {
  font-size: 14px;
  color: #555;
  margin: 0;
}

/* animacja loadera – MUSI ISTNIEĆ */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.tabela-filters .available {
  margin-left: 6px;
}
.block-cols__logo {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.block-cols__logo iframe {
    display: block;
    border: 0;
    overflow: hidden;
}
/* =========================
   LEGENDA – TYPY ZABUDOWY
   ========================= */

.tabela-lokali-types {
  margin-top: 18px;                 /* oddech od tabeli */
  margin-bottom: 10px;
  padding-top: 12px;
  border-top: 1px dashed #e5e0d8;

  font-size: 13px;
  line-height: 1.5;
  color: #555;
}

.tabela-lokali-types .type-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 8px;
}

.tabela-lokali-types .type-name {
  font-weight: 600;
  color: #2f2a24;
  white-space: nowrap;
}

.tabela-lokali-types .type-sep {
  margin: 0 2px;
  color: #777;
}

.tabela-lokali-types .type-desc {
  flex: 1;
}
/* ♿ Dom przystosowany – ikona przy numerze */
.icon-accessibility {
    margin-left: 5px;
    font-size: 16px;              /* ← to jest kluczowe */
    line-height: 1;
    vertical-align: middle;
	position: relative;
	top: -1px;
    color: #6f6a5f;               /* „drukarskie”, nie emoji */
    opacity: 0.7;
    cursor: help;
}

.block-cols__last {
    text-align: center;
}

/* 🏠 Poddasze nieużytkowe – ikona przy powierzchni */
.pow-poddasze-icon {
    margin-left: 6px;
    font-size: 15px;
    vertical-align: middle;
    color: #6f6a5f;
    opacity: 0.85;
    cursor: pointer;
}

.tabela-lokali td:has(.pow-poddasze-icon) {
    overflow: visible !important;
}
.poddasze-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.poddasze-wrap .jc-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  margin-top: 6px;

  background: #fff;
  color: #333;
  font-size: 13px;
  font-weight: 400;

  padding: 6px 10px;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
  white-space: nowrap;
  z-index: 9999;

  pointer-events: none; /* 👈 WAŻNE */
}

.poddasze-wrap:hover .jc-tooltip {
  display: block;
}
.poddasze-wrap {
  cursor: pointer;
}
table.tabela-lokali td.text-end {
    text-align: right !important;
}
td.jc-razem,
td.jc-razem .jc-suma-wartosc {
  white-space: nowrap !important;
}
td.jc-razem {
  min-width: 8ch;
}

@media (max-width: 768px) {
  .tabela-toolbar {
    display: none !important;
  }
}






