/* ===== ZMIENNE KOLORÓW - MOTYW JASNY (DOMYŚLNY) ===== */
:root {
    --primary: #1e5c3d;
    --primary-light: #2d8a6c;
    --primary-dark: #0f3d24;
    --accent: #e8753f;
    --success: #27ae60;
    --warning: #f39c12;
    --error: #e74c3c;
    --info: #3498db;

    /* Ogólne kolory tła i tekstu */
    --bg-color: #f5f5f5;
    --surface-color: #ffffff;
    --text-color: #2c3e50;
    --text-secondary-color: #7f8c8d;
    --border-color: #ecf0f1;

    /* Kolory specyficzne dla komponentów */
    --header-bg: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    --header-text: white;
    --nav-btn-bg: rgba(255, 255, 255, 0.2);
    --nav-btn-border: white;
    --nav-btn-text: white;
    --nav-btn-hover-bg: white;
    --nav-btn-hover-text: var(--primary);
    --nav-btn-current-bg: var(--accent);
    --nav-btn-current-border: var(--accent);
    --card-title: var(--primary);
    --table-header-bg: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    --table-header-text: white;
    --table-row-hover-bg: var(--bg-color);
    --stat-value: var(--primary);
    --code-bg: var(--bg-color);
    --code-text: var(--error);
    --scrollbar-thumb: var(--border-color);
    --scrollbar-thumb-hover: var(--text-secondary-color);
}

/* ===== ZMIENNE KOLORÓW - MOTYW CIEMNY ===== */
html[data-color-scheme="dark"] {
    --primary: #1e5c3d;
    --primary-light: #2d8a6c;
    --primary-dark: #0f3d24;
    --accent: #e8753f;
    --success: #2ecc71;
    --warning: #f1c40f;
    --error: #e74c3c;
    --info: #3498db;

    /* Ogólne kolory tła i tekstu */
    --bg-color: #212121;
    --surface-color: #333333;
    --text-color: #e0e0e0;
    --text-secondary-color: #a0a0a0;
    --border-color: #555555;

    /* Kolory specyficzne dla komponentów */
    --header-bg: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-light) 100%);
    --header-text: var(--text-color);
    --nav-btn-bg: var(--surface-color);
    --nav-btn-border: var(--border-color);
    --nav-btn-text: var(--text-color);
    --nav-btn-hover-bg: #444444;
    --nav-btn-hover-text: var(--text-color);
    --nav-btn-current-bg: var(--accent);
    --nav-btn-current-border: var(--accent);
    --card-title: var(--primary-light);
    --table-header-bg: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
    --table-header-text: var(--text-color);
    --table-row-hover-bg: #2a2a2a;
    --stat-value: var(--primary-light);
    --code-bg: var(--surface-color);
    --code-text: var(--accent);
    --scrollbar-thumb: var(--border-color);
    --scrollbar-thumb-hover: var(--text-secondary-color);
}

/* ===== RESET ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.app-header {
    background: var(--header-bg);
    color: var(--header-text);
    padding: 15px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border-bottom: 4px solid var(--accent);
    transition: background 0.3s ease, color 0.3s ease, border-bottom-color 0.3s ease;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-content {
    margin-right: 20px;
    flex-shrink: 0;
    flex-grow: 1; 
}

.header-content h1 {
  font-size: 28px;
  margin-bottom: 6px;
  font-weight: 700;
}
.header-content p {
  font-size: 14px;
  opacity: 0.9;
}

.nav-buttons {
    display: flex;
    gap: 12px;
    margin-top: 0;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-right: 70px;
    flex-shrink: 0;
}

.nav-btn {
    padding: 10px 18px;
    background: var(--nav-btn-bg);
    border: 2px solid var(--nav-btn-border);
    color: var(--nav-btn-text);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.nav-btn:hover {
    background: var(--nav-btn-hover-bg);
    color: var(--nav-btn-hover-text);
}

.nav-btn.current {
    background: var(--nav-btn-current-bg);
    border-color: var(--nav-btn-current-border);
    color: white;
}

/* Theme Toggle Button */
#themeToggle {
    position: absolute;
    top: 24px;
    right: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 24px;
    z-index: 10;
    color: var(--header-text);
    transition: color 0.3s ease;
    padding: 4px;
    border-radius: 6px;
}

