/**
 * Single Map Styles - Estilos para mapa de single posts
 * 
 * @package WP_Geo_Posts_Map
 * @author Dante Testa <https://dantetesta.com.br>
 * @since 1.0.2
 * @created 09/01/2026 às 23:20
 */

/* Container do Mapa Single */
.wpgpm-single-map-wrapper {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.wpgpm-single-map {
    width: 100%;
    height: 100%;
    min-height: 200px;
}

/* Ajuste para Leaflet dentro do container */
.wpgpm-single-map-wrapper .leaflet-container {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    font-family: inherit;
}

/* Estilo do marker */
.wpgpm-single-map-wrapper .leaflet-marker-icon {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wpgpm-single-map-wrapper .leaflet-marker-icon:hover {
    transform: scale(1.1);
}

/* ===========================
   Modal do Single Map
   =========================== */

.wpgpm-single-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.wpgpm-single-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.wpgpm-single-modal-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: wpgpm-single-modal-in 0.3s ease;
}

@keyframes wpgpm-single-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Botão Fechar */
.wpgpm-single-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef4444;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    padding: 0;
    line-height: 1;
    font-size: 20px;
    font-weight: bold;
}

.wpgpm-single-modal-close::before {
    content: "✕";
    display: block;
}

.wpgpm-single-modal-close:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.wpgpm-single-modal-close svg {
    display: none;
}

/* Imagem do Modal */
.wpgpm-single-modal-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

.wpgpm-single-modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Conteúdo do Modal */
.wpgpm-single-modal-content {
    padding: 20px 24px 24px;
}

.wpgpm-single-modal-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.3;
}

/* Categorias */
.wpgpm-single-modal-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.wpgpm-single-modal-cat {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 20px;
}

/* Endereço */
.wpgpm-single-modal-address {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
}

.wpgpm-single-modal-address svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #3b82f6;
}

/* Body com modal aberto */
body.wpgpm-modal-open {
    overflow: hidden;
}

/* ===========================
   Responsividade
   =========================== */

@media (max-width: 768px) {
    .wpgpm-single-map-wrapper {
        border-radius: 8px;
    }

    .wpgpm-single-modal {
        padding: 16px;
    }

    .wpgpm-single-modal-container {
        border-radius: 12px;
    }

    .wpgpm-single-modal-image {
        height: 160px;
    }

    .wpgpm-single-modal-content {
        padding: 16px 20px 20px;
    }

    .wpgpm-single-modal-title {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .wpgpm-single-modal-image {
        height: 140px;
    }

    .wpgpm-single-modal-content {
        padding: 14px 16px 18px;
    }

    .wpgpm-single-modal-title {
        font-size: 16px;
    }

    .wpgpm-single-modal-address {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* ===========================
   Acessibilidade
   =========================== */

.wpgpm-single-modal-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.wpgpm-single-map-wrapper:focus-within {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Preferência de movimento reduzido */
@media (prefers-reduced-motion: reduce) {
    .wpgpm-single-modal-container {
        animation: none;
    }

    .wpgpm-single-modal-close,
    .wpgpm-single-map-wrapper .leaflet-marker-icon {
        transition: none;
    }
}
