/* Layout Principal */
.uiaa-fullscreen-layout {
    display: flex;
    flex-direction: row;
    height: calc(100vh - 80px);
    /* Leave room for wp header if needed */
    min-height: 600px;
    width: 100%;
    margin: 20px 0;
    overflow: hidden;
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    background: #f8fafc;
}

/* Sidebar */
.uiaa-sidebar {
    width: 35%;
    min-width: 340px;
    max-width: 450px;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    z-index: 10;
}

/* Header de Filtros */
.uiaa-sidebar-header {
    padding: 24px 20px;
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    z-index: 2;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}

.uiaa-filters-row {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uiaa-filter-select {
    width: 100%;
    padding: 0 35px 0 14px;
    /* Eliminado el padding vertical y ajustado el horizontal */
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    /* Safair fallback */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    box-sizing: border-box;
    height: 48px;
}

.uiaa-filter-select:hover {
    border-color: #05498b;
}

.uiaa-filter-select:focus {
    outline: none;
    border-color: #05498b;
    box-shadow: 0 0 0 3px rgba(5, 73, 139, 0.15);
}

/* Lista Compacta */
.uiaa-compact-list {
    flex-grow: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #f1f5f9;
}

/* Scrollbar styling */
.uiaa-compact-list::-webkit-scrollbar {
    width: 6px;
}

.uiaa-compact-list::-webkit-scrollbar-track {
    background: transparent;
}

.uiaa-compact-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 10px;
}

/* Elemento de lista (Tarjeta) */
.uiaa-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
}

.uiaa-list-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    border-color: #e2e8f0;
}

.uiaa-list-item.is-active {
    background-color: #ffffff;
    border-color: #05498b;
    box-shadow: 0 6px 16px rgba(5, 73, 139, 0.15);
    transform: translateY(-1px);
}

/* Contenido del elemento */
.uiaa-list-item__content {
    flex-grow: 1;
    padding-right: 16px;
}

.uiaa-list-item__title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
    color: #05498b;
    line-height: 1.3;
}

.uiaa-list-item__meta {
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.uiaa-list-item__meta strong {
    color: #1e293b;
    font-weight: 600;
}

/* Icono/Enlace compacto */
.uiaa-list-item__link {
    color: #ffffff;
    background-color: #ed9603;
    text-decoration: none;
    min-width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 3px 8px rgba(237, 150, 3, 0.3);
}

.uiaa-list-item__link:hover {
    background-color: #d18200;
    transform: scale(1.08);
    color: #ffffff;
}

/* Contenedor del Mapa */
.uiaa-map-wrapper {
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

#uiaa-map {
    height: 100%;
    width: 100%;
    background-color: #e5e7eb;
}

.uiaa-custom-marker {
    background: transparent;
    border: none;
}

.uiaa-custom-marker svg {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

.uiaa-custom-marker:hover svg {
    transform: scale(1.15);
}

/* Ajuste del Popup nativo de Leaflet */
.leaflet-popup-content-wrapper {
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 2px;
}

.leaflet-popup-content {
    font-family: "Inter", -apple-system, sans-serif;
    margin: 16px 18px 14px 18px;
}

.uiaa-map-popup {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.uiaa-map-popup strong {
    color: #05498b;
    font-size: 16px;
    line-height: 1.3;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 8px;
    margin-bottom: 2px;
    display: block;
}

.uiaa-map-popup-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.uiaa-map-popup-meta span {
    font-size: 13px;
    color: #475569;
    display: flex;
    align-items: center;
    gap: 6px;
}

.leaflet-container a.leaflet-popup-close-button {
    color: #64748b;
    padding: 6px 6px 0 0;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: #ed9603;
}

/* Eliminar el filtro de mapa asqueroso, dejaremos el tileset original y cambiaremos los botones */
.leaflet-tile-pane {
    filter: contrast(1.02) sepia(0.02);
}

/* Para que los botones de zoom nativos de Leaflet usen tu azul */
.leaflet-bar a {
    color: #05498b !important;
    border-radius: 6px !important;
}

.leaflet-bar {
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-bar a:hover {
    background-color: #f1f5f9 !important;
}

/* Responsive Mobile */
@media (max-width: 768px) {
    .uiaa-fullscreen-layout {
        flex-direction: column;
        height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .uiaa-sidebar {
        width: 100%;
        max-width: 100%;
        order: 2;
        flex-grow: 1;
        height: 50vh;
    }

    .uiaa-map-wrapper {
        width: 100%;
        height: 50vh;
        order: 1;
        flex-shrink: 0;
    }

    .uiaa-filters-row {
        flex-direction: row;
    }
}