/* ===== RESET / BASE ===== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
/* ===== separator z klasą ===== */
.projects-separator {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin: 6px 0 10px 0;
}
/* ===== separator z klasą ===== */

:root {
  --bg-main: #0b0c10;
  --bg-panel: #151821;
  --bg-panel-alt: #181b26;
  --border-soft: #2b2f3a;
  --accent: #3b82f6;
  --accent-soft: #5a98fa;
  --accent-warm: #ffaa00;
  --text-main: #eeeeee;
  --text-muted: #bbbbbb;
  --radius-sm: 4px;
  --radius-md: 6px;
  --shadow-soft: 0 0 18px rgba(0, 0, 0, 0.45);
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
}

/* ===== GRID LAYOUT ===== */

#app {
  display: grid;
  grid-template-columns: minmax(320px, 370px) 1fr;
  height: 100vh;
  background: radial-gradient(circle at top left, #1b2430 0, #050608 55%);
}

/* ===== SIDEBAR ===== */

#sidebar {
  background-color: var(--bg-panel);
  border-right: 1px solid var(--border-soft);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  box-shadow: var(--shadow-soft);
}

/* Language switcher */

.language-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 14px; /* NOWE — odstęp pod przyciskami języka */
}

.lang-btn {
  padding: 4px 6px;
  font-size: 0.65rem;
  background-color: #20232f;
  color: #cccccc;
  border: 1px solid #333a4a;
  cursor: pointer;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lang-btn.active {
  background-color: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Profile */

.profile {
 /* border-bottom: 1px solid var(--border-soft);*/
  padding-bottom: 10px;
}

.profile-title {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.profile .name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent-warm);
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.cv-link {
  color: var(--accent-soft);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
}

.cv-link:hover {
  text-decoration: underline;
}

/* ===== TOC ===== */

#toc {
  font-size: 0.9rem;
}

.toc-section {
  margin-bottom: 10px;
}

.toc-toggle {
  width: 100%;
  text-align: left;
  background-color: #20232f;
  color: #f5f5f5;
  border: 1px solid #2f3545;
  padding: 6px 8px;
  cursor: pointer;
  font-weight: 500;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toc-toggle:hover {
  background-color: #262b3a;
}

/* ANIMOWANA PODLISTA */

.toc-sublist {
  list-style: none;
  margin-left: 8px;
  margin-top: 4px;

  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.toc-sublist li {
  margin: 2px 0;
}

.toc-sublist a {
  color: #cccccc;
  text-decoration: none;
  display: block;
  padding: 3px 6px;
  border-radius: 3px;
}

.toc-sublist a:hover {
  background-color: #2b3142;
  color: #aafc9b;
}

.toc-sublist.open {
  max-height: 500px; /* wystarczająco dużo dla każdej sekcji */
}

/* ===== CONTENT ===== */

#content {
  padding: 16px 20px;
  overflow-y: auto;
}

#content-inner {
  max-width: min(1200px, 90vw);
  margin: 0 auto;
}

#content-inner h1 {
  font-size: 1.8rem;
  color: var(--accent-soft);
}

#content-inner p {
  margin-bottom: 8px;
  line-height: 1.6;
  color: var(--text-main);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) {
  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  #sidebar {
    height: auto;
    max-height: 40vh;
  }

  #content {
    max-height: 60vh;
  }
}

/* ===== ARTICLE-SAFE GLOBALS ===== */

.article {
  max-width: 900px;
  margin: 0 auto;
}

/* ===== SPECIAL BUTTON (HOME) ===== */

.special-btn {
  background-color: #3b82f6;
  color: white;
  padding: 8px 10px;
  border-radius: 4px;
  margin-bottom: 10px;
  cursor: pointer;
  font-weight: 600;
  border: 1px solid #2f3545;
  width: 100%;
  text-align: left;
}

.special-btn:hover,
.special-btn.active {
  background-color: #5a98fa;
}

/* ===== CUSTOM SCROLLBAR (WEBKIT) ===== */

#sidebar::-webkit-scrollbar {
  width: 10px;
}

#sidebar::-webkit-scrollbar-track {
  background: #0f1118; /* ciemny, pasujący do tła */
  border-radius: 10px;
}

#sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #3b82f6, #5a98fa);
  border-radius: 10px;
  border: 2px solid #0f1118; /* lekki kontrast */
}

#sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #5a98fa, #7ab0ff);
}

/* ===== CUSTOM SCROLLBAR (FIREFOX) ===== */

#sidebar {
  scrollbar-width: thin;
  scrollbar-color: #142b50 #0f1118;
}


/* ===== CUSTOM SCROLLBAR FOR CONTENT (WEBKIT) ===== */

#content::-webkit-scrollbar {
  width: 12px;
}

#content::-webkit-scrollbar-track {
  background: #0c0e14; /* ciemny, ale inny niż sidebar */
  border-radius: 10px;
}

#content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #5a98fa, #3b82f6);
  border-radius: 10px;
  border: 2px solid #0c0e14; /* kontrast, lekko jaśniejszy niż sidebar */
}

#content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7ab0ff, #5a98fa);
}


/* ===== CUSTOM SCROLLBAR FOR CONTENT (FIREFOX) ===== */

#content {
  scrollbar-width: thin;
  scrollbar-color: #5a98fa #0c0e14;
}

/* ===== FIXED + SCROLLABLE SIDEBAR STRUCTURE ===== */

#sidebar {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.sidebar-fixed {
  padding: 12px;
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-soft);
  position: sticky;
  top: 0;
  z-index: 10;
}

.sidebar-scroll {
  padding: 12px;
  overflow-y: auto;
  flex-grow: 1;
}

/* separator */
.sidebar-separator {
  border: none;
  border-top: 1px solid var(--border-soft);
  margin-top: 10px;
}
