body,
html {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Montserrat", sans-serif;
    background: #141414;
    color: white;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1;
    width: 100%;
    background: #141414;
}

.leaflet-container {
    background: #141414;
}

.leaflet-pane.leaflet-countries-pane {
    z-index: 200;
}

#footer-bar {
    height: 35px;
    background: #ffffff;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 20px;
    box-sizing: border-box;
    z-index: 1100;
    color: #333;
    font-size: 11px;
}

.footer-logo img {
    height: 20px;
    display: block;
}

.leaflet-pane.leaflet-points-pane {
    z-index: 400;
}

.leaflet-pane.leaflet-labels-pane {
    z-index: 600;
    pointer-events: none;
}

/* Toolbar / Controls */
#controls {
    display: none; /* Ukryte zgodnie z poleceniem */
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: rgba(20, 20, 20, 0.9);
    padding: 12px 24px;
    border-radius: 8px;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
}

button {
    background: #dc1a21;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
    font-family: "Montserrat", sans-serif;
}

button:hover {
    background: #ff5555;
}

button:disabled {
    background: #555;
    cursor: not-allowed;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Loading Overlay */
#loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #141414;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #333;
    border-top: 4px solid #dc1a21;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

#error-msg {
    color: #dc1a21;
    display: none;
    margin-top: 10px;
    text-align: center;
    padding: 0 20px;
}

.polskie-napisy {
    filter: invert(100%) brightness(1.2) opacity(0.5);
    pointer-events: none !important;
}

/* Custom DivIcon Marker Styles */
.custom-div-icon {
    background: transparent;
    border: none;
}

.marker-flag-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

.marker-flag-container .leaflet-flag-img {
    width: 21px;
    height: 14px;
    object-fit: cover;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3); /* Tylko bardzo subtelna obwódka dla odróżnienia od ciemnego tła */
}

/* Leaflet Popup Base Styles */
.leaflet-popup-content-wrapper {
    background: #1b1b22;
    color: #e0e0e0;
    border-radius: 8px;
    border: 1px solid #3a3a45;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
}

.leaflet-popup-tip {
    background: #1b1b22;
}

.leaflet-popup-content {
    margin: 18px 16px;
    line-height: 1.5;
    font-family: 'Montserrat', sans-serif;
}

.leaflet-popup-close-button {
    color: #6d6d7d !important;
}

/* Popup Content Tyopgraphy & Elements */
.popup-eyebrow {
    font-size: 10px;
    color: #8c8c99;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.popup-title {
    margin: 0 0 12px 0 !important;
    font-size: 16px !important;
    color: #ffffff !important;
    font-weight: 700;
}

.popup-meta-line {
    font-size: 12px;
    color: #a0a0aa;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.popup-meta-line .icon {
    font-size: 11px;
    opacity: 0.8;
}

.popup-striker-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 12px 0;
    font-size: 13px;
}

.striker-flags-tiny {
    display: flex;
    align-items: center;
    height: 14px;
    border-radius: 2px;
    overflow: hidden;
}

.striker-flags-tiny img {
    height: 100%;
    object-fit: cover;
}

/* Confidence Badge */
.popup-confidence {
    margin-bottom: 12px;
}

.popup-confidence .badge {
    display: inline-block;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 800;
    color: #fff;
}

.popup-confidence .badge.high { background: #ff4500; }
.popup-confidence .badge.medium { background: #ff8c00; }
.popup-confidence .badge.low { background: #ffd700; color: #000; }

.popup-confidence .conf-desc {
    font-size: 11px;
    color: #8c8c99;
    margin-top: 4px;
}

/* Sources */
.popup-sources {
    font-size: 11px;
    color: #8c8c99;
    margin-bottom: 14px;
}

/* Description Text */
.popup-desc {
    font-size: 13px !important;
    color: #e0e0e0;
    margin-bottom: 12px !important;
    border-top: 1px solid #3a3a45;
    padding-top: 12px;
}

/* Casualties Warning */
.popup-casualties {
    color: #ff5555;
    font-size: 12px;
    font-weight: 700;
    margin-top: 8px;
}

/* Video Section */
.popup-video-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #3a3a45;
    border-radius: 4px;
    padding: 10px;
    margin-top: 12px;
}

.video-item {
    font-size: 12px;
    color: #ccc;
    margin-bottom: 6px;
}

.video-item:last-child {
    margin-bottom: 0;
}

/* Responsywność dla urządzeń mobilnych */
@media (max-width: 768px) {
    #controls {
        padding: 6px 12px;
        gap: 8px;
        bottom: 80px; /* Przesunięte wyżej nad nowy pasek */
    }

    button {
        padding: 6px 12px;
        font-size: 11px;
    }

    #footer-bar {
        height: 70px;
        justify-content: center;
        padding: 10px;
    }

    .footer-logo img {
        height: 25px; /* Slightly larger on mobile as requested previously */
    }
}