#themeToggle:hover {
    opacity: 0.8;
}

#themeToggle:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ===== CONTAINER ===== */
.container {
    display: flex;
    min-height: calc(100vh - 150px);
    gap: 0;
    max-width: 1800px;
    margin: 0 auto;
    width: 100%;
}

/* ===== SIDEBAR (Menu) ===== */
.sidebar {
    width: 280px;
    background: var(--surface-color);
    border-right: 2px solid var(--border-color);
    padding: 32px 0;
    position: sticky;
    top: 86px;
    height: calc(100vh - 86px);
    overflow-y: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.sidebar nav ul {
    list-style: none;
}

.sidebar nav li {
    margin: 0;
}

.sidebar nav a {
    display: block;
    padding: 16px 24px;
    color: var(--text-color);
    text-decoration: none;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 14px;
}

.sidebar nav a:hover {
    background-color: var(--bg-color);
    border-left-color: var(--accent);
    color: var(--accent);
}

.sidebar nav a.active {
    background-color: var(--bg-color);
    border-left-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

/* ===== MAIN CONTENT ===== */
main {
    flex: 1;
    padding: 32px;
    background: var(--surface-color);
    overflow-y: auto;
    transition: background-color 0.3s ease;
}

section {
    margin-bottom: 48px;
    scroll-margin-top: 100px;
}

/* ===== HEADINGS ===== */
h2 {
    color: var(--card-title);
    font-size: 28px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 3px solid var(--accent);
    padding-bottom: 12px;
    font-weight: 700;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

h3 {
    color: var(--accent);
    font-size: 22px;
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    transition: color 0.3s ease;
}

p {
    /* color: var(--text-secondary-color);*/
    margin-bottom: 16px;
    line-height: 1.6;
    transition: color 0.3s ease;
}

/* ===== CARDS ===== */
.card {
    background: var(--surface-color);
    border-left: 4px solid var(--primary);
    border: 2px solid var(--border-color);
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.card strong {
    color: var(--card-title);
    font-weight: 600;
    transition: color 0.3s ease;
}

/* ===== TABLES ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--border-color);
}

thead {
    background: var(--table-header-bg);
    color: var(--table-header-text);
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    transition: background-color 0.3s ease;
}

td {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    transition: border-bottom-color 0.3s ease, background-color 0.3s ease;
}

tbody tr:hover {
    background-color: var(--table-row-hover-bg);
}

tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

html[data-color-scheme="dark"] tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

/* ===== INFO BOX (with icons) ===== */
.info-box {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    padding: 20px;
    background: var(--bg-color);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.info-box:hover {
    border-color: var(--primary);
}

.info-box-icon {
    font-size: 32px;
    min-width: 60px;
    text-align: center;
    color: var(--accent);
    transition: color 0.3s ease;
}

.info-box-content {
    flex: 1;
}

.info-box-content strong {
    color: var(--card-title);
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 16px;
    transition: color 0.3s ease;
}

/* ===== LISTS ===== */
ul, ol {
    margin-left: 24px;
    margin-bottom: 16px;
}

li {
    margin-bottom: 8px;
    color: var(--text-secondary-color);
    transition: color 0.3s ease;
}

/* ===== CODE BLOCKS ===== */
code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    color: var(--code-text);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

pre {
    background: var(--surface-color);
    color: var(--text-color);
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin-bottom: 20px;
    border: 2px solid var(--border-color);
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ===== FAQ ===== */
.faq-item {
    margin-bottom: 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question {
    background: var(--bg-color);
    padding: 18px 20px;
    cursor: pointer;
    font-weight: 600;
    color: var(--card-title);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease, color 0.3s ease;
    user-select: none;
}

.faq-question:hover {
    background: var(--surface-color);
}

.faq-question:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.faq-answer {
    padding: 20px;
    display: none;
    background: var(--surface-color);
    color: var(--text-secondary-color);
    border-top: 1px solid var(--border-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.faq-item.active .faq-answer {
    display: block;
}

.faq-toggle {
    font-size: 24px;
    transition: transform 0.3s ease;
    color: var(--accent);
    font-weight: 700;
}

.faq-item.active .faq-toggle {
    transform: rotate(45deg);
}

/* ===== FOOTER (zgodny ze style.css) ===== */
.app-footer {
    background-color: var(--surface-color);
    border-top: 2px solid var(--border-color);
    padding: 20px 24px;
    text-align: center;
    font-size: 12px;
    color: var(--text-secondary-color);
    transition: background-color 0.3s ease, border-top-color 0.3s ease, color 0.3s ease;
    margin-top: auto;
    flex-shrink: 0;
}

.app-footer p {
    color: var(--text-secondary-color);
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.app-footer p:last-child {
    margin-bottom: 0;
    font-size: 11px;
    opacity: 0.8;
}

.app-footer a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.app-footer a:hover {
    color: var(--accent);
}

.app-footer a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 99;
}

.back-to-top:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.back-to-top:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.back-to-top.show {
    display: flex;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .app-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px;
    }

    .header-content {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100%;
    }

    .nav-buttons {
        width: 100%;
        justify-content: flex-start;
        margin-right: 0;
    }

    #themeToggle {
        top: 16px;
        right: 16px;
        font-size: 20px;
    }

    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: static;
        border-right: none;
        border-bottom: 2px solid var(--border-color);
        padding: 16px 0;
    }

    .sidebar nav ul {
        display: flex;
        flex-wrap: wrap;
    }

    .sidebar nav li {
        flex: 1;
        min-width: 150px;
    }

    .sidebar nav a {
        padding: 12px 16px;
        border-left: none;
        border-bottom: 3px solid transparent;
        text-align: center;
    }

    .sidebar nav a:hover,
    .sidebar nav a.active {
        border-bottom-color: var(--primary);
        border-left: none;
    }

    main {
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .header-content h1 {
        font-size: 20px;
    }

    h2 {
        font-size: 22px;
    }

    h3 {
        font-size: 18px;
    }

    main {
        padding: 20px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 12px;
    }

    .sidebar nav a {
        padding: 8px 12px;
        font-size: 13px;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 20px;
    }

    .info-box {
        flex-direction: column;
        align-items: flex-start;
    }

    .info-box-icon {
        font-size: 36px;
        margin-bottom: 8px;
    }

    #themeToggle {
        top: 12px;
        right: 12px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .app-header {
        padding: 12px;
    }

    .header-content h1 {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .header-content p {
        font-size: 12px;
    }

    main {
        padding: 16px;
    }

    h2 {
        font-size: 20px;
        margin-bottom: 16px;
    }

    h3 {
        font-size: 16px;
    }

    section {
        margin-bottom: 32px;
    }

    .card {
        padding: 16px;
    }

    table {
        font-size: 11px;
    }

    th, td {
        padding: 8px;
    }

    .app-footer {
        padding: 16px;
    }

    .app-footer p {
        font-size: 11px;
    }

    .app-footer p:last-child {
        font-size: 10px;
    }

    #themeToggle {
        font-size: 18px;
    }

    .sidebar nav a {
        padding: 12px 8px;
        font-size: 12px;
    }

    .back-to-top {
        bottom: 16px;
        right: 16px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .info-box {
        padding: 16px;
    }

    .info-box-content strong {
        margin-bottom: 4px;
        font-size: 14px;
    }

    .faq-question,
    .faq-answer {
        padding: 14px 16px;
    }

    ul, ol {
        margin-left: 16px;
    }

    .nav-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}