/**
 * Style komponentow auth (przycisk Zaloguj, avatar, dropdown).
 * Paleta: navy #1a2332, gold #d4af37, blue #1a4c8b.
 */

/* Zapobiega lamaniu chevronu w pozycjach menu z dropdown na osobny wiersz
   (np. "Strefa kibica v" powinno byc razem na jednej linii) */
nav .menu > li > a {
    white-space: nowrap;
}

.auth-slot {
    position: relative;
    display: flex;
    align-items: center;
    margin-right: 0.35rem;
}

/* === Przycisk "Zaloguj się" === */
.auth-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border-radius: 999px;
    background: rgba(212, 175, 55, 0.12);
    color: #d4af37;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    border: 1px solid rgba(212, 175, 55, 0.4);
    transition: background-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
    white-space: nowrap;
}
.auth-button:hover,
.auth-button:focus-visible {
    background: #d4af37;
    color: #1a2332;
    outline: none;
}
.auth-button i {
    font-size: 1rem;
}

/* Wąski desktop / tablet poziomo (~1024-1200px) - skróć tekst do ikony,
   zeby menu mieściło sie w jednym wierszu obok wszystkich pozycji */
@media (max-width: 1200px) {
    .auth-button span {
        display: none;
    }
    .auth-button {
        padding: 0.4rem 0.55rem;
    }
    .auth-button i {
        font-size: 1.15rem;
    }
}

/* === Avatar (zalogowany) === */
.auth-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.5);
    background: #1a2332;
    padding: 0;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s ease, transform 0.1s ease;
}
.auth-avatar:hover,
.auth-avatar:focus-visible {
    border-color: #d4af37;
    outline: none;
}
.auth-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.auth-avatar__initials {
    color: #d4af37;
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1;
    user-select: none;
}

.auth-slot--open .auth-avatar {
    border-color: #d4af37;
}

/* === Dropdown === */
.auth-dropdown {
    position: absolute;
    top: calc(100% + 0.6rem);
    right: 0;
    min-width: 240px;
    background: #ffffff;
    color: #1a2332;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
    padding: 0.5rem 0;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.06);
}
.auth-dropdown[hidden] {
    display: none;
}
.auth-dropdown__user {
    padding: 0.6rem 1rem 0.5rem;
}
.auth-dropdown__name {
    font-weight: 700;
    font-size: 0.95rem;
    color: #1a2332;
    line-height: 1.2;
    word-break: break-word;
}
.auth-dropdown__email {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.15rem;
    word-break: break-all;
}
.auth-dropdown__sep {
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 0.35rem 0;
}
.auth-dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 1rem;
    background: transparent;
    color: #1a2332;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    text-align: left;
    transition: background-color 0.12s ease;
}
.auth-dropdown__item:hover,
.auth-dropdown__item:focus-visible {
    background: rgba(26, 76, 139, 0.08);
    outline: none;
}
.auth-dropdown__item i {
    width: 1.1rem;
    color: #1a4c8b;
    font-size: 0.95rem;
}
.auth-dropdown__item--logout {
    color: #b91c1c;
}
.auth-dropdown__item--logout i {
    color: #b91c1c;
}
.auth-dropdown__item--logout:hover,
.auth-dropdown__item--logout:focus-visible {
    background: rgba(185, 28, 28, 0.08);
}

/* === Modal "Otwórz w przeglądarce" (Messenger/FB/Instagram WebView) === */
.inapp-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 22, 32, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 1rem;
    animation: inapp-fade 0.2s ease;
}
@keyframes inapp-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
.inapp-modal__card {
    background: #fff;
    color: #1a2332;
    border-radius: 16px;
    max-width: 460px;
    width: 100%;
    padding: 2rem 1.5rem 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    position: relative;
    max-height: 95vh;
    overflow-y: auto;
}
.inapp-modal__close {
    position: absolute;
    top: 0.6rem;
    right: 0.8rem;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
}
.inapp-modal__close:hover,
.inapp-modal__close:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    color: #1a2332;
    outline: none;
}
.inapp-modal__title {
    font-size: 1.25rem;
    margin: 0 0 0.85rem;
    text-align: center;
    line-height: 1.3;
    color: #1a2332;
}
.inapp-modal__lead {
    font-size: 0.92rem;
    line-height: 1.5;
    color: #374151;
    margin: 0 0 1.25rem;
    text-align: center;
}
.inapp-modal__steps {
    background: #f9fafb;
    border-left: 4px solid #d4af37;
    border-radius: 8px;
    padding: 0.9rem 1rem 0.9rem 2.2rem;
    margin: 0 0 1.25rem;
    list-style-position: outside;
}
.inapp-modal__steps li {
    margin-bottom: 0.55rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: #374151;
}
.inapp-modal__steps li:last-child {
    margin-bottom: 0;
}
.inapp-modal__steps strong {
    color: #1a2332;
    font-weight: 600;
}
.inapp-modal__url-label {
    font-size: 0.72rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.35rem;
    font-weight: 600;
}
.inapp-modal__url {
    background: #1a2332;
    color: #d4af37;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    font-size: 0.75rem;
    word-break: break-all;
    font-family: Menlo, Consolas, "Courier New", monospace;
    margin: 0 0 0.85rem;
    line-height: 1.4;
}
.inapp-modal__copy {
    display: block;
    width: 100%;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    background: #d4af37;
    color: #1a2332;
    border: none;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}
.inapp-modal__copy:active {
    background: #c19c2e;
    transform: scale(0.98);
}
.inapp-modal__copy--ok {
    background: #16a34a;
    color: #fff;
}

/* === Mobile === */
@media (max-width: 768px) {
    .auth-slot {
        margin-right: 0;
    }
    .auth-button span {
        display: none; /* tylko ikona na mobile */
    }
    .auth-button {
        padding: 0.35rem 0.45rem;
    }
    .auth-button i {
        font-size: 1rem;
    }
    .auth-dropdown {
        right: -0.5rem;
        min-width: 220px;
    }
}


/* === Licznik interakcji (odpowiedzi i lajki pod komentarzami) ===
   Kropka siedzi na awatarze, wiec musi byc widoczna takze na zdjeciu profilowym -
   stad obwodka w kolorze paska nawigacji, a nie sam czerwony krazek. */
.auth-avatar { position: relative; overflow: visible; }
.auth-avatar__img,
.auth-avatar__initials { border-radius: 50%; }

.auth-avatar__dot {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    border: 2px solid #1a2332;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 14px;
    text-align: center;
    pointer-events: none;
}

.auth-dropdown__item--ints { position: relative; }
.auth-dropdown__count {
    margin-left: auto;
    min-width: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
}

/* === Licznik zdarzen na stronie (tylko admin) ===
   Drugi znaczek na tym samym awatarze, wiec musi sie od tamtego rozniac dwiema
   rzeczami naraz: kolorem i miejscem. Zloto zamiast czerwieni, bo to nie jest
   alarm - to informacja, ze cos sie dzieje i wypada zajrzec. Lewy gorny rog,
   bo prawy nalezy do interakcji i przy dwoch powiadomieniach naraz liczby
   nachodzilyby na siebie.

   Granatowy tekst na zlocie zamiast bialego: ta sama para, co w przycisku zgody
   na cookies. Bialy napis na #d4af37 ma kontrast 2,0:1 i na 10 pikselach robi
   sie nieczytelny. */
.auth-avatar__dot--events {
    right: auto;
    left: -4px;
    background: #d4af37;
    color: #1a2332;
}

.auth-dropdown__item--events { position: relative; }
.auth-dropdown__count--events {
    background: #d4af37;
    color: #1a2332;
}
