/**
 * Stylizacja dla Polskiej Mapy
 * Autor: AI Assistant  
 * Data: 2025-10-28
 */

/* Kontener główny mapy */
.polska-mapa-container {
    position: relative;
    width: 100%;
    height: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    margin: 20px 0;
    background: #f0f0f0;
}

/* Mapa zajmuje całą przestrzeń kontenera */
.polska-mapa-container .mapboxgl-map {
    width: 100% !important;
    height: 100% !important;
}

/* Custom markery miast */
.custom-marker,


.custom-marker:hover,


/* Marker samochodu */
.car-marker {
    cursor: default;
    z-index: 100;
}

.car-marker div {
    animation: carPulse 2s infinite ease-in-out;
}

@keyframes carPulse {

    0%,
    100% {
        transform: scale(1) rotate(var(--rotation, 0deg));
    }

    50% {
        transform: scale(1.1) rotate(var(--rotation, 0deg));
    }
}

/* Stylizacja popup animacji */
.animacja-popup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    max-width: 300px;
    padding: 25px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    text-align: left;
    line-height: 1.5;
}

.animacja-popup h4 {
    margin: 0 0 12px 0;
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.animacja-popup p {
    margin: 8px 0;
    font-size: 13px;
    color: #f0f0f0;
}

.animacja-popup p strong {
    color: #fff;
    font-size: 14px;
}

.animacja-popup hr {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
    margin: 12px 0;
}

.animacja-popup small {
    font-size: 11px;
    color: #e0e0e0;
    text-align: center;
    display: block;
    margin-top: 8px;
    font-weight: 500;
}

/* Pasek postępu */
.progress-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    overflow: hidden;
    margin: 12px 0 6px 0;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A, #CDDC39);
    border-radius: 5px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.6);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.8;
    }
}

/* Stylizacja popup miast */
.miasto-popup {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-width: 200px;
    padding: 14px;
    background: #fff;
    color: #333;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.miasto-popup h4 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 700;
    color: #d63031;
    text-shadow: 0 1px 2px rgba(33, 150, 243, 0.2);
}

