/**
 * Receptor Styles - Vista de Receptor de Eventos
 */

.receptor-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
}

.receptor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
    box-sizing: border-box;
}

.receptor-title h2 {
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
}

.receptor-title p {
    font-size: 0.875rem;
    color: var(--secondary);
}

.receptor-controls {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.receptor-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    flex: 1;
    min-height: 500px;
    width: 100%;
    box-sizing: border-box;
}

.receptor-left,
.receptor-right {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
    min-width: 0;
    overflow: hidden;
}

/* ==================== EVENTOS TABLE ==================== */
.eventos-section h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.eventos-table-wrapper {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid var(--border);
}

.eventos-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.eventos-table thead {
    background-color: var(--light);
    border-bottom: 2px solid var(--border);
}

.eventos-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--dark);
}

.eventos-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background-color 0.2s;
}

.eventos-table tbody tr:hover {
    background-color: rgba(37, 99, 235, 0.05);
}

.eventos-table td {
    padding: 1rem;
}

.eventos-table tr.placeholder {
    text-align: center;
    color: var(--secondary);
}

/* ==================== MAPA ==================== */
.mapa-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 100%;
}

.mapa-section h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.map-container {
    width: 100%;
    height: 400px;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    flex: 1;
}

#map {
    width: 100%;
    height: 100%;
}

/* ==================== FILTERS MODAL ==================== */
.filters-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    z-index: 1000;
}

.filters-modal.active {
    display: flex;
}

.filters-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.filters-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100%;
    background: white;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 1001;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary), var(--dark));
    color: white;
}

.filters-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    opacity: 0.8;
}

.filters-content {
    padding: 2rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-direction: column;
}

.filter-actions .btn {
    flex: 1;
    width: 100%;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .receptor-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .map-container {
        height: 300px;
    }

    .receptor-container {
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .receptor-container {
        gap: 1rem;
        padding: 0 1rem;
    }

    .receptor-header {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 0.75rem;
    }

    .receptor-title h2 {
        font-size: 1.25rem;
        margin-bottom: 0.125rem;
    }

    .receptor-controls {
        width: 100%;
        gap: 0.5rem;
    }

    .receptor-controls .btn {
        width: 100%;
        padding: 0.75rem;
        font-size: 0.875rem;
    }

    .receptor-content {
        grid-template-columns: 1fr;
        gap: 1rem;
        min-height: auto;
    }

    .receptor-left,
    .receptor-right {
        padding: 1rem;
        border-radius: 8px;
    }

    .events-section h3,
    .mapa-section h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .eventos-table-wrapper {
        border-radius: 6px;
    }

    .eventos-table {
        font-size: 0.7rem;
        width: 100%;
    }

    .eventos-table thead {
        font-size: 0.65rem;
    }

    .eventos-table th,
    .eventos-table td {
        padding: 0.5rem 0.35rem;
    }

    .eventos-table th:nth-child(3),
    .eventos-table td:nth-child(3) {
        font-size: 0.65rem;
    }

    .map-container {
        height: 250px;
        min-height: 250px;
        width: 100%;
        border-radius: 8px;
    }

    .filters-panel {
        max-width: 90vw;
        width: 90vw;
        height: auto;
        max-height: 90vh;
    }

    .filters-content {
        padding: 1.5rem 1rem;
    }

    .filter-group {
        margin-bottom: 1rem;
    }

    .filter-group label {
        font-size: 0.875rem;
    }

    .filter-group select,
    .filter-group input {
        padding: 0.625rem;
        font-size: 0.8rem;
    }

    .filter-actions {
        gap: 0.75rem;
        margin-top: 1.5rem;
    }

    .filter-actions .btn {
        padding: 0.625rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .receptor-container {
        gap: 0.75rem;
        padding: 0 0.5rem;
    }

    .receptor-header {
        padding: 0.75rem;
        gap: 0.5rem;
    }

    .receptor-title h2 {
        font-size: 1.1rem;
    }

    .receptor-title p {
        font-size: 0.75rem;
    }

    .receptor-content {
        gap: 0.75rem;
    }

    .receptor-left,
    .receptor-right {
        padding: 0.75rem;
    }

    .eventos-table {
        font-size: 0.6rem;
    }

    .eventos-table th,
    .eventos-table td {
        padding: 0.35rem 0.25rem;
    }

    .map-container {
        height: 200px;
    }

    .filters-panel {
        max-width: 95vw;
        width: 95vw;
    }

    .filters-header h2 {
        font-size: 1.1rem;
    }

    .filters-content {
        padding: 1rem;
    }
}

/**
 * Estilos para marcadores del mapa
 */

/* Marcadores antiguos */
.marker-antiguo {
    z-index: 400 !important;
}

/* Marcadores del primer evento */
.marker-primero {
    z-index: 420 !important;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.8));
}

/* Marcadores del último evento */
.marker-ultimo {
    z-index: 500 !important;
    filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    animation: pulse-ultimo 2s infinite;
}

/* Animación de pulso para el último marcador */
@keyframes pulse-ultimo {
    0%, 100% {
        filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
        opacity: 1;
    }
    50% {
        filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
        opacity: 1;
    }
}

/* Flechas direccionales */
.flecha-direccion {
    z-index: 450 !important;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.flecha-direccion svg {
    display: block;
}

/* Popup personalizado */
.leaflet-popup-content {
    margin: 0;
    padding: 0;
    font-size: 12px;
}

.leaflet-popup-content-wrapper {
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(0, 0, 0, 0.1);
}
