/* FILE: css/mapa-comunidad.css
 * Estilos exclusivos para el Mapa de la Comunidad — Layout Waze-like
 * Mapa fullscreen + controles flotantes con glassmorphism
 */

/* ============================================
   BASE: Página fullscreen
   ============================================ */
.waze-map-page {
    position: relative;
    width: 100%;
    height: calc(100vh - 70px);
    /* Resta la navbar */
    margin-top: 70px;
    /* Espacio para navbar fixed */
    overflow: hidden;
    background: #1a1a2e;
}

.waze-map-page #mapa-resultados {
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* ============================================
   GLASSMORPHISM BASE
   ============================================ */
.glass {
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.glass-dark {
    background: rgba(30, 30, 50, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    color: #fff;
}

/* ============================================
   BUSCADOR FLOTANTE — Top Left
   ============================================ */
.waze-search-float {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 1000;
    width: 380px;
    max-width: calc(100vw - 180px);
    border-radius: 16px;
    padding: 12px 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.waze-search-float:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}

.waze-search-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.waze-search-row .ts-wrapper {
    flex: 1;
}

.waze-search-row .ts-control {
    border: none !important;
    background: transparent !important;
    padding: 8px 4px !important;
    font-size: 14px !important;
    box-shadow: none !important;
}

.waze-search-row .ts-control:focus,
.waze-search-row .ts-wrapper.focus .ts-control {
    border: none !important;
    box-shadow: none !important;
}

.waze-search-row .ts-dropdown {
    border-radius: 12px !important;
    border: 1px solid rgba(0, 0, 0, 0.1) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15) !important;
    margin-top: 8px !important;
    overflow: hidden;
}

.waze-btn-gps {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4285F4 0%, #1a73e8 100%);
    color: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

.waze-btn-gps:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(66, 133, 244, 0.4);
}

.waze-btn-gps:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* --- Radio Slider (debajo del buscador) --- */
.waze-radio-widget {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
}

.waze-radio-widget label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    margin: 0;
}

.waze-radio-widget input[type="range"] {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: #e0e0e0;
    outline: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.waze-radio-widget input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.4);
    transition: transform 0.2s;
}

.waze-radio-widget input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.waze-radio-widget input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea, #764ba2);
    cursor: pointer;
    border: none;
}

.waze-radio-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    min-width: 45px;
    text-align: center;
}

/* ============================================
   FILTROS FLOTANTES — Top Right
   ============================================ */
.waze-filters-float {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.waze-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    user-select: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    white-space: nowrap;
}

.waze-chip:hover {
    transform: translateX(-4px);
}

.waze-chip input[type="checkbox"] {
    display: none;
}

.waze-chip .chip-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* Chip activo vs inactivo */
.waze-chip.active {
    border-color: currentColor;
}

.waze-chip.inactive {
    opacity: 0.5;
}

.waze-chip.inactive .chip-dot {
    background: #ccc !important;
}

/* Chip colores */
.waze-chip--parque {
    color: #28a745;
}

.waze-chip--parque .chip-dot {
    background: #28a745;
}

.waze-chip--parque.active {
    border-color: #28a745;
}

.waze-chip--petfriendly {
    color: #fd7e14;
}

.waze-chip--petfriendly .chip-dot {
    background: #fd7e14;
}

.waze-chip--petfriendly.active {
    border-color: #fd7e14;
}

.waze-chip--peligro {
    color: #dc3545;
}

.waze-chip--peligro .chip-dot {
    background: #dc3545;
}

.waze-chip--peligro.active {
    border-color: #dc3545;
}

/* ============================================
   FAB — Botón Flotante Bottom Right
   ============================================ */
.waze-fab {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    font-size: 26px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.45);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.waze-fab:hover {
    transform: scale(1.12) rotate(90deg);
    box-shadow: 0 10px 30px rgba(255, 152, 0, 0.5);
}

.waze-fab:active {
    transform: scale(0.95);
}

/* Tooltip al hover */
.waze-fab-wrapper {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
}

.waze-fab-label {
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.waze-fab-wrapper:hover .waze-fab-label {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================
   BADGE RESULTADOS — Bottom Left
   ============================================ */
.waze-results-badge {
    position: absolute;
    bottom: 30px;
    left: 16px;
    z-index: 1000;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
    max-width: 320px;
}

.waze-results-badge i {
    margin-right: 6px;
}

/* ============================================
   OVERLAY INICIAL — Centro del mapa
   ============================================ */
.waze-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.waze-overlay-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px 36px;
    text-align: center;
    max-width: 420px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: waze-float-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes waze-float-in {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(30px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.waze-overlay-card .overlay-icon {
    font-size: 60px;
    margin-bottom: 16px;
    display: block;
    animation: waze-bounce 2s infinite;
}

@keyframes waze-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.waze-overlay-card h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
}

.waze-overlay-card p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 8px;
}

.waze-overlay-card .overlay-tip {
    margin-top: 16px;
    padding: 10px 14px;
    background: #f0f4ff;
    border-radius: 10px;
    font-size: 0.85rem;
    color: #555;
}

.waze-overlay-card .overlay-tip i {
    color: #ffc107;
    margin-right: 6px;
}

/* ============================================
   MODAL (override mínimos para consistencia)
   ============================================ */
.waze-map-page .modal-content {
    border-radius: 16px;
    border: none;
    overflow: hidden;
}

.waze-map-page .modal-header {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
    border: none;
}

.waze-map-page .modal-header .btn-close {
    filter: brightness(0) invert(1);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .waze-map-page {
        height: calc(100dvh - 60px);
        margin-top: 60px;
    }

    .waze-search-float {
        width: calc(100vw - 32px);
        max-width: none;
        top: 10px;
        left: 16px;
        right: 16px;
        padding: 10px 12px;
        border-radius: 14px;
    }

    .waze-filters-float {
        top: auto;
        bottom: 100px;
        right: 16px;
        flex-direction: column;
        gap: 6px;
    }

    .waze-chip {
        padding: 8px 12px;
        font-size: 12px;
        border-radius: 12px;
    }

    .waze-fab-wrapper {
        bottom: 24px;
        right: 16px;
    }

    .waze-fab {
        width: 54px;
        height: 54px;
        font-size: 22px;
    }

    .waze-results-badge {
        bottom: 24px;
        left: 12px;
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 10px;
        max-width: calc(100vw - 100px);
    }

    .waze-overlay-card {
        padding: 30px 24px;
        border-radius: 20px;
    }

    .waze-overlay-card .overlay-icon {
        font-size: 48px;
    }

    .waze-overlay-card h2 {
        font-size: 1.3rem;
    }

    .waze-radio-widget {
        margin-top: 8px;
        padding-top: 8px;
    }
}

@media (max-width: 480px) {
    .waze-filters-float {
        bottom: 90px;
    }

    .waze-chip span {
        display: none;
    }

    .waze-chip {
        padding: 10px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
    }

    .waze-chip .chip-dot {
        width: 14px;
        height: 14px;
    }
}