/* === RESET USTAWIEŃ === */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; }
body, html { height: 100%; width: 100%; overflow: hidden; background-color: #1a1a1a; }

/* === GŁÓWNY KONTENER === */
.app-container {
    height: 100vh; width: 100vw; 
    border: 6px solid #e63946; 
    border-bottom: 12px solid #e63946; /* NOWOŚĆ: Pogrubiona dolna krawędź */
    border-radius: 16px;
    position: relative; display: flex; flex-direction: column; overflow: hidden;
}

/* === GÓRNY PANEL (MENU) === */
.top-bar {
    height: 60px; background-color: rgba(26, 26, 26, 0.9); color: white; display: flex;
    justify-content: space-between; align-items: center; padding: 0 15px; z-index: 1000; 
    border-bottom: 2px solid #e63946;
}

.user-profile { display: flex; align-items: center; gap: 12px; }

/* Dodaliśmy klasę .avatar i nałożyliśmy twarde blokady (overflow: hidden, flex-shrink: 0) */
.avatar, .user-avatar { 
    width: 42px; height: 42px; border-radius: 50%; border: 2px solid #e63946; 
    object-fit: cover; box-shadow: 0 2px 5px rgba(0,0,0,0.5); 
    display: flex; justify-content: center; align-items: center;
    background-color: #2a2a2a; color: white; font-weight: bold; 
    overflow: hidden; flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; justify-content: center; }
.username { font-weight: bold; font-size: 1.1rem; }
.user-rank { font-size: 0.8rem; color: #a8a8a8; }
.city-name { color: #888; font-weight: 800; font-size: 1.3rem; letter-spacing: 2px; text-transform: uppercase; }

/* --- PRAWY GÓRNY RÓG (Licznik + Wyloguj) --- */
.right-top-menu { display: flex; align-items: center; gap: 15px; }

/* Nowy wygląd licznika Red Flags (zastępuje green-flags-btn) */
.red-flags-btn { 
    background-color: #1a1a1a; color: white; border: 1px solid #e63946; padding: 8px 15px; 
    border-radius: 20px; font-weight: bold; font-size: 0.9rem; cursor: pointer; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.3); transition: 0.2s; 
}
.red-flags-btn:hover { background-color: #e63946; transform: scale(1.05); }

/* Nowy wygląd przycisku wylogowania (SVG) */
.logout-icon-btn { 
    background: none; border: none; color: #a8a8a8; cursor: pointer; 
    transition: 0.2s; display: flex; align-items: center; justify-content: center;
}
.logout-icon-btn:hover { 
    color: #e63946; 
    filter: drop-shadow(0 0 8px rgba(230, 57, 70, 0.6));
}

/* === MAPA === */
#map { flex-grow: 1; width: 100%; z-index: 1; }

/* === PRZYCISK LOKALIZACJI GPS === */
.gps-button {
    position: absolute; bottom: 135px; right: 20px; /* Podniesiono z 120px */
    width: 45px; height: 45px;
    /* ... reszta bez zmian ... */
    background-color: #2a2a2a; color: #fff; border-radius: 50%; border: 2px solid #444;
    display: flex; justify-content: center; align-items: center; font-size: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); cursor: pointer; z-index: 1000; transition: 0.2s;
}
.gps-button:active, .gps-button.active { border-color: #e63946; background-color: #1a1a1a; transform: scale(0.95); }

/* === PRZYCISK PLUS (ZAKTUALIZOWANY - HOVER I PULS) === */
.add-button {
    position: absolute; 
    bottom: 45px; 
    left: 50%; 
    transform: translateX(-50%);
    width: 60px; height: 60px; /* Nieco mniejszy, bardziej elegancki rozmiar */
    background-color: #e63946; 
    color: white; 
    border-radius: 50%;
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: 38px; 
    font-weight: bold; 
    line-height: 1; /* Gwarantuje perfekcyjne wyśrodkowanie plusa w pionie */
    padding: 0; margin: 0; /* Usunięto błędy centrowania */
    box-shadow: 0 4px 15px rgba(230, 57, 70, 0.4); 
    cursor: pointer; 
    z-index: 1000; 
    border: none; 
    outline: none; 
    transition: all 0.3s ease; /* Płynne przejścia dla hovera */
    animation: pulse-add-btn 2.5s infinite; /* Efekt taktycznego pulsowania */
}

.add-button:hover { 
    background-color: #ff4d4d; 
    transform: translateX(-50%) scale(1.1); /* Delikatne powiększenie po najechaniu */
    box-shadow: 0 6px 20px rgba(230, 57, 70, 0.7);
}

.add-button:active { 
    transform: translateX(-50%) scale(0.95); 
    background-color: #d62828; 
}

/* Animacja pulsowania dla przycisku */
@keyframes pulse-add-btn {
    0% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(230, 57, 70, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0); }
}

/* === ZNACZNIKI Z EMOTIKONAMI (MAPA) === */
.emoji-marker-container { position: relative; width: 34px; height: 34px; display: flex; justify-content: center; align-items: center; }
.marker-emoji { font-size: 22px; position: relative; z-index: 2; text-shadow: 0 2px 4px rgba(0,0,0,0.8); }
.red-flag-pulse {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 28px; height: 28px; background-color: rgba(230, 57, 70, 0.2);
    border-radius: 50%; border: 2px solid #e63946; animation: pulse-red 2s infinite; z-index: 1;
}
@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(230, 57, 70, 0); }
    100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, 0); }
}

