:root {
  --font-size: 100%;
  --sidebar-width: 320px;
}

html {
  font-size: var(--font-size);
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  transition: margin-left 0.3s ease, background-color 0.2s, color 0.2s;
}

/* po otwarciu paska treść się odsuwa */
body.sidebar-open {
  margin-left: var(--sidebar-width);
  transition: margin-left 0.3s ease;
}

/* przycisk otwierający panel */
.access-btn {
  background: none;
  border: none;
  cursor: pointer;
  margin: 12px;
  position: relative;
  z-index: 1100; /* nad paskiem */
}

/* ============================= */
/* PASEK BOCZNY (MODAL) */
/* ============================= */

/* overlay — tylko kontener, nie zasłania strony */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: var(--sidebar-width);
  display: none;
  z-index: 1000;
  pointer-events: none; /* nie przechwytuje kliknięć gdy zamknięty */
}

.modal-overlay.show {
  display: block;
  pointer-events: auto;
}

/* sam panel boczny */
.modal {
  width: var(--sidebar-width);
  height: 100%;
  background: linear-gradient(135deg, #669de9, #380622) ;
  color: #fff;
  box-shadow: 4px 0 24px rgba(0,0,0,0.25);
  border-radius: 0 10px 10px 0;
  padding: 20px;
  box-sizing: border-box;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  position: absolute;
  top: 0;
  left: 0;
  overflow-y: auto;
  z-index: 1010;
}

/* po otwarciu */
.modal-overlay.show .modal {
  transform: translateX(0);
}

/* zawartość panelu */
.modal h2,
.modal label,
.modal span,
.modal button {
  color: #fff;
}

.modal .option {
  margin-top: 20px;
}

/* przycisk zamykania */
.close-btn {
  position: absolute;
  right: 10px;
  top: 10px;
  background: #d33;
  color: #fff;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
  background: #a00;
  outline: 3px solid #fff;
}

/* przycisk kontrastu */
#contrastBtn {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background-color: #444;
  color: #fff;
  font-size: 1rem;
  display: inline-block;
}

#contrastBtn:focus {
  outline: 3px solid #000;
}

/* suwak czcionki */
input[type="range"] {
  width: 100%;
  height: 32px;
  background: transparent;
  margin-top: 10px;
}

/* suwak – styl */
input[type="range"]::-webkit-slider-runnable-track {
  height: 8px;
  background: #ddd;
  border-radius: 6px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 20px;
  width: 20px;
  margin-top: -6px;
  border-radius: 50%;
  background: #007acc;
  cursor: pointer;
}

input[type="range"]::-moz-range-track {
  height: 8px;
  background: #ddd;
  border-radius: 6px;
}

input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #007acc;
  border: none;
  cursor: pointer;
}

/* tryb wysokiego kontrastu */
.high-contrast {
  background-color: #000 !important;
  color: #ffeb3b !important; /* jasnożółty tekst */
}

.high-contrast * {
  background-color: transparent !important;
  color: #ffeb3b !important;
  border-color: #ffeb3b !important;
}

/* Linki */
.high-contrast a {
  color: #00ffff !important; /* turkusowe linki */
  text-decoration: underline !important;
}

/* Przyciski */
.high-contrast button {
  background-color: #000 !important;
  color: #ffeb3b !important;
  border: 2px solid #ffeb3b !important;
}

/* Pola formularzy */
.high-contrast input,
.high-contrast select,
.high-contrast textarea {
  background-color: #000 !important;
  color: #ffeb3b !important;
  border: 1px solid #ffeb3b !important;
}



.modal-overlay .modal {
  display: block !important;
  position: relative !important;
}

/* --- NAPRAWY DLA PASKA BOCZNEGO WCAG --- */

/* Unikamy skalowania czcionki w pasku bocznym */
.wcag-modal {
  font-size: 16px !important; /* stała wielkość czcionki */
  line-height: 1.5;
}

/* Gradient tła paska bocznego */
.wcag-modal {
  background: linear-gradient(135deg, #aaf78c, #380622) !important;
  color: #fff;
}

/* Upewniamy się, że nie dziedziczy tła z Bootstrapa */
.modal-overlay {
  background: transparent !important;
}

/* Przycisk zamknięcia */
.wcag-modal .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: #c0392b;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  z-index: 1050;
  transition: background 0.2s ease;
}

.wcag-modal .close-btn:hover {
  background: #e74c3c;
}
.wcag-modal {
  font-size: initial !important;
}


/* ----------------- TRYB NOCNY -------------- */

/* TRYB NOCNY — tylko dla treści (wykluczamy panel boczny) */
body.dark-mode {
  background-color: #121212 !important;
  color: #f5f5f5 !important;
}

/* Główna treść i boczne sekcje strony */
body.dark-mode main,
body.dark-mode .content-paragraph,
body.dark-mode .sidebarL,
body.dark-mode .sidebarR {
  background-color: #121212 !important;
  color: #f5f5f5 !important;
}

/* Linki w trybie nocnym */
body.dark-mode main a,
body.dark-mode .content-paragraph a,
body.dark-mode .sidebarR a,
body.dark-mode .sidebarL a {
  color: #80bfff !important;
}

/* Wykluczamy panel WCAG i modal z wpływu trybu nocnego */
body.dark-mode .modal,
body.dark-mode .wcag-modal {
  background: linear-gradient(135deg, #3a3b3b, #380622) !important;
 /* background: linear-gradient(135deg, #aaf78c, #380622) !important; */
  color: #fff !important;
}

/* Elementy tekstowe i przyciski w panelu pozostają jasne */
body.dark-mode .modal h2,
body.dark-mode .modal label,
body.dark-mode .modal button,
body.dark-mode .modal span,
body.dark-mode .wcag-modal h2,
body.dark-mode .wcag-modal label,
body.dark-mode .wcag-modal button,
body.dark-mode .wcag-modal span {
  color: #fff !important;
}

/* Styl samego przycisku trybu nocnego */
#darkModeBtn {
  padding: 8px 14px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  background-color: #444;
  color: #fff;
  font-size: 1rem;
  display: inline-block;
  margin-top: 10px;
}

#darkModeBtn:focus {
  outline: 3px solid #000;
}