/* ============================
   PODSTAWOWE USTAWIENIA
   ============================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 16px;
    color: #222;
    background-color: #f5f5f5;
    line-height: 1.6;
    padding: 20px;
}

/* ============================
   NAGŁÓWKI I TEKST
   ============================ */

h1, h2, h3, h4, h5 {
    color: #333;
    margin-bottom: 10px;
    text-align: center;
}

p {
    margin-bottom: 15px;
}

/* ============================
   LINKI
   ============================ */

a {
    color: #0078d7;
    text-decoration: none;
    transition: 0.3s;
}

a:hover {
    color: #005a9e;
    text-decoration: underline;
}

/* ============================
   TABELA
   ============================ */

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    background-color: #fff;
}

th, td {
    border: 1px solid #ccc;
    padding: 10px;
    text-align: center;
    vertical-align: middle;
}

.table-wrapper {
    width: max-content;
    margin: 0 auto;
}

/* ============================
   PRZYCISKI
   ============================ */

button {
    background-color: #0078d7;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #005a9e;
}

/* ============================
   CHECKBOX Z PODŚWIETLENIEM WIERSZA
   ============================ */

tr.checked {
    background-color: #c7f7c7 !important;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================
   MODAL
   ============================ */

.modal {
  display: flex;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.6);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal-content {
  background: white;
  padding: 20px 25px;
  border-radius: 12px;
  width: 300px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transform: scale(0.9);
  animation: popupIn 0.25s ease forwards;
}

.modal-content button {
  background: #0078ff;
  color: white;
  border: none;
  padding: 8px 16px;
  margin: 5px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.modal-content button:hover {
  background: #005fcc;
}

.modal-content input {
  width: 80%;
  padding: 8px;
  margin: 6px 0;
  border: 1px solid #ccc;
  border-radius: 6px;
  outline: none;
}

.modal-content input:focus {
  border-color: #0078ff;
  box-shadow: 0 0 4px rgba(0,120,255,0.5);
}

/* Animacje modala */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popupIn {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}

/* ============================
   CHECKBOXY PRZED LOGOWANIEM
   ============================ */

.row-check.disabled-look {
  filter: grayscale(100%);
  opacity: 0.6;
  cursor: not-allowed;
  accent-color: gray;
}

.row-check {
  accent-color: #0078ff;
  transition: 0.3s ease;
}

/* ============================
   PANEL LOGOWANIA
   ============================ */

.logout-container {
  display: flex;
  justify-content: flex-end;
  padding: 10px 20px;
  background: transparent;
}

.logout-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 15px;
  padding: 10px 20px;
}

#userInfo {
  color: #333;
  font-weight: 500;
  font-size: 15px;
}

/* ============================
   ROZWIJANE NAGŁÓWKI LAT
   ============================ */

.collapse-header {
    background:#1f7a1f;
    color:#fff;
    padding:12px 18px;
    font-size:20px;
    cursor:pointer;
    border-radius:6px;
    user-select:none;
    margin: 0 auto 8px auto;
    position:relative;
    text-align:center;
    max-width: 1000px;
    width: 100%;
}

.collapse-header .title {
  display: block;
  width: 100%;
  text-align: center;
}

.collapse-header .arrow {
  position: absolute;
  right: 15px;
  top: 25%;
  transition: transform 0.3s ease;
}

.collapse-header.open .arrow {
  transform: rotate(180deg);
}

.collapse-content {
  max-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  transition: max-height 0.3s ease;
  width: 100%;
}

/* ============================
   MAIN WRAPPER
   ============================ */

.main-wrapper {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.main-wrapper.open {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* ============================
   MAIN HEADER
   ============================ */

.main-header {
    background:#1f7a1f;
    color:#fff;
    padding:12px 18px;
    font-size:20px;
    cursor:pointer;
    border-radius:6px;
    user-select:none;
    margin: 0 auto 8px auto;
    position:relative;
    text-align:center;
    max-width: 1200px;
    width: 100%;
}

.main-header .title {
  display: block;
  width: 100%;
  text-align: center;
}

.main-header .arrow {
  position: absolute;
  right: 15px;
  top: 25%;
  transition: transform 0.3s ease;
}

.main-header.open .arrow {
  transform: rotate(180deg);
}

/* ============================
   RESPONSYWNOŚĆ
   ============================ */

@media (max-width: 600px) {
  .table-wrapper {
    transform: scale(0.52);
    transform-origin: top left;
    width: 100%;
    margin-left: 8px;
  }

  .collapse-header {
    max-width: 400px;
  }
}

.margin {
    margin-top: 15px;
}

tr {
  transition: background-color 0.5s ease; /* 🔥 działa w obie strony */
}

tr.highlight {
  background-color: #ff6b6b !important;
}
