/**
 * Style dla headera - Nowoczesny design deweloperski
 */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   HEADER
   ============================================ */
.site-header {
    position: relative;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    gap: 24px;
}

/* ============================================
   LOGO
   ============================================ */
.site-branding {
    flex-shrink: 0;
}

.site-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: opacity 0.15s ease;
}

.site-logo:hover {
    opacity: 0.8;
}

.site-title {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    letter-spacing: -0.5px;
    margin: 0;
}

/* ============================================
   MENU
   ============================================ */
.main-navigation {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-navigation .menu {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-direction: row;
}

.main-navigation .menu li {
    margin: 0;
    padding: 0;
}

.main-navigation .menu a {
    display: block;
    padding: 10px 16px;
    color: #6b7280;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.main-navigation .menu a:hover,
.main-navigation .menu .current-menu-item>a,
.main-navigation .menu .current_page_item>a {
    color: #1a1a1a;
    background-color: #f8f9fa;
}

/* ============================================
   USER MENU
   ============================================ */
.header-user {
    flex-shrink: 0;
    position: relative;
}

.header-user-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: #6b7280;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.15s ease;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    cursor: pointer;
    font-family: inherit;
}

.header-user-link:hover {
    color: #1a1a1a;
    background: #f8f9fa;
    border-color: #d1d5db;
}

.header-user-link[aria-expanded="true"] {
    background: #f8f9fa;
    border-color: #d1d5db;
}

.header-user-icon {
    font-size: 18px;
    line-height: 1;
}

.header-user-name {
    display: none;
}

.header-user-arrow {
    font-size: 10px;
    transition: transform 0.15s ease;
    margin-left: 4px;
}

.header-user-link[aria-expanded="true"] .header-user-arrow {
    transform: rotate(180deg);
}

@media (min-width: 768px) {
    .header-user-name {
        display: inline;
    }
}

/* Dropdown menu użytkownika */
.header-user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    padding: 8px 0;
    pointer-events: none;
}

.header-user-dropdown.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.header-user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #374151;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.15s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
}

.header-user-dropdown-item:hover {
    background: #f8f9fa;
    color: #1a1a1a;
}

.header-user-dropdown-item.header-user-logout {
    color: #dc2626;
    border-top: 1px solid #f3f4f6;
    margin-top: 4px;
    padding-top: 12px;
}

.header-user-dropdown-item.header-user-logout:hover {
    background: #fee2e2;
    color: #991b1b;
}

.header-user-dropdown-icon {
    font-size: 16px;
    line-height: 1;
    width: 20px;
    text-align: center;
}

/* ============================================
   MOBILE MENU TOGGLE
   ============================================ */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: transparent;
    border: none;
    padding: 8px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    justify-content: center;
    align-items: center;
}

.menu-close {
    display: none;
}

.menu-title {
    display: none;
}

.menu-header {
    display: none;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: all 0.15s ease;
}

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ============================================
   RESPONSYWNOŚĆ
   ============================================ */
@media (max-width: 768px) {
    .header-content {
        padding: 12px 0;
        position: relative;
    }

    .menu-toggle {
        display: flex;
        order: 3;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(4px);
        max-height: 100vh;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: 9999;
        display: flex;
        align-items: flex-start;
        justify-content: flex-end;
        padding: 0;
    }

    .main-navigation.active {
        opacity: 1;
        visibility: visible;
    }

    .main-navigation .menu-wrapper {
        display: flex;
        flex-direction: column;
        background: #ffffff;
        width: 280px;
        max-width: 85vw;
        height: 100vh;
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow: hidden;
        padding-bottom: 80px;
    }

    .main-navigation.active .menu-wrapper {
        transform: translateX(0);
    }

    /* Top bar z Menu i X - widoczny tylko na mobile */
    .menu-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 20px;
        border-bottom: 1px solid #e5e7eb;
    }

    .menu-title {
        display: block;
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        color: #1a1a1a;
    }

    .menu-close {
        display: flex;
        width: 32px;
        height: 32px;
        background: transparent;
        border: 1px solid #e5e7eb;
        border-radius: 6px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        color: #1a1a1a;
        font-size: 24px;
        padding: 0;
        transition: all 0.15s ease;
    }

    .menu-close:hover {
        color: #61FF71;
        background: #f8f9fa;
        border-color: #61FF71;
    }

    /* Pozycje menu w kolumnie */
    .main-navigation .menu {
        flex: 1;
        overflow-y: auto;
        padding: 0;
        margin: 0;
        list-style: none;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .main-navigation .menu li {
        border-bottom: 1px solid #f3f4f6;
        margin: 0;
        width: 100%;
    }

    .main-navigation .menu li:last-child {
        border-bottom: none;
    }

    .main-navigation .menu a {
        padding: 16px 20px;
        border-radius: 0;
        color: #1a1a1a;
        font-size: 15px;
        font-weight: 500;
        display: block;
        transition: background-color 0.15s ease;
    }

    .main-navigation .menu a:hover,
    .main-navigation .menu .current-menu-item>a,
    .main-navigation .menu .current_page_item>a {
        background-color: #f8f9fa;
        color: #1a1a1a;
    }

    /* Zamknij menu po kliknięciu w tło */
    .main-navigation::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: transparent;
    }

    .site-title {
        font-size: 20px;
    }

    /* Ukryj user menu na mobile w headerze */
    .header-user {
        display: none;
    }

    /* Opcja wylogowania w menu mobile */
    .menu-logout {
        display: block;
        border-top: 1px solid #e5e7eb;
        margin-top: auto;
        padding-top: 16px;
        margin-bottom: 0;
    }

    .menu-logout-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 16px 20px;
        color: #dc2626;
        text-decoration: none;
        font-size: 15px;
        font-weight: 500;
        transition: background-color 0.15s ease;
    }

    .menu-logout-link:hover {
        background: #fee2e2;
        color: #991b1b;
    }

    .menu-logout-icon {
        font-size: 18px;
        line-height: 1;
    }
}

/* Ukryj opcję wylogowania w menu na desktopie */
@media (min-width: 769px) {
    .menu-logout {
        display: none !important;
    }
}

/* ============================================
   DODATKOWE STYLE
   ============================================ */
.site-content {
    margin: 0;
    padding: 0;
}