/* =========================================
   1. ZMIENNE I KONFIGURACJA PODSTAWOWA
   ========================================= */
:root {
    --color-primary-brown: #593C1E;
    --color-bg-body:       #69503c;
    --color-bg-light:      #F8F8F8;
    --color-bg-white:      #FFFFFF;
    
    --color-text-main:     #000000;
    --color-text-body:     #333333;
    --color-text-white:    #FFFFFF;
    --color-error:         #cc0000;

    --banner-gradient-start: rgba(249,247,247,1);
    --banner-gradient-end:   #593C1E;
    
    --transition-speed: 0.3s;
}

* { box-sizing: border-box; }

body {
    font-family: "Open Sans", sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--color-bg-body);
    color: var(--color-text-body);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* =========================================
   2. GŁÓWNY KONTENER I NAGŁÓWEK
   ========================================= */
#container {
    width: 1600px;
    margin: 120px auto 100px auto;
    background-color: var(--color-bg-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-radius: 4px; 
    overflow: hidden;
}

#header {
    /* --- ZMIANA: Ścieżka img/baner-pc.jpg --- */
    background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('img/baner-pc.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 160px;
    text-align: center;
    padding: 20px;
    position: relative;
}

#header h1 {
    margin: 0;
    font-size: 2.6em; 
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
}

/* Ustawienie domyślne dla spanów w nagłówku (Desktop) - w jednej linii */
#header h1 span {
    display: inline;
}

#mobile-nav-bar {
    display: none;
    justify-content: space-between;
    background-color: var(--color-primary-brown);
    padding: 10px;
}

.mobile-btn {
    background: none;
    border: 2px solid #fff;
    color: #fff;
    padding: 8px 15px;
    font-weight: bold;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px; 
}

.close-panel-btn {
    display: none; 
    width: 100%;
    background-color: #ddd;
    border: none;
    padding: 10px;
    margin-bottom: 15px;
    font-weight: bold;
    cursor: pointer;
    text-align: right;
    color: #333;
}

#overlay-bg {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 998;
}
#overlay-bg.active { display: block; }


#content-area {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    padding: 20px 0;
}

/* =========================================
   3. LEWE MENU (NAWIGACJA)
   ========================================= */
#left-menu {
    width: 300px;
    background-color: var(--color-bg-light);
    border-right: 1px solid #e0e0e0;
    padding: 0 10px 0 15px;
    transition: transform 0.3s ease;
}

#left-menu ul { list-style: none; padding: 0; margin: 0; }
#left-menu li { margin-bottom: 10px; }

#left-menu li a {
    display: flex;
    align-items: center; 
    padding: 12px 15px;
    text-decoration: none;
    color: var(--color-primary-brown);
    background-color: var(--color-bg-light);
    border-left: 5px solid var(--color-primary-brown);
    font-weight: bold;
    font-size: 0.9em;
    border-top-right-radius: 5px;
    border-bottom-right-radius: 5px;
    padding-left: 10px;
    transition: all var(--transition-speed) ease;
    position: relative;
    line-height: 1.4; 
}

.menu-label-container {
    display: flex;
    align-items: center;
}

#left-menu li a i {
    width: 25px; 
    text-align: center;
    margin-right: 8px;
    font-size: 1.1em;
    flex-shrink: 0; 
}

#left-menu li a.active {
    background-color: var(--color-primary-brown);
    color: var(--color-text-white);
    border-left-color: #3a2510;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.2);
}

#left-menu li a:hover {
    background-color: var(--color-primary-brown);
    color: var(--color-text-white);
    padding-left: 20px;
    transform: translateX(5px);
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
}

.submenu-toggle {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.multiline-text {
    display: block;
}

#arrow {
    font-size: 0.8em;
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    margin-left: 10px;
}
#arrow.rotated { transform: rotate(180deg); }

#submenu-standardy {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: #e8e8e8;
    border-radius: 5px;
    transition: max-height 0.5s ease-in-out, opacity 0.5s ease-in-out, margin-top 0.3s ease;
}

#submenu-standardy.open {
    max-height: 500px;
    opacity: 1;
    margin-top: 5px;
}

#submenu-standardy li { margin-bottom: 0; border-bottom: 1px solid #d1d1d1; }

#submenu-standardy li a {
    padding: 10px 10px 10px 30px !important;
    font-size: 0.85em !important;
    font-weight: normal !important;
    background-color: transparent !important;
    border-left: 3px solid #bbb !important;
    border-radius: 0 !important;
    color: #444 !important;
    transition: background-color 0.2s, color 0.2s !important;
    display: block !important; 
}

#submenu-standardy li a.active {
    background-color: #dcdcdc !important;
    color: var(--color-primary-brown) !important;
    border-left-color: var(--color-primary-brown) !important;
    font-weight: bold !important;
}