/* === DYMEK PODGLĄDU PO NAJECHANIU NA FLAGĘ (TOOLTIP) === */
.leaflet-tooltip.custom-hover-tooltip {
    background-color: #1a1a1a; border: 1px solid #e63946; color: white; border-radius: 8px;
    padding: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.8); width: 200px; white-space: normal;
}
.leaflet-tooltip.custom-hover-tooltip::before { display: none; }
.tooltip-content { display: flex; flex-direction: column; gap: 8px; }
.tooltip-header { font-weight: bold; color: #e63946; font-size: 0.9rem; border-bottom: 1px solid #444; padding-bottom: 5px; }
.tooltip-image { width: 100%; height: 80px; background-color: #2a2a2a; border-radius: 4px; object-fit: cover; display: flex; align-items: center; justify-content: center; font-size: 0.8rem; color: #888; }
.tooltip-desc {
    font-size: 0.8rem; line-height: 1.3; color: #ccc; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* === WYSUWANY PANEL (BOTTOM SHEET) === */
.bottom-sheet {
    position: absolute; bottom: -100%; left: 0; width: 100%; background-color: #1a1a1a;
    border-top: 3px solid #e63946; border-radius: 20px 20px 0 0; padding: 25px 20px; z-index: 2000;
    transition: bottom 0.3s ease-in-out; color: white; box-shadow: 0 -10px 20px rgba(0,0,0,0.7);
}
.bottom-sheet.active { bottom: 0; }
.sheet-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.close-btn { background: none; border: none; color: #e63946; font-size: 35px; cursor: pointer; line-height: 1; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.category-item { background-color: #2a2a2a; padding: 10px 4px; border-radius: 8px; text-align: center; font-weight: bold; cursor: pointer; border: 1px solid transparent; transition: 0.2s; font-size: 0.75rem; }
.category-item .icon { font-size: 1.4rem; display: block; margin-bottom: 3px; }
.category-item:active { border-color: #e63946; background-color: #3a3a3a; }

/* === MODAL ZGŁOSZENIA === */
.modal-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); z-index: 3000; display: none; justify-content: center; align-items: center;
}
.modal-overlay.active { display: flex; }
.modal-content {
    background-color: #1a1a1a; border: 2px solid #e63946; border-radius: 12px; padding: 20px;
    width: 90%; max-width: 400px; color: white; box-shadow: 0 10px 30px rgba(230, 57, 70, 0.2);
}
.modal-content h3 { margin-bottom: 15px; color: #fff; font-size: 1.2rem; }
.photo-upload-label {
    display: block; width: 100%; background-color: #2a2a2a; color: #fff; text-align: center;
    padding: 10px; border-radius: 8px; border: 1px dashed #e63946; margin-bottom: 15px; cursor: pointer; font-weight: bold;
}
.photo-upload-label:active { background-color: #3a3a3a; }
.location-input {
    width: 100%; background-color: #2a2a2a; border: 1px solid #444; border-radius: 8px;
    color: white; padding: 10px; margin-bottom: 10px; outline: none; font-size: 0.95rem;
}
.location-input:focus { border-color: #e63946; }
#flagDescription {
    width: 100%; height: 90px; background-color: #2a2a2a; border: 1px solid #444;
    border-radius: 8px; color: white; padding: 10px; margin-bottom: 15px; resize: none;
}
#flagDescription:focus { outline: none; border-color: #e63946; }
.modal-buttons { display: flex; justify-content: space-between; }
.modal-buttons button { padding: 10px 20px; border-radius: 8px; border: none; font-weight: bold; cursor: pointer; transition: 0.2s; }
.cancel-btn { background-color: transparent; color: #a8a8a8; }
.cancel-btn:hover { color: white; }
.submit-btn { background-color: #e63946; color: white; }
.submit-btn:hover { background-color: #d62828; }

/* === LEWY I PRAWY PANEL (PODSTAWY) === */
.left-side-panel, .right-side-panel {
    position: absolute; top: 60px; width: 85%; max-width: 400px; height: calc(100% - 60px);
    background-color: #1a1a1a; z-index: 2500; display: flex; flex-direction: column;
    box-shadow: 0 0 20px rgba(0,0,0,0.5); color: white;
}
.panel-header {
    display: flex; justify-content: space-between; align-items: center; padding: 15px;
    background-color: #222; border-bottom: 1px solid #333;
}
.panel-body { padding: 15px; flex-grow: 1; overflow-y: auto; }
.divider { border: 0; height: 1px; background: #444; margin: 20px 0; }

/* LEWY PANEL (Szczegóły sprawy) */
.left-side-panel { left: -100%; border-right: 3px solid #e63946; transition: left 0.3s ease-in-out; }
.left-side-panel.active { left: 0; }
.close-left-btn { background: none; border: none; color: #e63946; font-size: 30px; cursor: pointer; }
.evidence-photo-box {
    width: 100%; height: 180px; background-color: #2a2a2a; border-radius: 8px; display: flex;
    align-items: center; justify-content: center; color: #555; margin-bottom: 15px;
}
.location-display { color: #e63946; font-weight: bold; margin-bottom: 10px; font-size: 0.9rem; }
.location-display span { color: #fff; font-weight: normal; }
.report-desc { font-size: 0.95rem; line-height: 1.5; }
.delete-flag-btn {
    width: 100%; background-color: transparent; border: 1px solid #e63946; color: #e63946;
    padding: 10px; margin-top: 15px; border-radius: 8px; cursor: pointer; font-weight: bold; transition: 0.2s;
}
.delete-flag-btn:hover { background-color: #e63946; color: white; }

/* CZAT W LEWYM PANELU */
.chat-title { margin-bottom: 15px; color: #e63946; }
.chat-message { background-color: #2a2a2a; padding: 10px; border-radius: 8px; margin-bottom: 10px; }
.chat-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.chat-author { font-weight: bold; font-size: 0.8rem; color: #a8a8a8; }
.delete-comment-btn { background: none; border: none; color: #e63946; cursor: pointer; font-size: 0.9rem; opacity: 0.7; }
.delete-comment-btn:hover { opacity: 1; }
.vote-actions { display: flex; gap: 10px; margin-top: 8px; }
.vote-btn { background: none; border: 1px solid #444; color: #fff; padding: 4px 8px; border-radius: 4px; cursor: pointer; font-size: 0.8rem; }
.vote-btn:hover:not(:disabled) { border-color: #e63946; }
.vote-btn:disabled { opacity: 0.5; cursor: not-allowed; border-color: #333; }
.chat-input-area { display: flex; padding: 15px; background-color: #222; border-top: 1px solid #333; }
.chat-input { flex-grow: 1; background-color: #1a1a1a; border: 1px solid #444; color: white; padding: 10px; border-radius: 8px 0 0 8px; outline: none; }
.send-chat-btn { background-color: #e63946; color: white; border: none; padding: 0 15px; border-radius: 0 8px 8px 0; cursor: pointer; }

/* PRAWY PANEL (Tablica operacyjna) */
.right-side-panel { right: -100%; border-left: 3px solid #e63946; transition: right 0.3s ease-in-out; }
.right-side-panel.active { right: 0; }
.close-right-btn { background: none; border: none; color: #e63946; font-size: 30px; cursor: pointer; }
.event-card {
    background-color: #2a2a2a; border-radius: 8px; padding: 10px; margin-bottom: 10px;
    border-left: 4px solid #444; cursor: pointer; transition: 0.2s; display: flex; gap: 12px; align-items: center;
}
.event-card:hover { border-left-color: #e63946; background-color: #333; }
.event-card-emoji { font-size: 1.8rem; }
.event-card-info { flex-grow: 1; }
.event-card-title { font-weight: bold; font-size: 0.95rem; color: #fff; margin-bottom: 4px;}
.event-card-street { font-size: 0.8rem; color: #a8a8a8; }

/* Przycisk uzupełniania dowodów */
.late-photo-btn {
    width: 100%; background-color: #2a2a2a; color: #fff; border: 1px dashed #e63946;
    padding: 10px; border-radius: 8px; margin-bottom: 15px; cursor: pointer; font-weight: bold;
    transition: 0.2s;
}
.late-photo-btn:hover { background-color: #3a3a3a; border-style: solid; }

/* === ŚLUZA BEZPIECZEŃSTWA (LOGOWANIE) === */
.login-body { 
    display: flex; 
    flex-direction: column; 
    justify-content: flex-start; /* Zmiana z center, aby góra nie była ucięta */
    align-items: center; 
    min-height: 100vh;
    padding: 5vh 20px 20px 20px; 
    box-sizing: border-box;
    background-color: #111; 
    background-image: radial-gradient(circle at center, #1a1a1a 0%, #050505 100%); 
    overflow-y: auto !important; /* ODBLOKOWANIE PRZEWIJANIA */
}
.login-container { 
    background-color: #1a1a1a; padding: 40px; border-radius: 12px; 
    border: 1px solid #444; border-top: 4px solid #e63946; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8); width: 90%; max-width: 380px; text-align: center; 
}
.login-header h2 { color: #e63946; font-size: 2.2rem; letter-spacing: 4px; margin-bottom: 5px; }
.login-header p { color: #888; font-size: 0.8rem; margin-bottom: 30px; text-transform: uppercase; letter-spacing: 1px; }
.login-input { 
    width: 100%; background-color: #2a2a2a; border: 1px solid #444; color: white; 
    padding: 12px; margin-bottom: 15px; border-radius: 8px; outline: none; font-size: 1rem; 
}
.login-input:focus { border-color: #e63946; }
.login-btn { 
    width: 100%; background-color: #e63946; color: white; border: none; padding: 14px; 
    border-radius: 8px; font-weight: bold; font-size: 1rem; cursor: pointer; transition: 0.2s; letter-spacing: 1px; 
}
.login-btn:hover { background-color: #d62828; }
.login-error { color: #e63946; margin-top: 15px; font-size: 0.9rem; font-weight: bold; }

/* --- Slogan --- */
.login-slogan {
    color: #e63946;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 2px;
    margin-top: 10px;
    margin-bottom: 25px;
}

/* --- Dolne menu i stopka --- */
/* --- Dolne menu i stopka --- */
.login-footer {
    position: relative; /* Zdejmujemy sztywne przypięcie 'absolute' */
    margin-top: 40px; /* Tworzymy bezpieczny bufor odstępu od głównego panelu */
    width: 100%;
    text-align: center;
}

.footer-links {
    margin-bottom: 8px;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #e63946;
}

.footer-links .divider {
    color: #444;
    margin: 0 12px;
    font-size: 0.8rem;
}

.copyright {
    color: #444;
    font-size: 0.7rem;
    letter-spacing: 0.5px;
}

/* --- Nowe przyciski logowania i wiadomości --- */
.register-btn {
    width: 100%;
    background-color: transparent;
    color: #e63946;
    border: 1px solid #e63946;
    padding: 12px;
    margin-top: 10px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    letter-spacing: 1px;
}

.register-btn:hover {
    background-color: rgba(230, 57, 70, 0.1);
}

.auth-message {
    margin-top: 15px;
    font-size: 0.85rem;
    font-weight: bold;
}
.auth-error { color: #e63946; }
.auth-success { color: #2a9d8f; } /* Kolor zielony/sukcesu */

/* --- Separator LUB --- */
.divider-container {
    display: flex;
    align-items: center;
    margin: 25px 0;
}

.divider-line {
    flex-grow: 1;
    height: 1px;
    background-color: #444;
}

.divider-text {
    color: #888;
    padding: 0 15px;
    font-size: 0.75rem;
    font-weight: bold;
    letter-spacing: 1px;
}

/* --- Przycisk Google --- */
.google-btn {
    width: 100%;
    background-color: #ffffff;
    color: #333333;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.95rem;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.google-btn:hover {
    background-color: #f1f1f1;
}

/* === CUSTOMOWE POP-UPY I PROFIL === */
.confirm-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85); display: none; justify-content: center; align-items: center;
    z-index: 10000; backdrop-filter: blur(3px);
}
.confirm-overlay.active { display: flex; }

.confirm-box {
    background: #1a1a1a; padding: 25px; border-radius: 12px; border-top: 4px solid #e63946;
    text-align: center; width: 90%; max-width: 350px; box-shadow: 0 10px 40px rgba(0,0,0,0.9);
}
.confirm-box h3 { color: #fff; margin-bottom: 10px; font-size: 1.2rem; letter-spacing: 1px; }
.confirm-box p { color: #aaa; font-size: 0.9rem; margin-bottom: 25px; line-height: 1.4; }

.confirm-actions { display: flex; justify-content: space-between; gap: 12px; }
.confirm-btn { flex: 1; padding: 12px; border: none; border-radius: 6px; font-weight: bold; cursor: pointer; transition: 0.2s; font-size: 0.85rem; letter-spacing: 1px;}
.confirm-cancel { background: #333; color: #fff; }
.confirm-cancel:hover { background: #444; }
.confirm-delete { background: #e63946; color: #fff; }
.confirm-delete:hover { background: #d62828; }

/* Stylizacja panelu profilu */
.profile-box { border-top-color: #2a9d8f; max-width: 380px; padding: 20px 25px; }
.profile-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.profile-header h3 { color: #2a9d8f; margin: 0; }
.close-profile-btn { background: none; border: none; color: #888; cursor: pointer; font-size: 1.2rem; transition: 0.2s; }
.close-profile-btn:hover { color: #e63946; }

.avatar-upload-wrapper {
    background: #222; width: 80px; height: 80px; border-radius: 50%; margin: 0 auto 15px;
    display: flex; justify-content: center; align-items: center; font-size: 2rem; 
    border: 2px dashed #555; cursor: pointer; transition: 0.2s; color: #555; overflow: hidden;
}
.avatar-upload-wrapper:hover { border-color: #2a9d8f; color: #2a9d8f; background: #2a2a2a; }

.profile-email { color: #fff; margin-bottom: 5px; font-size: 1rem; }
.profile-bio-textarea {
    width: 100%; background: #111; border: 1px solid #444; color: #fff; padding: 12px;
    border-radius: 8px; margin-top: 15px; resize: none; font-size: 0.85rem; font-family: inherit;
}
.profile-bio-textarea:focus { outline: none; border-color: #2a9d8f; }

.profile-stats { display: flex; justify-content: space-around; margin-top: 20px; padding-top: 15px; border-top: 1px solid #333; }
.stat-box { text-align: center; }
.stat-icon { font-size: 1.2rem; }
.stat-icon.red { color: #e63946; }
.stat-icon.green { color: #2a9d8f; }
.stat-box small { color: #888; }
.stat-box b { color: #fff; font-size: 1.1rem; }
.save-profile-btn { width: 100%; margin-top: 20px; background: #2a9d8f; color: #fff; }
.save-profile-btn:hover { background: #21867a; }

/* Przekreślony aparat */
.no-photo-graphic {
    display: flex; flex-direction: column; justify-content: center; align-items: center;
    background-color: #222; width: 100%; height: 120px; border-radius: 8px; border: 1px dashed #555;
}

/* --- AWATARY W CZACIE --- */
.chat-author-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #444;
}
.chat-avatar-placeholder {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.7rem;
    color: #888;
    border: 1px dashed #555;
}

/* === DZWONEK I POWIADOMIENIA === */
.notification-btn {
    background-color: #1a1a1a; color: white; border: 1px solid #444; padding: 8px 12px;
    border-radius: 20px; font-weight: bold; font-size: 0.9rem; cursor: pointer;
    position: relative; transition: 0.2s; display: flex; align-items: center; justify-content: center;
}
.notification-btn:hover { border-color: #e63946; background-color: #2a2a2a; }
.badge {
    position: absolute; top: -5px; right: -5px; background-color: #e63946; color: white;
    font-size: 0.65rem; padding: 2px 6px; border-radius: 50%; font-weight: bold;
}
.notification-card {
    background-color: #2a2a2a; border-radius: 8px; padding: 12px; margin-bottom: 10px;
    border-left: 4px solid #e63946; cursor: pointer; transition: 0.2s;
}
.notification-card.unread { background-color: #332225; }
.notification-card:hover { background-color: #3a3a3a; }
.notification-text { font-size: 0.85rem; color: #fff; margin-bottom: 4px; }
.notification-time { font-size: 0.7rem; color: #888; }

/* === FILTRY TAKTYCZNE === */
.filter-bar {
    position: absolute; top: 70px; left: 50%; transform: translateX(-50%);
    display: flex; gap: 8px; background: rgba(26, 26, 26, 0.9); padding: 8px 12px;
    border-radius: 20px; z-index: 1000; border: 1px solid #444; backdrop-filter: blur(5px);
    overflow-x: auto; max-width: 95%; white-space: nowrap; box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.filter-pill {
    background: #2a2a2a; color: #aaa; border: none; padding: 6px 12px; border-radius: 14px;
    font-size: 0.8rem; font-weight: bold; cursor: pointer; transition: 0.2s;
}
.filter-pill:hover { color: #fff; background: #3a3a3a; }
.filter-pill.active { background: #e63946; color: #fff; box-shadow: 0 0 8px rgba(230, 57, 70, 0.5); }

/* === STOPKA GŁÓWNEJ APLIKACJI === */
.app-footer {
    height: 30px;
    background-color: #111;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 15px;
    font-size: 0.7rem;
    z-index: 1000;
}
.app-footer .footer-links a {
    color: #888; text-decoration: none; text-transform: uppercase; letter-spacing: 1px; transition: 0.2s;
}
.app-footer .footer-links a:hover { color: #e63946; }
.app-footer .divider { margin: 0 8px; color: #444; }
.app-footer .copyright { color: #555; }

/* === ZABEZPIECZENIA LOGOWANIA (CHECKBOXY) === */
.security-checks {
    margin-bottom: 20px;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.check-container {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #888;
    user-select: none;
}

.check-container input { display: none; }

.checkmark {
    width: 20px;
    height: 20px;
    background-color: #2a2a2a;
    border: 1px solid #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    flex-shrink: 0;
}

.check-container:hover .checkmark { border-color: #e63946; }

.check-container input:checked ~ .checkmark {
    background-color: #e63946;
    border-color: #e63946;
}

.check-container input:checked ~ .checkmark::after {
    content: '✔';
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.terms-link {
    color: #e63946;
    text-decoration: none;
    font-weight: bold;
    transition: 0.2s;
}
.terms-link:hover { color: #d62828; text-decoration: underline; }

/* -- Wygląd filtra Botów -- */
.captcha-container {
    background-color: #1a1a1a;
    padding: 12px 15px;
    border: 1px dashed #444;
    border-radius: 8px;
    justify-content: space-between;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.2);
    transition: 0.2s;
}
.captcha-container:hover { border-color: #e63946; background-color: #222; }
.check-container input:checked ~ .captcha-text { color: #2a9d8f; }
.captcha-text { font-weight: bold; color: #ccc; transition: 0.2s; font-size: 0.85rem;}
.captcha-logo { font-size: 1.4rem; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }

/* --- NOWY FORMULARZ REJESTRACJI --- */
.switch-mode-text { color: #888; font-size: 0.85rem; margin-top: 15px; }
.switch-mode-text a { color: #e63946; font-weight: bold; cursor: pointer; text-decoration: none; }
.switch-mode-text a:hover { text-decoration: underline; }

.reg-avatar-container {
    width: 80px; height: 80px; margin: 0 auto 15px auto;
    border-radius: 50%; background-color: #2a2a2a; border: 2px dashed #e63946;
    display: flex; justify-content: center; align-items: center;
    font-size: 1.5rem; color: #555; cursor: pointer; overflow: hidden;
    transition: 0.2s; position: relative;
}
.reg-avatar-container:hover { background-color: #333; }
.reg-avatar-preview { width: 100%; height: 100%; object-fit: cover; display: none; }

.password-strength-container {
    width: 100%; height: 6px; background-color: #333;
    border-radius: 3px; margin: -5px 0 15px 0; overflow: hidden;
}
.password-strength-bar {
    height: 100%; width: 0%; background-color: #e63946;
    transition: width 0.3s ease, background-color 0.3s ease;
}

/* --- Style przeniesione z HTML (Clean Code) --- */
.thermal-toggle {
    margin-left: 10px; 
    border-left: 2px solid #555;
}

.delete-account-btn {
    width: 100%; 
    margin-top: 10px; 
    background: transparent; 
    border: 1px solid #e63946; 
    color: #e63946;
}
.delete-account-btn:hover {
    background: #e63946;
    color: #fff;
}

/* === LICZNIK AGENTÓW ONLINE === */
.online-counter {
    display: flex; align-items: center; gap: 8px; background-color: #1a1a1a;
    border: 1px solid #444; padding: 6px 14px; border-radius: 20px; font-size: 0.8rem;
    color: #ccc; font-weight: bold; cursor: default;
}
.online-dot {
    width: 8px; height: 8px; background-color: #2a9d8f; border-radius: 50%;
    box-shadow: 0 0 8px #2a9d8f; animation: pulse-green 2s infinite;
}
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(42, 157, 143, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(42, 157, 143, 0); }
    100% { box-shadow: 0 0 0 0 rgba(42, 157, 143, 0); }
}

/* === WĄTKOWANIE KOMENTARZY (LINKEDIN STYLE) === */
.chat-reply-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
    padding: 4px 6px;
}
.chat-reply-btn:hover {
    color: #e63946;
}

/* Wcięcie dla komentarzy-odpowiedzi */
.chat-message.is-reply {
    margin-left: 28px;
    border-left: 3px solid #e63946;
    background-color: #1f1f1f;
    position: relative;
}

/* Pasek informujący kogo cytujemy nad polem wpisywania */
.reply-status-bar {
    display: none;
    justify-content: space-between;
    align-items: center;
    background-color: #161616;
    border-left: 3px solid #e63946;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: #aaa;
    border-top: 1px solid #333;
}
.reply-status-bar b {
    color: #e63946;
}
.reply-cancel-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.8rem;
}
.reply-cancel-btn:hover {
    color: #fff;
}

/* === LISTA PODPOWIEDZI ADRESÓW (AUTOCOMPLETE) === */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 150px;
    overflow-y: auto;
    background-color: #1a1a1a;
    border: 1px solid #444;
    border-top: none;
    border-radius: 0 0 8px 8px;
    z-index: 4000;
    display: none;
    box-shadow: 0 10px 20px rgba(0,0,0,0.8);
}
.suggestion-item {
    padding: 10px 12px;
    font-size: 0.85rem;
    color: #ccc;
    cursor: pointer;
    border-bottom: 1px solid #2a2a2a;
    transition: 0.2s;
}
.suggestion-item:hover {
    background-color: #e63946;
    color: #fff;
}

/* === PRZYCISK I MODAL SŁUŻB ALARMOWYCH === */
.emergency-trigger-btn {
    width: 100%; background-color: rgba(230, 57, 70, 0.15); border: 1px solid #e63946; 
    color: #ff4d4d; padding: 10px; border-radius: 8px; font-weight: bold; 
    font-size: 0.85rem; cursor: pointer; margin-bottom: 12px; transition: 0.2s;
}
.emergency-trigger-btn:hover { background-color: #e63946; color: #fff; }

.emergency-services-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 15px; }
.service-card {
    background: #222; border: 1px solid #444; border-radius: 8px; padding: 12px 8px; 
    text-align: center; text-decoration: none; color: #fff; display: flex; 
    flex-direction: column; align-items: center; gap: 4px; transition: 0.2s;
}
.service-card:hover { border-color: #e63946; background: #2a2a2a; }
.service-icon { font-size: 1.5rem; }
.service-name { font-weight: bold; font-size: 0.8rem; color: #fff; }
.service-num { font-size: 0.7rem; color: #e63946; font-weight: bold; }

/* === PRZYCISK ZGŁASZANIA TROLLA (CROWD MODERATION) === */
.fake-report-btn {
    width: 100%;
    background-color: transparent;
    border: 1px dashed #a8a8a8;
    color: #a8a8a8;
    padding: 10px;
    margin-top: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.2s;
}
.fake-report-btn:hover {
    border-color: #ffb703; /* Taktyczny pomarańcz */
    color: #ffb703;
    background-color: rgba(255, 183, 3, 0.1);
}
.fake-report-btn.voted {
    border-color: #ffb703;
    color: #ffb703;
    background-color: rgba(255, 183, 3, 0.1);
    cursor: not-allowed;
    opacity: 0.8;
}
/* --- Główny tytuł Point Red Flag --- */
.brand-title {
    color: #e63946;
    font-size: 2.8rem; /* Masywny font */
    letter-spacing: 6px;
    line-height: 1.1; /* Złączenie dwóch linijek */
    margin-bottom: 10px;
    text-align: center;
    cursor: default;
    transition: all 0.3s ease;
    text-shadow: 0 0 5px rgba(230, 57, 70, 0.2); /* Delikatna poświata */
}

/* --- Efekt pulsu / neonu po najechaniu --- */
.brand-title:hover {
    text-shadow: 0 0 15px rgba(230, 57, 70, 0.8), 0 0 30px rgba(230, 57, 70, 0.5);
    transform: scale(1.03); /* Minimalne powiększenie dające efekt głębi */
}

/* =========================================================
   EFEKT PSYCHOLOGICZNY - RADAR W TLE LOGOWANIA
   ========================================================= */
.login-body {
    position: relative;
    background-color: #111;
    overflow: hidden; /* Utrzymuje animację w ryzach ekranu */
    z-index: 1;
}

/* Przebiegający czerwony skaner */
.login-body::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%; /* Zaczyna poza ekranem po lewej */
    width: 60%; /* Szerokość promienia radaru */
    height: 100%;
    /* Gradient od przezroczystego przez krwistoczerwony do przezroczystego */
    background: linear-gradient(90deg, transparent, rgba(230, 57, 70, 0.15), transparent);
    z-index: -1; /* Zawsze za panelem logowania */
    animation: radar-sweep 5s infinite ease-in-out;
}

/* Kluczowe klatki animacji (Ruch z lewej na prawą) */
@keyframes radar-sweep {
    0% { left: -100%; }
    50% { left: 150%; } /* Przechodzi poza prawy ekran */
    100% { left: 150%; } /* Pauza, aby użytkownik nie dostał oczopląsu, po czym cykl się powtarza */
}

/* =========================================================
   OPTYMALIZACJA MOBILNA (SMARTFONY) - UI TAKTYCZNE
   ========================================================= */
@media (max-width: 768px) {
    
    /* 1. Kompresja całego górnego paska z łamaniem wierszy */
    .top-bar {
        display: flex;
        flex-wrap: wrap; /* Pozwala elementom spadać do nowej linii */
        justify-content: space-between;
        align-items: center;
        padding: 5px;
        gap: 5px;
    }

    /* 2. Profil Agenta z lewej */
    .user-profile {
        order: 1; 
    }
    .user-profile .avatar {
        width: 28px;           
        height: 28px;
    }
    .user-profile .role {
        display: none;         
    }
    .user-profile .username {
        font-size: 0.85rem;    
    }

    /* 3. Prawe menu (Liczniki, języki) */
    .right-top-menu {
        order: 2;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-end;
        gap: 5px;
    }

    /* Zmniejszamy przyciski operacyjne */
    #redFlagCountTxt, #langToggleBtn, .online-counter {
        font-size: 0.75rem;     
        padding: 4px 6px;      
        white-space: nowrap;   
    }

    /* 4. Ukrywamy nazwę miasta - szkoda operacyjnego miejsca */
    .city-name {
        display: none; 
    }

    /* 5. Filtry Taktyczne (Spadają pod spód do własnego rzędu) */
    .filter-bar {
        order: 3; /* Zawsze pod avatarem i licznikami */
        width: 100%;
        display: flex;
        flex-wrap: nowrap;     
        overflow-x: auto; /* Włączamy przesuwanie palcem na boki */
        padding: 5px 0;
        gap: 8px;
    }
    
    .filter-bar::-webkit-scrollbar {
        display: none; /* Czysty wygląd bez suwaka */
    }

    .filter-pill {
        padding: 6px 12px;
        font-size: 1.2rem; /* Większe Emoji pod palec */
        border-radius: 20px;
        white-space: nowrap;
    }
    
    /* Ukrywamy opisy (zostaje samo emoji) */
    .filter-pill span {
        display: none;
    }
}
/* =========================================================
   EFEKT PSYCHOLOGICZNY - BICIE SERCA (HEARTBEAT) W LOGO
   ========================================================= */
.brand-title {
    display: inline-block; /* Gwarantuje, że skalowanie nie "rozepcha" innych elementów */
    animation: heartbeat 2.2s infinite; /* Czas trwania jednego pełnego cyklu */
}

/* Klatki animacji imitujące ludzkie serce: "Lub-dub... pauza" */
@keyframes heartbeat {
    0% { 
        transform: scale(1); 
        text-shadow: 0 0 0 rgba(230, 57, 70, 0); 
    }
    10% { 
        transform: scale(1.04); 
        text-shadow: 0 0 25px rgba(230, 57, 70, 1); /* Pierwsze, mocne uderzenie (czerwona poświata) */
    }
    20% { 
        transform: scale(1); 
        text-shadow: 0 0 0 rgba(230, 57, 70, 0); 
    }
    30% { 
        transform: scale(1.04); 
        text-shadow: 0 0 25px rgba(230, 57, 70, 1); /* Drugie, szybsze uderzenie dopełniające rytm */
    }
    40% { 
        transform: scale(1); 
        text-shadow: 0 0 0 rgba(230, 57, 70, 0); 
    }
    100% { 
        transform: scale(1); 
        text-shadow: 0 0 0 rgba(230, 57, 70, 0); /* Cisza i oczekiwanie na kolejne uderzenie */
    }
}

/* =========================================================
   EFEKT PSYCHOLOGICZNY - EKG ZSYNCHRONIZOWANE Z RADAREM
   ========================================================= */
.login-body::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100vw;
    height: 150px;
    transform: translateY(-50%);
    
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 300 100'%3E%3Cpath d='M 0 50 L 100 50 L 110 20 L 120 80 L 135 10 L 150 90 L 160 30 L 170 50 L 300 50' fill='none' stroke='%23e63946' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 300px 100px;
    
    z-index: -2; 
    
    /* Czas (5s) i tempo (ease-in-out) idealnie zgrane z radarem! */
    animation: ekg-radar-sync 5s ease-in-out infinite; 
}

/* Klatki animacji śledzące ruch promienia radaru */
@keyframes ekg-radar-sync {
    0% { 
        clip-path: inset(0 100% 0 0); /* Ukryte z prawej */
        opacity: 0; /* Ciemno na starcie */
    }
    10% { 
        opacity: 0.3; /* Linia rozbłyska, gdy dotyka jej radar */
    }
    50% { 
        clip-path: inset(0 0 0 0); /* Linia w pełni narysowana (radar mija prawy kraniec) */
        opacity: 0.3; 
    }
    80% { 
        opacity: 0.3; /* Linia utrzymuje się przez chwilę na ekranie */
    }
    100% { 
        clip-path: inset(0 0 0 0); 
        opacity: 0; /* Płynnie gaśnie w ciemności, czekając na kolejny skan */
    }
}