/* Dashboard container */
.dashboard-container {
    height: 100%;
}

/* KPI cards - Futuristic Design */
.kpi-card {
    height: 100%;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-card);
    border: 1px solid var(--border-primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
}

.kpi-card:hover .kpi-icon {
    opacity: 0.6;
    transform: translateY(-50%) scale(1.1);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, 
        rgba(0, 168, 255, 0.5), 
        rgba(0, 255, 158, 0.5)
    );
    transition: height 0.3s ease;
    z-index: 1;
}

.kpi-card:hover::before {
    height: 5px;
}

.kpi-title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: var(--font-weight-medium);
    color: rgba(220, 220, 220, 0.7);
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.kpi-value {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    margin-top: var(--spacing-sm);
    text-shadow: 0 0 10px rgba(0, 168, 255, 0.3);
}

.kpi-subtitle {
    font-size: 0.8rem;
    color: var(--light-color);
    opacity: 0.7;
    margin-top: 2px;
    font-style: italic;
}

.kpi-icon {
    position: absolute;
    top: 50%;
    right: var(--spacing-md);
    transform: translateY(-50%);
    font-size: 2.5rem;
    opacity: 0.3;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

/* Charts - Futuristic Design */
.chart-card {
    height: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-primary);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.4);
}

.chart-container {
    position: relative;
    height: 230px;
    margin-top: var(--spacing-md);
    padding: 10px;
}

/* Animation for KPI cards */
.kpi-card {
    animation: fadeInUp 0.5s ease-out;
}

.kpi-card:nth-child(1) {
    animation-delay: 0.1s;
}

.kpi-card:nth-child(2) {
    animation-delay: 0.2s;
}

.kpi-card:nth-child(3) {
    animation-delay: 0.3s;
}

.kpi-card:nth-child(4) {
    animation-delay: 0.4s;
}

/* Animation for charts */
.chart-card {
    animation: fadeInUp 0.6s ease-out;
}

.chart-card:nth-child(1) {
    animation-delay: 0.5s;
}

.chart-card:nth-child(2) {
    animation-delay: 0.6s;
}

/* Keyframes for animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Color variations for KPI cards */
.kpi-card:nth-child(1) .kpi-value,
.kpi-card:nth-child(1) .kpi-icon {
    color: var(--primary-color);
}

.kpi-card:nth-child(2) .kpi-value,
.kpi-card:nth-child(2) .kpi-icon {
    color: var(--success-color);
}

.kpi-card:nth-child(3) .kpi-value,
.kpi-card:nth-child(3) .kpi-icon {
    color: var(--warning-color);
}

.kpi-card:nth-child(4) .kpi-value,
.kpi-card:nth-child(4) .kpi-icon {
    color: var(--info-color);
}

.kpi-card:nth-child(5) .kpi-value,
.kpi-card:nth-child(5) .kpi-icon {
    color: var(--purple-color);
}

/* Estilo especial para KPI de propiedades seleccionadas */
.highlight-kpi {
    border: 1px solid var(--border-primary);
    transition: all 0.3s ease;
}

.highlight-kpi::before {
    background: linear-gradient(90deg, 
        rgba(128, 0, 255, 0.5), 
        rgba(255, 0, 255, 0.5)
    );
}

.highlight-kpi .kpi-value {
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(128, 0, 255, 0.4);
}

.highlight-kpi.active {
    background: linear-gradient(145deg, 
        rgba(20, 20, 40, 1),
        rgba(40, 10, 60, 1)
    );
    border: 2px solid var(--purple-color);
    box-shadow: 0 0 15px rgba(130, 60, 255, 0.5);
    transform: scale(1.02);
    animation: pulse 2s infinite;
}

.highlight-kpi.active .kpi-value,
.highlight-kpi.active .kpi-icon {
    color: var(--purple-color) !important;
    text-shadow: 0 0 8px rgba(130, 60, 255, 0.4);
}

.highlight-kpi.active .kpi-title {
    color: rgba(130, 60, 255, 0.9);
    font-weight: 600;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 5px rgba(128, 0, 255, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(128, 0, 255, 0.5);
    }
    100% {
        box-shadow: 0 0 5px rgba(128, 0, 255, 0.3);
    }
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .chart-container {
        height: 180px;
    }
}

/* Estilos para información de filtro de gráfico */
.chart-filter-info {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(90deg, rgba(0, 168, 255, 0.1), rgba(0, 255, 158, 0.1));
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--light-color);
    border: 1px solid rgba(0, 168, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.2);
    margin-left: auto;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
}

.chart-filter-info i {
    margin-right: 6px;
    color: var(--info-color);
}

.chart-info {
    text-align: center;
    margin-bottom: 5px;
}

.chart-info .small {
    font-size: 0.75rem;
    opacity: 0.8;
}

.chart-info i {
    margin-right: 4px;
}

.card-footer {
    background-color: rgba(0, 0, 0, 0.2);
    border-top: 1px solid rgba(0, 168, 255, 0.1);
    padding: 8px;
}

#reset-status-filter {
    font-size: 0.8rem;
    padding: 4px 10px;
    background-color: transparent;
    border-color: rgba(0, 168, 255, 0.3);
    transition: all 0.3s ease;
}

#reset-status-filter:hover {
    background-color: rgba(0, 168, 255, 0.1);
    border-color: rgba(0, 168, 255, 0.6);
    box-shadow: 0 0 10px rgba(0, 168, 255, 0.3);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Estilos para leyenda personalizada */
.legend-header {
    background-color: rgba(10, 10, 10, 0.5);
    border-radius: 5px;
    padding: 8px 12px;
    border: 1px solid rgba(0, 194, 255, 0.15);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 5px;
}

.legend-header h6 {
    color: var(--primary-color);
    font-size: 0.9rem;
    text-shadow: 0 0 5px rgba(0, 194, 255, 0.3);
    margin-bottom: 0;
}

.legend-header button {
    width: 30px;
    height: 30px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.custom-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 10px 5px;
    margin-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 200px;
    overflow-y: auto;
}

.legend-item {
    display: flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.legend-item:hover {
    transform: translateY(-2px);
    background-color: rgba(0, 0, 0, 0.4);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 6px;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.legend-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .kpi-card {
        margin-bottom: var(--spacing-md);
    }
    
    .kpi-value {
        font-size: 1.25rem;
    }
    
    .kpi-icon {
        font-size: 2rem;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .chart-filter-info {
        font-size: 0.7rem;
        padding: 3px 8px;
        margin-top: 5px;
        margin-left: 0;
    }
    
    .futuristic-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .custom-legend {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
    }
    
    .legend-item {
        flex-shrink: 0;
    }
}
