/* assets/frontend.css */

/* AGRESYWNY RESET STYLÓW - NA POCZĄTKU */
.interactive-route-map-container,
.interactive-route-map-container *,
.irm-frontend-map,
.irm-frontend-map *,
.irm-map-wrapper,
div.interactive-route-map-container,
div.irm-frontend-map,
div.irm-map-wrapper,
.wp-block-shortcode .interactive-route-map-container,
.wp-block-shortcode .irm-frontend-map,
.entry-content .interactive-route-map-container,
.entry-content .irm-frontend-map,
article .interactive-route-map-container,
article .irm-frontend-map,
main .interactive-route-map-container,
main .irm-frontend-map {
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    border-width: 0 !important;
    border-style: none !important;
    border-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    box-sizing: border-box !important;
}

/* Reset max-width dla kontenerów */
.interactive-route-map-container {
    max-width: none !important;
}

.irm-frontend-map {
    max-width: 1274px !important; /* Jedyny dozwolony max-width */
    border-radius: 16px !important;
    border: 13px solid #2c2c2c !important;
}

/* Kontener główny mapy */
.interactive-route-map-container {
    position: relative;
    margin: 20px auto;
    border-radius: 10px;
    overflow: hidden;
    width: 100%;
}

.irm-frontend-map {
    position: relative;
    width: 100%;
    aspect-ratio: 1274 / 815;
    margin: 0 auto;
    overflow: hidden;
}

.irm-frontend-map img.irm-map-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Loading state */
.irm-loading {
    font-size: 18px;
    color: #666;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.irm-loading::before {
    content: "🗺️";
    font-size: 32px;
    margin-right: 10px;
}

/* Error state */
.route-map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    font-size: 16px;
    color: #999;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 10px;
    text-align: center;
    padding: 20px;
}

/* Punkty na mapie */
.irm-map-point {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #ff0000;
    border: 1px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
    box-shadow: 0 3px 12px rgba(255, 0, 0, 0.4);
    z-index: 10;
}

.irm-map-point:hover {
    transform: translate(-50%, -50%) scale(1.3);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.6);
}

.irm-map-point.visited {
    background: #00aa00;
    box-shadow: 0 3px 12px rgba(0, 170, 0, 0.4);
}

.irm-map-point.visited:hover {
    box-shadow: 0 6px 20px rgba(0, 170, 0, 0.6);
}

/* Aktualna pozycja (zastąpienie motorka) */
.irm-current-position {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #0066ff;
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
    transition: all 0.5s ease;
    box-shadow: 0 4px 15px rgba(0, 102, 255, 0.5);
}

/* Animacja dla aktualnej pozycji */
@keyframes currentPositionPulse {
    0% { 
        box-shadow: 0 4px 15px rgba(0, 102, 255, 0.5);
        transform: translate(-50%, -50%) scale(1);
    }
    50% { 
        box-shadow: 0 4px 15px rgba(0, 102, 255, 0.8), 0 0 0 8px rgba(0, 102, 255, 0.1);
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% { 
        box-shadow: 0 4px 15px rgba(0, 102, 255, 0.5);
        transform: translate(-50%, -50%) scale(1);
    }
}

.irm-current-position {
    animation: currentPositionPulse 2s ease-in-out infinite;
}

/* Linia trasy */
.irm-route-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.irm-route-line path {
    stroke: #ff0000;
    stroke-width: 2;
    stroke-dasharray: 12,8;
    filter: drop-shadow(0 2px 4px rgba(255, 0, 0, 0.3));
}

/* Modal */
.irm-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.irm-modal.show {
    display: flex;
}

.irm-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.irm-modal-container {
    position: relative;
    max-width: 90vw;
    min-width: 70vw;
    max-height: 90vh;
    overflow: hidden;
    border-radius: 16px;
    background: #0C0C0F;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.irm-modal-content {
    position: relative;
    padding: 0;
    overflow-y: auto;
    max-height: 90vh;
}

.irm-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.irm-modal-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Galeria w modalu */
.irm-modal-gallery {
    padding: 20px;
    background: #0C0C0F;
}

.irm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 300px);
    gap: 20px;
    margin-bottom: 20px;
    justify-content: center;
}

.irm-gallery-item {
    position: relative;
    width: 300px;
    height: 300px;
    overflow: hidden;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
    transition: all 0.3s ease;
}

.irm-gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.irm-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.irm-gallery-item:hover img {
    transform: scale(1.05);
}

/* Tekst w modalu */
.irm-modal-text {
    padding: 30px;
    background: #0C0C0F;
    color: #ffffff;
}

.irm-modal-text h2 {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.3;
}

.irm-modal-text p {
    margin: 0 0 15px 0;
    font-size: 16px;
    line-height: 1.7;
    color: #cccccc;
}

.irm-modal-text p:last-child {
    margin-bottom: 0;
}

/* Lightbox dla powiększonych zdjęć */
.irm-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.irm-lightbox.show {
    display: flex;
}

.irm-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
}

.irm-lightbox-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 10px;
}

.irm-lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.irm-lightbox-close:hover {
    transform: scale(1.2);
}

.irm-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 24px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.irm-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

.irm-lightbox-prev {
    left: -80px;
}

.irm-lightbox-next {
    right: -80px;
}

/* Animacje */
@keyframes pointPulse {
    0% { box-shadow: 0 3px 12px rgba(255, 0, 0, 0.4); }
    50% { box-shadow: 0 3px 12px rgba(255, 0, 0, 0.8), 0 0 0 10px rgba(255, 0, 0, 0.1); }
    100% { box-shadow: 0 3px 12px rgba(255, 0, 0, 0.4); }
}

.irm-map-point:hover {
    animation: pointPulse 1.5s infinite;
}

/* Responsywność */
@media (max-width: 768px) {
    .interactive-route-map-container {
        margin: 0;
        width: 100%;
        border-radius: 0;
    }
    
    .irm-frontend-map {
        width: 100%;
        border-radius: 0;
        height: fit-content !important;
    }
    
    .irm-frontend-map img.irm-map-image {
        border: none;
        border-radius: 0;
    }
    
    /* Mniejsze punkty na mobile */
    .irm-map-point {
        width: 4px;
        height: 4px;
        border-width: 0.5px;
        box-shadow: 0 1px 3px rgba(255, 0, 0, 0.4);
    }
    
    .irm-map-point:hover {
        transform: translate(-50%, -50%) scale(2);
    }
    
    /* Mniejsza aktualna pozycja na mobile */
    .irm-current-position {
        width: 6px;
        height: 6px;
        border-width: 1px;
        box-shadow: 0 2px 8px rgba(0, 102, 255, 0.4);
    }
    
    .irm-modal-container {
        max-width: 95vw;
        max-height: 95vh;
        margin: 10px;
        border-radius: 15px;
    }
    
    .irm-gallery-grid {
        grid-template-columns: repeat(2, 150px);
        gap: 10px;
        justify-content: center;
    }
    
    .irm-gallery-item {
        width: 150px;
        height: 150px;
    }
}

@media (max-width: 480px) {
    .irm-map-point {
        width: 3px;
        height: 3px;
    }
    
    .irm-current-position {
        width: 5px;
        height: 5px;
    }
    
    .irm-gallery-grid {
        grid-template-columns: repeat(2, 140px);
        gap: 8px;
    }
    
    .irm-gallery-item {
        width: 140px;
        height: 140px;
    }
}

/* Klasa body podczas otwartego modala */
body.modal-open {
    overflow: hidden;
}