.miasto-popup p {
    margin: 6px 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.miasto-popup small {
    font-size: 11px;
    color: #999;
    display: block;
    margin-top: 8px;
}

/* Responsywność */
@media (max-width: 768px) {
    .polska-mapa-container {
        height: 400px;
        margin: 15px 0;
    }

    .animacja-popup {
        max-width: 260px;
        padding: 14px;
    }

    .animacja-popup h4 {
        font-size: 15px;
    }

    .animacja-popup p {
        font-size: 12px;
    }

    .miasto-popup {
        min-width: 180px;
        padding: 12px;
    }

    .miasto-popup h4 {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .polska-mapa-container {
        height: 350px;
        margin: 10px 0;
    }

    .animacja-popup {
        max-width: 240px;
        padding: 12px;
    }

    .animacja-popup h4 {
        font-size: 14px;
    }

    .animacja-popup p {
        font-size: 11px;
        margin: 6px 0;
    }
}

/* Dostosowania kontrolek Mapbox */
.mapboxgl-popup-close-button {
    font-size: 18px !important;
    padding: 6px !important;
    background: rgba(0, 0, 0, 0.3) !important;
    border-radius: 50% !important;
    width: 26px !important;
    height: 26px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s ease !important;
    margin-top:5px;
    margin-right:5px;
}
.mapboxgl-popup-close-button span {
    margin-top:-7px;
}
.mapboxgl-popup-close-button:hover {
    background: rgba(0, 0, 0, 0.5) !important;
}

/* Popup content wrapper */
.mapboxgl-popup-content {
    padding: 0px!important ;
    border-radius: 12px !important;
    overflow: hidden !important;
}

/* Popup tip (strzałka) dla animacji */
.animacja-popup~.mapboxgl-popup-tip {
    border-top-color: #667eea !important;
}

/* Popup tip dla miast */
.miasto-popup~.mapboxgl-popup-tip {
    border-top-color: #fff !important;
}

/* Loading state */
.polska-mapa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #666;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 16px;
    font-weight: 500;
}

.polska-mapa-loading::before {
    content: '🗺️';
    font-size: 32px;
    margin-right: 12px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Error state */
.polska-mapa-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #ffe6e6;
    color: #d63031;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    padding: 20px;
    font-weight: 500;
}

.polska-mapa-error::before {
    content: '⚠️';
    font-size: 28px;
    margin-right: 12px;
}

/* Kontrolki nawigacji */
.mapboxgl-ctrl-group {
    border-radius: 10px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden !important;
}

.mapboxgl-ctrl button {
    border-radius: 0 !important;
}

.mapboxgl-ctrl-group button:first-child {
    border-top-left-radius: 10px !important;
    border-top-right-radius: 10px !important;
}

.mapboxgl-ctrl-group button:last-child {
    border-bottom-left-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

/* Attribution */
.mapboxgl-ctrl-attrib {
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.8) !important;
    padding: 4px 8px !important;
}

/* Stylizacja dla WordPress */
.wp-block-shortcode .polska-mapa-container {
    margin: 20px auto;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .miasto-popup {
        background: #2c2c2c;
        color: #fff;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    }

    .miasto-popup h4 {
        color: #64B5F6;
    }

    .miasto-popup p {
        color: #ccc;
    }

    .miasto-popup small {
        color: #999;
    }
}

/* Print styles */
@media print {
    .polska-mapa-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .mapboxgl-popup {
        display: none !important;
    }

    .mapboxgl-ctrl {
        display: none !important;
    }
}

/* Dodatkowe efekty wizualne */
.polska-mapa-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: 8px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1;
}

/* Responsywność */
@media (max-width: 768px) {
    .polska-mapa-container {
        height: 400px;
        margin: 15px 0;
    }

    .animacja-popup {
        max-width: 250px;
        padding: 12px;
    }

    .animacja-popup h4 {
        font-size: 14px;
    }

    .animacja-popup p {
        font-size: 12px;
    }

    .miasto-popup {
        max-width: 180px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .polska-mapa-container {
        height: 300px;
        margin: 10px 0;
    }

    .animacja-popup {
        max-width: 220px;
        padding: 10px;
    }

    .animacja-popup h4 {
        font-size: 13px;
    }

    .animacja-popup p {
        font-size: 11px;
        margin: 6px 0;
    }
}

/* Dostosowania kontrolek Mapbox */
.mapboxgl-popup-close-button {
    color: white !important;
    font-size: 18px !important;
    padding: 5px !important;
    background: rgba(0, 0, 0, 0.2) !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.mapboxgl-popup-close-button:hover {
    background: rgba(0, 0, 0, 0.4) !important;
}

/* Popup content wrapper */
.mapboxgl-popup-content {
    padding: 0px!important;
    border-radius: 10px !important;
    overflow: hidden !important;
}

/* Popup tip (strzałka) */
.mapboxgl-popup-tip {
    border-top-color: #667eea !important;
}

/* Loading state */
.polska-mapa-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    color: #666;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.polska-mapa-loading::before {
    content: '🗺️';
    font-size: 24px;
    margin-right: 10px;
}

/* Error state */
.polska-mapa-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #ffe6e6;
    color: #d63031;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    text-align: center;
    padding: 20px;
}

.polska-mapa-error::before {
    content: '⚠️';
    font-size: 24px;
    margin-right: 10px;
}

/* Kontrolki nawigacji */
.mapboxgl-ctrl-group {
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.mapboxgl-ctrl button {
    border-radius: 0 !important;
}

.mapboxgl-ctrl-group button:first-child {
    border-top-left-radius: 8px !important;
    border-top-right-radius: 8px !important;
}

.mapboxgl-ctrl-group button:last-child {
    border-bottom-left-radius: 8px !important;
    border-bottom-right-radius: 8px !important;
}

/* Ukryj attribution dla czystszego wyglądu */
.mapboxgl-ctrl-attrib {
    font-size: 10px !important;
    background: rgba(255, 255, 255, 0.8) !important;
}

/* Stylizacja dla WordPress */
.wp-block-shortcode .polska-mapa-container {
    margin: 20px auto;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .miasto-popup {
        background: #2c2c2c;
        color: #fff;
    }

    .miasto-popup h4 {
        color: #64B5F6;
    }

    .miasto-popup p {
        color: #ccc;
    }

    .miasto-popup small {
        color: #999;
    }
}

/* Print styles */
@media print {
    .polska-mapa-container {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .mapboxgl-popup {
        display: none !important;
    }
}