#submenu-standardy li a:hover {
    transform: none !important; 
    padding-left: 30px !important;
    background-color: #dcdcdc !important;
    border-left-color: var(--color-primary-brown) !important;
    color: var(--color-primary-brown) !important;
}

/* =========================================
   4. ŚRODEK 
   ========================================= */
#main-content {
    flex-grow: 1;
    background-color: var(--color-bg-white);
    padding: 0;
    margin: 0 10px;
    min-height: 800px;
    position: relative;
    overflow-x: hidden; 
}

.canvas-container {
    text-align: center;
    padding: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    width: 100%;
    font-size: 0; 
    line-height: 0;
}
.canvas-container.loaded { opacity: 1; }

.pdf-page-canvas {
    border: none;
    box-shadow: none; 
    max-width: 100%;
    height: auto;
    margin-bottom: 0;
    margin-top: 0;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.loader-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 50px;
    line-height: normal; 
}
.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--color-primary-brown);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.error-message-box { text-align: center; padding: 40px 20px; line-height: normal; font-size: 1rem; }
.error-title { color: var(--color-error); font-weight: bold; font-size: 1.2em; }

/* =========================================
   5. PRAWE MENU INFORMACYJNE
   ========================================= */
#right-info-menu {
    width: 440px;
    background-color: var(--color-bg-light);
    border-left: 1px solid #e0e0e0;
    padding: 0 15px;
    transition: transform 0.3s ease;
}

.info-box {
    background-color: var(--color-bg-white);
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    margin-bottom: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.info-box h2 {
    background-color: var(--color-primary-brown);
    color: var(--color-text-white);
    padding: 12px 15px;
    margin: 0;
    text-align: center;
    font-size: 1.3em; 
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.info-box-content {
    padding: 10px;
    line-height: 1.6;
    text-align: center;
    font-size: 0.95em; 
}

.info-box-content i {
    color: var(--color-primary-brown);
    margin-right: 5px;
    width: 15px;
}

.info-box-content strong.highlight { font-size: 1.2em; }
.info-box-content strong.small-highlight { font-size: 0.85em; }

/* PRZYCISK KOPIOWANIA */
.copy-trigger {
    cursor: pointer;
    border-bottom: 1px dashed #ccc; 
    transition: all 0.2s ease;
    padding: 2px 5px;
    border-radius: 4px;
}

.copy-trigger:hover {
    background-color: #f0e6dd;
    color: var(--color-primary-brown);
}

.copy-trigger:active {
    background-color: #e0d0c0;
}

.info-box-content a {
    color: var(--color-primary-brown);
    text-decoration: underline;
    transition: color 0.2s;
}
.info-box-content a:hover { color: #8a6238; }

#footer {
    clear: both;
    width: 100%;
    background-color: var(--color-primary-brown);
    color: var(--color-text-white);
    text-align: center;
    padding: 20px 0;
    font-size: 0.9em;
    font-weight: bold;
    margin-top: 0;
}

/* TOAST */
#copy-toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 5px;
    padding: 16px;
    position: fixed;
    z-index: 10000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.3s, bottom 0.3s;
}

#copy-toast.show {
    visibility: visible;
    opacity: 1;
    bottom: 50px;
}


/* =========================================
   7. RESPANSYWNOŚĆ
   ========================================= */

@media screen and (max-width: 1650px) {
    #container { width: 1200px; }
    #left-menu { width: 250px; }
    #right-info-menu { width: 340px; }
    #header h1 { font-size: 2.2em; }
}

@media screen and (max-width: 1000px) {
    #container { width: 100%; margin: 0; box-shadow: none; border-radius: 0; }
    
    #header { 
        height: auto; 
        padding: 15px;
        /* --- ZMIANA: Ścieżka img/baner-mobile.jpg --- */
        background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('img/baner-mobile.jpg');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }
    
    #header h1 { font-size: 1.2em; }
    
    #header h1 span {
        display: block;
        margin: 5px 0;
    }

    #mobile-nav-bar { display: flex; }
    #content-area { flex-direction: column; margin-top: 0; padding: 0; position: relative; }

    #left-menu {
        position: fixed; top: 0; left: 0; height: 100%; width: 80%; max-width: 320px;
        background-color: #fff; z-index: 999; border-right: 1px solid #ccc;
        box-shadow: 5px 0 15px rgba(0,0,0,0.3);
        transform: translateX(-100%); padding-top: 20px; overflow-y: auto;
    }
    #left-menu.active { transform: translateX(0); }

    #right-info-menu {
        position: fixed; top: 0; right: 0; height: 100%; width: 80%; max-width: 320px;
        background-color: #fff; z-index: 999; border-left: 1px solid #ccc;
        box-shadow: -5px 0 15px rgba(0,0,0,0.3);
        transform: translateX(100%); padding-top: 20px; overflow-y: auto;
    }
    #right-info-menu.active { transform: translateX(0); }

    #main-content { margin: 0; padding: 0; width: 100%; min-height: auto; }
    .close-panel-btn { display: block; }
}