/* Logo – zawsze zachowuj proporçje (zapobiega zniekształceniu po sticky) */
.header-logo img {
    height: auto !important;
}

/* Mobile Header Improvements */
@media (max-width: 991px) {
    /* Ensure logo doesn't take too much space */
    .header-logo img {
        max-width: 180px !important;
        height: auto !important;
    }

    /* Adjust spacing for top nav icons */
    .header-nav-top .nav-link {
        padding: 0 5px !important;
    }

    /* Ensure menu toggle button is visible and positioned correctly */
    .header-btn-collapse-nav {
        margin-left: 10px;
    }
    
    /* Hide user name if it wasn't hidden by bootstrap classes */
    .header-nav-top .ws-nowrap {
        display: none;
    }

    /* MOBILE MENU - Complete Reset and Rebuild */
    
    /* Make header allow overflow */
    html body #header,
    html body #header .header-body,
    html body #header .header-container,
    html body #header .header-row,
    html body #header .header-column {
        overflow: visible !important;
    }

    /* Container needs to be relative */
    html body #header .header-body {
        position: relative !important;
    }

    /* Menu wrapper - absolute to header-body, full viewport width */
    html body #header .header-nav-main {
        position: absolute !important;
        top: 100% !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 100vw !important;
        background: #fff !important;
        z-index: 10000 !important;
        border-top: 3px solid #0088cc !important;
        box-shadow: 0 5px 20px rgba(0,0,0,0.1) !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide menu wrapper when nav is collapsed */
    html body #header .header-nav-main:not(:has(nav.show)):not(:has(nav.collapsing)) {
        display: none !important;
    }

    /* Nav element */
    html body #header .header-nav-main > nav {
        display: block !important;
        width: 100% !important;
        max-height: calc(100vh - 150px) !important;
        overflow-y: auto !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    /* Main menu list - RESET ALL BOOTSTRAP STYLES */
    html body #header .header-nav-main nav > ul.nav-pills {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
        float: none !important;
        flex-direction: column !important;
    }

    /* Menu items - RESET */
    html body #header .header-nav-main nav > ul.nav-pills > li {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        float: none !important;
        border-bottom: 1px solid #e9ecef !important;
    }

    html body #header .header-nav-main nav > ul.nav-pills > li:last-child {
        border-bottom: none !important;
    }

    /* Menu links - COMPLETE RESET OF BOOTSTRAP dropdown-item */
    html body #header .header-nav-main nav > ul.nav-pills > li > a.dropdown-item {
        display: block !important;
        width: 100% !important;
        padding: 20px 25px !important;
        margin: 0 !important;
        
        /* Reset Bootstrap dropdown-item styles */
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        
        /* Our styles */
        color: #2c3e50 !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        text-decoration: none !important;
        text-align: left !important;
        letter-spacing: 0.5px !important;
        
        white-space: normal !important;
        word-wrap: break-word !important;
        
        transition: all 0.2s ease !important;
        position: relative !important;
        cursor: pointer !important;
    }

    /* Hover state */
    html body #header .header-nav-main nav > ul.nav-pills > li > a.dropdown-item:hover {
        background: #f8f9fa !important;
        color: #0088cc !important;
        padding-left: 30px !important;
    }

    /* Active state */
    html body #header .header-nav-main nav > ul.nav-pills > li > a.dropdown-item.active {
        background: #f8f9fa !important;
        color: #0088cc !important;
        border-left: 4px solid #0088cc !important;
        padding-left: 21px !important;
    }

    /* Dropdown arrow */
    html body #header .header-nav-main nav > ul.nav-pills > li.dropdown > a.dropdown-toggle::after {
        content: '\f078' !important;
        font-family: 'Font Awesome 6 Free' !important;
        font-weight: 900 !important;
        float: right !important;
        margin-top: 0 !important;
        margin-left: 10px !important;
        font-size: 12px !important;
        transition: transform 0.3s ease !important;
        display: inline-block !important;
        border: none !important;
        background: none !important;
        color: inherit !important;
    }
    
    /* Rotate arrow when open */
    html body #header .header-nav-main nav > ul.nav-pills > li.dropdown.open > a.dropdown-toggle::after {
        transform: rotate(180deg) !important;
    }
    
    /* Remove Bootstrap default arrow/border */
    html body #header .header-nav-main nav > ul.nav-pills > li.dropdown > a.dropdown-toggle::before {
        display: none !important;
    }

    /* Submenu */
    html body #header .header-nav-main nav ul.dropdown-menu {
        position: static !important;
        display: none !important;
        width: 100% !important;
        float: none !important;
        border: none !important;
        box-shadow: none !important;
        background: #f1f3f5 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    html body #header .header-nav-main nav li.dropdown.open > ul.dropdown-menu {
        display: block !important;
    }

    html body #header .header-nav-main nav ul.dropdown-menu > li {
        display: block !important;
        width: 100% !important;
    }

    html body #header .header-nav-main nav ul.dropdown-menu > li > a.dropdown-item {
        display: block !important;
        padding: 15px 25px 15px 45px !important;
        background: transparent !important;
        color: #495057 !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        text-transform: none !important;
        border-bottom: 1px solid #dee2e6 !important;
    }

    html body #header .header-nav-main nav ul.dropdown-menu > li:last-child > a.dropdown-item {
        border-bottom: none !important;
    }

    html body #header .header-nav-main nav ul.dropdown-menu > li > a.dropdown-item:hover {
        background: #fff !important;
        color: #0088cc !important;
        padding-left: 50px !important;
    }
}
/* Remove text-transform uppercase from all H3 headings globally */
h3 {
    text-transform: none !important;
}

/* Fix Bootstrap row overflow inside columns */
.module-columns.row {
    margin-left: 0;
    margin-right: 0;
}

.module-columns > [class*='col-'] {
    padding-left: 15px;
    padding-right: 15px;
}

/* Table of Contents - highlight active link */
.toc-navigation .nav-link.active {
    font-weight: 700 !important;
    color: #0088cc !important;
}

.toc-navigation .nav-link {
    transition: all 0.2s ease;
}

/* Page Header - Blue Bottom Border (like Porto template) */
.page-header.page-header-classic {
    position: relative;
}

/* Gray background line on full width */
.page-header.page-header-classic::after {
    content: '';
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    left: 0;
}

/* Blue line that matches title width */
.page-header.page-header-classic .page-header-title-border {
    width: 0;
    height: 5px;
    position: absolute;
    bottom: 0;
    background: #0088cc;
    z-index: 1;
    transition: width 0.5s ease;
}

.page-header.page-header-classic .page-header-title-border.visible {
    width: auto;
}
