/* =========================================================
   HEADER.CSS — wspólny nagłówek zalogowanej części serwisu
========================================================= */

body:not(.seo-home) > header {
    position: relative;
    z-index: 1000;
    min-height: 70px;
    padding:
        env(safe-area-inset-top)
        max(20px, env(safe-area-inset-right))
        0
        max(20px, env(safe-area-inset-left));
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    border-bottom: 1px solid #222;
    background: var(--header-bg, #0a0a0a);
    color: var(--header-text, #fff);
}

body:not(.seo-home) > header *,
body:not(.seo-home) > header *::before,
body:not(.seo-home) > header *::after {
    box-sizing: border-box;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
}

.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
}

.header-logo-link {
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    text-decoration: none;
}

.header-logo-img {
    width: auto;
    height: 45px;
    display: block;
    filter: drop-shadow(0 0 8px rgba(57, 255, 20, 0.6));
    transition: transform 0.2s ease;
}

.header-logo-text {
    margin: 0;
    color: #fff;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
    transition: color 0.2s ease;
}

.header-logo-link:hover .header-logo-img {
    transform: scale(1.08);
}

.header-logo-link:hover .header-logo-text {
    color: #39ff14;
}

.nav-buttons {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 0;
}

.przycisk-menu {
    position: relative;
    padding: 0 25px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0 !important;
    border-right: 1px solid #222 !important;
    border-radius: 0;
    background: transparent !important;
    color: #fff !important;
    box-shadow: none !important;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.2s ease, background 0.2s ease;
}

.przycisk-menu:first-child {
    border-left: 1px solid #222 !important;
}

.przycisk-menu:hover,
.przycisk-menu.przycisk-aktywny {
    background: rgba(255, 255, 255, 0.03) !important;
    color: #39ff14 !important;
}

.przycisk-menu::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #39ff14;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.2s ease;
}

.przycisk-menu:hover::after,
.przycisk-menu.przycisk-aktywny::after {
    transform: scaleX(1);
}

.header-right-flex {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-buycoffee {
    display: inline-flex;
    align-items: center;
}

.header-buycoffee img {
    width: auto;
    height: 38px;
    display: block;
    transition: transform 0.2s ease;
}

.header-buycoffee:hover img {
    transform: scale(1.05);
}

.user-dropdown-container {
    position: relative;
}

.user-profile-btn {
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #444;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.user-profile-btn:hover {
    border-color: #39ff14;
    background: rgba(255, 255, 255, 0.05);
}

.user-profile-btn > i {
    margin: 0 !important;
    color: #fff !important;
}

.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 9999;
    width: 260px;
    margin-top: 10px;
    display: none;
    overflow: hidden;
    border: 1px solid #2d2d2d;
    border-radius: 12px;
    background: #121417;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.72);
}

.user-dropdown-menu.active {
    display: block;
}

.dropdown-header {
    min-height: 66px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #292c31;
    background: #17191d;
}

.zalogowany-tekst {
    display: block;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
}

.user-name-dropdown {
    display: block;
    margin-top: 3px;
    color: #9298a1;
    font-size: 12px;
    line-height: 1.25;
}

.close-dropdown {
    width: 30px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex: 0 0 30px;
    border: 0 !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: #fff;
    cursor: pointer;
}

.close-dropdown:hover {
    background: #24272c !important;
}

.close-dropdown > i {
    margin: 0 !important;
    color: #fff !important;
    font-size: 17px !important;
    line-height: 1 !important;
}

.user-dropdown-menu > a {
    min-height: 48px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid #292c31;
    color: #f2f2f2;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.user-dropdown-menu > a:last-child {
    border-bottom: 0;
}

.user-dropdown-menu > a:hover {
    background: #1b1e22;
    color: #fff;
}

.user-dropdown-menu > a > i {
    width: 18px;
    min-width: 18px;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #f2f2f2 !important;
    font-size: 14px !important;
    line-height: 1 !important;
}

.user-dropdown-menu > a.logout-link,
.user-dropdown-menu > a.logout-link > i {
    color: #ff5a5a !important;
}

.user-dropdown-menu > a.logout-link:hover {
    background: rgba(255, 90, 90, 0.08);
    color: #ff7272 !important;
}

.user-dropdown-notifications > span:first-of-type {
    min-width: 0;
    flex: 1;
}

.user-dropdown-notification-count {
    min-width: 20px;
    height: 20px;
    margin-left: auto;
    padding: 0 6px;
    display: inline-grid;
    place-items: center;
    border-radius: 999px;
    background: #ff4d4d;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
}

@media (max-width: 950px) {
    body:not(.seo-home) > header {
        min-height: auto;
        padding:
            calc(12px + env(safe-area-inset-top))
            max(10px, env(safe-area-inset-right))
            12px
            max(10px, env(safe-area-inset-left));
        flex-direction: column;
        gap: 15px;
    }

    .header-left,
    .header-center,
    .header-right-flex {
        width: 100%;
        justify-content: center;
    }

    .nav-buttons {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }

    .przycisk-menu {
        min-height: 40px;
        padding: 10px 12px;
        flex: 1 1 auto;
        border: 1px solid #2b2b2b !important;
        border-radius: 6px;
        font-size: 11px;
    }

    .przycisk-menu::after {
        display: none;
    }
}

@media (max-width: 560px) {
    .header-logo-img {
        height: 40px;
    }

    .header-logo-text {
        font-size: 20px;
    }

    .header-right-flex {
        gap: 9px;
        flex-wrap: wrap;
    }

    .header-buycoffee img {
        height: 36px;
    }

    .user-profile-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .user-dropdown-menu {
        position: fixed;
        top: auto;
        right: 10px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        left: 10px;
        width: auto;
        max-height: calc(100vh - 20px);
        overflow-y: auto;
        margin: 0;
    }
}

/* =========================================================
   V18 — kolorowe ikony w menu użytkownika
========================================================= */
.user-dropdown-menu > a:nth-of-type(1) > i {
    color: #38bdf8 !important;
}

.user-dropdown-menu > a:nth-of-type(2) > i {
    color: #39ff14 !important;
}

.user-dropdown-menu > a:nth-of-type(3) > i {
    color: #a78bfa !important;
}

.user-dropdown-menu > a.logout-link > i {
    color: #ff5a5a !important;
}


/* Reguły przeniesione z header.php */
.user-dropdown-notifications {
        position: relative;
    }

    .user-dropdown-notifications > i {
        margin-right: 8px;
    }

    .user-dropdown-notifications > span:first-of-type {
        flex: 1;
    }

    .user-dropdown-notification-count {
        min-width: 20px;
        height: 20px;
        padding: 0 6px;
        display: inline-grid;
        place-items: center;
        margin-left: auto;
        border-radius: 999px;
        background: #ff4d4d;
        color: #fff;
        font-size: 10px;
        font-weight: 900;
        line-height: 1;
    }

/* V28 — branding: „Twój” biały, „Mecz” zielony */
.header-logo-text {
    color: #fff !important;
}

.header-logo-text > span {
    color: #39ff14;
}

.header-logo-link:hover .header-logo-text {
    color: #fff !important;
}

.header-logo-link:hover .header-logo-text > span {
    color: #63ff46;
}
