/*
========================================
SISTEMA CENTRALIZADO DE DROPDOWNS
LAND PROPERTY MAP
========================================
Archivo: app/static/css/components/dropdowns.css
Descripción: Estilos centralizados para TODOS los dropdowns del proyecto
Creado: Enero 2026

GUÍA DE USO:
-----------
1. Agregar clase "lp-dropdown" al contenedor del dropdown
2. Usar clases de variante para diferentes estilos:
   - lp-dropdown-default (estilo base)
   - lp-dropdown-premium (gradientes y efectos premium)
   - lp-dropdown-compact (tamaño reducido)
   - lp-dropdown-actions (menú de acciones/opciones)
   
3. Para ítems usar:
   - lp-dropdown-item (ítem estándar)
   - lp-dropdown-header (encabezado de sección)
   - lp-dropdown-divider (separador)
   
4. Estados de ítems:
   - lp-item-success (verde - acciones positivas)
   - lp-item-warning (amarillo - precaución)
   - lp-item-danger (rojo - eliminar/peligro)
   - lp-item-info (azul - información)
========================================
*/

/* ===========================================
   VARIABLES CSS PARA DROPDOWNS
   =========================================== */
:root {
    /* Dimensiones */
    --dropdown-min-width: 200px;
    --dropdown-max-width: 320px;
    --dropdown-padding: 0.5rem;
    --dropdown-item-padding: 0.6rem 1rem;
    --dropdown-border-radius: 12px;
    --dropdown-item-radius: 8px;
    
    /* Colores base */
    --dropdown-bg: var(--tema-fondo-tarjeta, #ffffff);
    --dropdown-border: var(--tema-borde-color, rgba(30, 144, 255, 0.2));
    --dropdown-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    
    /* Colores de ítems */
    --dropdown-item-color: var(--tema-texto-primario, #2c3e50);
    --dropdown-item-hover-bg: var(--tema-fondo-hover, rgba(30, 144, 255, 0.08));
    --dropdown-item-hover-color: var(--tema-primario, #1e90ff);
    
    /* Header y divider */
    --dropdown-header-color: var(--tema-texto-secundario, #6c757d);
    --dropdown-divider-color: var(--tema-borde-color, rgba(0, 0, 0, 0.1));
    
    /* Iconos */
    --dropdown-icon-size: 1rem;
    --dropdown-icon-margin: 0.75rem;
    
    /* Animación */
    --dropdown-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --dropdown-animation-duration: 0.2s;
}

/* ===========================================
   DROPDOWN BASE (LP-DROPDOWN)
   =========================================== */
.lp-dropdown,
.dropdown-menu.lp-dropdown {
    position: relative;
    min-width: var(--dropdown-min-width);
    max-width: var(--dropdown-max-width);
    padding: var(--dropdown-padding);
    background: var(--dropdown-bg);
    border: 1px solid var(--dropdown-border);
    border-radius: var(--dropdown-border-radius);
    box-shadow: var(--dropdown-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: lpDropdownFadeIn var(--dropdown-animation-duration) ease-out;
    z-index: 1050;
    overflow: hidden;
}

/* Animación de entrada */
@keyframes lpDropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ===========================================
   ITEMS DEL DROPDOWN
   =========================================== */
.lp-dropdown-item,
.lp-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    padding: var(--dropdown-item-padding);
    color: var(--dropdown-item-color);
    background: transparent;
    border: none;
    border-radius: var(--dropdown-item-radius);
    cursor: pointer;
    transition: var(--dropdown-transition);
    text-decoration: none;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 2px 0;
}

.lp-dropdown-item:hover,
.lp-dropdown-item:focus,
.lp-dropdown .dropdown-item:hover,
.lp-dropdown .dropdown-item:focus {
    background: var(--dropdown-item-hover-bg);
    color: var(--dropdown-item-hover-color);
    text-decoration: none;
    transform: translateX(4px);
}

/* Iconos en ítems */
.lp-dropdown-item i,
.lp-dropdown-item .fa,
.lp-dropdown-item .fas,
.lp-dropdown-item .far,
.lp-dropdown-item .bi,
.lp-dropdown .dropdown-item i {
    font-size: var(--dropdown-icon-size);
    margin-right: var(--dropdown-icon-margin);
    width: 20px;
    text-align: center;
    opacity: 0.8;
    transition: var(--dropdown-transition);
}

.lp-dropdown-item:hover i,
.lp-dropdown .dropdown-item:hover i {
    opacity: 1;
    transform: scale(1.1);
}

/* ===========================================
   HEADER Y DIVIDER
   =========================================== */
.lp-dropdown-header,
.lp-dropdown .dropdown-header {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--dropdown-header-color);
    margin-bottom: 0.25rem;
}

.lp-dropdown-divider,
.lp-dropdown .dropdown-divider {
    height: 0;
    margin: 0.5rem 0;
    border: 0;
    border-top: 1px solid var(--dropdown-divider-color);
}

/* ===========================================
   ESTADOS DE ÍTEMS (COLORES)
   =========================================== */
/* Éxito (verde) */
.lp-item-success {
    color: #28a745 !important;
}
.lp-item-success:hover {
    background: rgba(40, 167, 69, 0.15) !important;
    color: #28a745 !important;
}
.lp-item-success i {
    color: #28a745 !important;
}

/* Advertencia (amarillo/naranja) */
.lp-item-warning {
    color: #e0a800 !important;
}
.lp-item-warning:hover {
    background: rgba(255, 193, 7, 0.15) !important;
    color: #d39e00 !important;
}
.lp-item-warning i {
    color: #e0a800 !important;
}

/* Peligro (rojo) */
.lp-item-danger {
    color: #dc3545 !important;
}
.lp-item-danger:hover {
    background: rgba(220, 53, 69, 0.15) !important;
    color: #dc3545 !important;
}
.lp-item-danger i {
    color: #dc3545 !important;
}

/* Info (azul claro) */
.lp-item-info {
    color: #17a2b8 !important;
}
.lp-item-info:hover {
    background: rgba(23, 162, 184, 0.15) !important;
    color: #17a2b8 !important;
}
.lp-item-info i {
    color: #17a2b8 !important;
}

/* Estados en tema nocturno - colores más brillantes */
[data-tema="nocturno"] .lp-item-success,
[data-tema="nocturno"] .lp-item-success i {
    color: #4ade80 !important;
}
[data-tema="nocturno"] .lp-item-warning,
[data-tema="nocturno"] .lp-item-warning i {
    color: #fbbf24 !important;
}
[data-tema="nocturno"] .lp-item-danger,
[data-tema="nocturno"] .lp-item-danger i {
    color: #f87171 !important;
}
[data-tema="nocturno"] .lp-item-info,
[data-tema="nocturno"] .lp-item-info i {
    color: #38bdf8 !important;
}

/* Estados en tema futurista - con efecto neón */
[data-tema="futurista"] .lp-item-success,
[data-tema="futurista"] .lp-item-success i {
    color: #00ff88 !important;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
}
[data-tema="futurista"] .lp-item-success:hover {
    text-shadow: 0 0 15px #00ff88, 0 0 25px rgba(0, 255, 136, 0.6) !important;
}

[data-tema="futurista"] .lp-item-warning,
[data-tema="futurista"] .lp-item-warning i {
    color: #ffcc00 !important;
    text-shadow: 0 0 8px rgba(255, 204, 0, 0.5);
}
[data-tema="futurista"] .lp-item-warning:hover {
    text-shadow: 0 0 15px #ffcc00, 0 0 25px rgba(255, 204, 0, 0.6) !important;
}

[data-tema="futurista"] .lp-item-danger,
[data-tema="futurista"] .lp-item-danger i {
    color: #ff0055 !important;
    text-shadow: 0 0 8px rgba(255, 0, 85, 0.5);
}
[data-tema="futurista"] .lp-item-danger:hover {
    text-shadow: 0 0 15px #ff0055, 0 0 25px rgba(255, 0, 85, 0.6) !important;
}

[data-tema="futurista"] .lp-item-info,
[data-tema="futurista"] .lp-item-info i {
    color: #00ccff !important;
    text-shadow: 0 0 8px rgba(0, 204, 255, 0.5);
}
[data-tema="futurista"] .lp-item-info:hover {
    text-shadow: 0 0 15px #00ccff, 0 0 25px rgba(0, 204, 255, 0.6) !important;
}

/* ===========================================
   VARIANTE: PREMIUM (Gradientes y efectos)
   =========================================== */
.lp-dropdown-premium,
.dropdown-menu.lp-dropdown-premium {
    position: relative;
}

/* Premium en tema claro */
:root .lp-dropdown-premium,
[data-tema="default"] .lp-dropdown-premium {
    background: linear-gradient(135deg, 
        #ffffff 0%, 
        #f0f7ff 100%
    ) !important;
    border: 1px solid rgba(30, 144, 255, 0.2) !important;
    box-shadow: 
        0 10px 40px rgba(30, 144, 255, 0.15),
        0 0 0 1px rgba(30, 144, 255, 0.05) !important;
}

:root .lp-dropdown-premium .lp-dropdown-item:hover,
:root .lp-dropdown-premium .dropdown-item:hover,
[data-tema="default"] .lp-dropdown-premium .lp-dropdown-item:hover,
[data-tema="default"] .lp-dropdown-premium .dropdown-item:hover {
    background: linear-gradient(135deg, 
        rgba(30, 144, 255, 0.1) 0%, 
        rgba(65, 105, 225, 0.08) 100%
    ) !important;
}

:root .lp-dropdown-premium .lp-dropdown-header,
[data-tema="default"] .lp-dropdown-premium .lp-dropdown-header {
    background: linear-gradient(135deg, #1e90ff 0%, #4169e1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ===========================================
   VARIANTE: COMPACT (Tamaño reducido)
   =========================================== */
.lp-dropdown-compact {
    --dropdown-min-width: 160px;
    --dropdown-padding: 0.35rem;
    --dropdown-item-padding: 0.4rem 0.75rem;
    --dropdown-border-radius: 8px;
    --dropdown-item-radius: 6px;
}

.lp-dropdown-compact .lp-dropdown-item,
.lp-dropdown-compact .dropdown-item {
    font-size: 0.85rem;
}

.lp-dropdown-compact .lp-dropdown-item i,
.lp-dropdown-compact .dropdown-item i {
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

/* ===========================================
   VARIANTE: ACTIONS (Menú de acciones)
   =========================================== */
.lp-dropdown-actions {
    --dropdown-min-width: 180px;
    --dropdown-max-width: 220px;
}

.lp-dropdown-actions .lp-dropdown-item {
    font-weight: 500;
}

.lp-dropdown-actions .lp-dropdown-item i {
    width: 24px;
}

/* ===========================================
   TOGGLE BUTTON (Botón que abre el dropdown)
   =========================================== */
.lp-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: var(--dropdown-transition);
    color: var(--tema-texto-secundario, #6c757d);
}

.lp-dropdown-toggle:hover {
    background: var(--tema-fondo-hover, rgba(30, 144, 255, 0.08));
    color: var(--tema-primario, #1e90ff);
}

.lp-dropdown-toggle i {
    font-size: 1.25rem;
}

/* Flecha del dropdown toggle */
.lp-dropdown-toggle::after,
.dropdown-toggle.lp-dropdown-toggle::after {
    display: inline-block;
    margin-left: 0.5rem;
    vertical-align: 0.1em;
    content: "";
    border-top: 0.35em solid;
    border-right: 0.35em solid transparent;
    border-bottom: 0;
    border-left: 0.35em solid transparent;
    transition: transform 0.2s ease;
}

.lp-dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

/* ===========================================
   INTEGRACIÓN CON SISTEMA DE TEMAS
   =========================================== */

/* ----------------------------------------
   TEMA CLARO (DEFAULT)
   Fondo: Blanco | Letras: Azul
   ---------------------------------------- */
:root .lp-dropdown,
[data-tema="default"] .lp-dropdown,
.lp-dropdown {
    --dropdown-bg: #ffffff;
    --dropdown-border: rgba(30, 144, 255, 0.2);
    --dropdown-shadow: 0 10px 40px rgba(30, 144, 255, 0.15);
    --dropdown-item-color: #1e90ff;
    --dropdown-item-hover-bg: rgba(30, 144, 255, 0.08);
    --dropdown-item-hover-color: #4169e1;
    --dropdown-header-color: #1e90ff;
    --dropdown-divider-color: rgba(30, 144, 255, 0.15);
}

:root .lp-dropdown,
[data-tema="default"] .lp-dropdown {
    background: #ffffff !important;
}

:root .lp-dropdown-item,
:root .lp-dropdown .dropdown-item,
[data-tema="default"] .lp-dropdown-item,
[data-tema="default"] .lp-dropdown .dropdown-item {
    color: #1e90ff !important;
}

:root .lp-dropdown-item:hover,
:root .lp-dropdown .dropdown-item:hover,
[data-tema="default"] .lp-dropdown-item:hover,
[data-tema="default"] .lp-dropdown .dropdown-item:hover {
    color: #4169e1 !important;
    background: rgba(30, 144, 255, 0.08) !important;
}

:root .lp-dropdown-item i,
:root .lp-dropdown .dropdown-item i,
[data-tema="default"] .lp-dropdown-item i,
[data-tema="default"] .lp-dropdown .dropdown-item i {
    color: #1e90ff !important;
}

:root .lp-dropdown-header,
:root .lp-dropdown .dropdown-header,
[data-tema="default"] .lp-dropdown-header,
[data-tema="default"] .lp-dropdown .dropdown-header {
    color: #4169e1 !important;
}

[data-tema="default"] .lp-dropdown-premium {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 1) 0%, 
        rgba(248, 250, 255, 1) 100%
    ) !important;
    border-color: rgba(30, 144, 255, 0.2) !important;
}

/* ----------------------------------------
   TEMA OSCURO (NOCTURNO)
   Fondo: Negro | Letras: Blanco
   ---------------------------------------- */
[data-tema="nocturno"] .lp-dropdown {
    --dropdown-bg: #0d1117;
    --dropdown-border: rgba(230, 237, 243, 0.15);
    --dropdown-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    --dropdown-item-color: #e6edf3;
    --dropdown-item-hover-bg: rgba(230, 237, 243, 0.1);
    --dropdown-item-hover-color: #ffffff;
    --dropdown-header-color: rgba(230, 237, 243, 0.7);
    --dropdown-divider-color: rgba(230, 237, 243, 0.1);
}

[data-tema="nocturno"] .lp-dropdown {
    background: #0d1117 !important;
    border: 1px solid rgba(230, 237, 243, 0.15) !important;
}

[data-tema="nocturno"] .lp-dropdown-item,
[data-tema="nocturno"] .lp-dropdown .dropdown-item {
    color: #e6edf3 !important;
}

[data-tema="nocturno"] .lp-dropdown-item:hover,
[data-tema="nocturno"] .lp-dropdown .dropdown-item:hover {
    color: #ffffff !important;
    background: rgba(230, 237, 243, 0.1) !important;
}

[data-tema="nocturno"] .lp-dropdown-item i,
[data-tema="nocturno"] .lp-dropdown .dropdown-item i {
    color: #e6edf3 !important;
}

[data-tema="nocturno"] .lp-dropdown-header,
[data-tema="nocturno"] .lp-dropdown .dropdown-header {
    color: rgba(230, 237, 243, 0.7) !important;
}

[data-tema="nocturno"] .lp-dropdown-divider,
[data-tema="nocturno"] .lp-dropdown .dropdown-divider {
    border-color: rgba(230, 237, 243, 0.1) !important;
}

[data-tema="nocturno"] .lp-dropdown-premium {
    background: linear-gradient(135deg, 
        #0d1117 0%, 
        #161b22 100%
    ) !important;
    border-color: rgba(230, 237, 243, 0.15) !important;
}

/* ----------------------------------------
   TEMA FUTURISTA
   Fondo: Muy borroso (glassmorphism)
   Letras: Cian (#00f7ff) - Igual que iconos navbar
   ---------------------------------------- */
[data-tema="futurista"] .lp-dropdown {
    --dropdown-bg: rgba(5, 15, 30, 0.4);
    --dropdown-border: rgba(0, 247, 255, 0.4);
    --dropdown-shadow: 
        0 10px 40px rgba(0, 247, 255, 0.2),
        0 0 30px rgba(0, 247, 255, 0.15),
        inset 0 1px 0 rgba(0, 247, 255, 0.2);
    --dropdown-item-color: #00f7ff;
    --dropdown-item-hover-bg: rgba(0, 247, 255, 0.15);
    --dropdown-item-hover-color: #00f7ff;
    --dropdown-header-color: #00f7ff;
    --dropdown-divider-color: rgba(0, 247, 255, 0.3);
}

[data-tema="futurista"] .lp-dropdown {
    background: rgba(5, 15, 30, 0.4) !important;
    border: 1px solid rgba(0, 247, 255, 0.4) !important;
    backdrop-filter: blur(30px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(30px) saturate(150%) !important;
    box-shadow: 
        0 10px 40px rgba(0, 247, 255, 0.2),
        0 0 30px rgba(0, 247, 255, 0.15),
        inset 0 1px 0 rgba(0, 247, 255, 0.2) !important;
}

[data-tema="futurista"] .lp-dropdown-item,
[data-tema="futurista"] .lp-dropdown .dropdown-item {
    color: #00f7ff !important;
}

[data-tema="futurista"] .lp-dropdown-item:hover,
[data-tema="futurista"] .lp-dropdown .dropdown-item:hover {
    color: #00f7ff !important;
    background: rgba(0, 247, 255, 0.15) !important;
    text-shadow: 0 0 10px #00f7ff, 0 0 20px rgba(0, 247, 255, 0.5) !important;
}

[data-tema="futurista"] .lp-dropdown-item i,
[data-tema="futurista"] .lp-dropdown .dropdown-item i {
    color: #00f7ff !important;
    text-shadow: 0 0 8px rgba(0, 247, 255, 0.6);
}

[data-tema="futurista"] .lp-dropdown-item:hover i,
[data-tema="futurista"] .lp-dropdown .dropdown-item:hover i {
    text-shadow: 0 0 15px #00f7ff, 0 0 25px rgba(0, 247, 255, 0.8) !important;
}

[data-tema="futurista"] .lp-dropdown-header,
[data-tema="futurista"] .lp-dropdown .dropdown-header {
    color: #00f7ff !important;
    text-shadow: 0 0 10px rgba(0, 247, 255, 0.5);
}

[data-tema="futurista"] .lp-dropdown-divider,
[data-tema="futurista"] .lp-dropdown .dropdown-divider {
    border-color: rgba(0, 247, 255, 0.3) !important;
    box-shadow: 0 0 5px rgba(0, 247, 255, 0.3);
}

[data-tema="futurista"] .lp-dropdown-premium {
    background: rgba(5, 15, 30, 0.5) !important;
    border: 1px solid rgba(0, 247, 255, 0.5) !important;
    backdrop-filter: blur(40px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(40px) saturate(180%) !important;
    box-shadow: 
        0 15px 50px rgba(0, 247, 255, 0.25),
        0 0 40px rgba(0, 247, 255, 0.2),
        inset 0 0 20px rgba(0, 247, 255, 0.05) !important;
}

/* Efecto neón en bordes para futurista */
[data-tema="futurista"] .lp-dropdown::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(0, 247, 255, 0.3), transparent, rgba(0, 110, 255, 0.3));
    z-index: -1;
    opacity: 0.5;
}

/* ===========================================
   COMPATIBILIDAD CON BOOTSTRAP 5
   =========================================== */
/* Asegurar que las clases de Bootstrap funcionen bien */
.dropdown-menu.lp-dropdown.show,
.lp-dropdown.show {
    display: block;
}

/* Override para evitar conflictos con Bootstrap */
.dropdown-menu.lp-dropdown {
    margin: 0;
    top: 100%;
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 576px) {
    .lp-dropdown {
        --dropdown-min-width: 180px;
        --dropdown-max-width: 280px;
        --dropdown-item-padding: 0.75rem 1rem;
    }
    
    .lp-dropdown-item i,
    .lp-dropdown .dropdown-item i {
        font-size: 1.1rem;
    }
}

/* ===========================================
   UTILIDADES ADICIONALES
   =========================================== */
/* Dropdown alineado a la derecha */
.lp-dropdown-end {
    right: 0;
    left: auto;
}

/* Dropdown con ancho completo */
.lp-dropdown-full {
    width: 100%;
    max-width: none;
}

/* Ítem deshabilitado */
.lp-dropdown-item.disabled,
.lp-dropdown-item:disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
}

/* Ítem activo */
.lp-dropdown-item.active {
    background: var(--tema-gradiente-primario, linear-gradient(135deg, #1e90ff 0%, #4169e1 100%));
    color: #ffffff;
}

.lp-dropdown-item.active i {
    color: #ffffff;
    opacity: 1;
}

/* ===========================================
   NAVBAR DROPDOWNS - ESTILOS ESPECÍFICOS
   Estos aplican a .premium-dropdown y 
   .navbar .dropdown-menu directamente
   
   NOTA: Los estilos principales para los 3 temas
   están en tema-variables.css con selectores
   html[data-tema] de alta especificidad
   =========================================== */

/* Estilos base para mejorar la transición */
.navbar .dropdown-menu,
.navbar-premium .dropdown-menu,
.premium-dropdown {
    border-radius: 12px;
    padding: 0.5rem;
    animation: lpDropdownFadeIn 0.2s ease-out;
}

.navbar .dropdown-item,
.navbar-premium .dropdown-item,
.premium-dropdown .dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
}

.navbar .dropdown-header,
.navbar-premium .dropdown-header,
.premium-dropdown .dropdown-header {
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 1rem;
