/* Estilos específicos para el módulo de costos */

/* Tarjetas de resumen de costos */
.cost-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.cost-summary-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cost-summary-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.cost-summary-value {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #fff;
}

.cost-summary-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.cost-summary-detail {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Tabs de proyecciones */
.projections-tabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.projection-tab {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.projection-tab:hover {
    background: #e9ecef;
    border-color: #667eea;
}

.projection-tab.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Grid de proyecciones */
.projection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.projection-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.projection-card:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.projection-card h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1.1rem;
}

.projection-value {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    margin: 10px 0;
}

.projection-detail {
    font-size: 0.9rem;
    color: #6c757d;
    margin: 5px 0;
}

/* Items de clusters con costos */
.cluster-cost-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin: 15px 0;
    transition: all 0.3s ease;
}

.cluster-cost-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.cluster-cost-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.cluster-cost-header h4 {
    margin: 0;
    color: #495057;
    font-size: 1.3rem;
}

.cluster-cost-total {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
}

.cluster-cost-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin: 15px 0;
}

.cost-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.cost-detail-row span:first-child {
    color: #6c757d;
}

.cost-detail-row span:last-child {
    font-weight: bold;
    color: #495057;
}

.cluster-cost-breakdown {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
}

.node-type-cost {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 5px 0;
    font-size: 0.9rem;
    display: inline-block;
    margin-right: 10px;
}

.cluster-projections {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 8px;
    padding: 10px 15px;
    margin-top: 15px;
    text-align: center;
}

/* Optimizaciones */
.optimization-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.optimization-item {
    display: flex;
    align-items: flex-start;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
}

.optimization-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
}

.optimization-item.high {
    border-left: 4px solid #dc3545;
}

.optimization-item.medium {
    border-left: 4px solid #ffc107;
}

.optimization-item.low {
    border-left: 4px solid #28a745;
}

.optimization-item.info {
    border-left: 4px solid #17a2b8;
}

.optimization-icon {
    font-size: 2rem;
    margin-right: 20px;
    flex-shrink: 0;
}

.optimization-content {
    flex: 1;
}

.optimization-content h5 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 1.2rem;
}

.optimization-content p {
    margin: 0 0 10px 0;
    color: #6c757d;
    line-height: 1.5;
}

.optimization-savings {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 0.9rem;
    display: inline-block;
}

/* Historial de costos */
.cost-history-controls {
    margin: 20px 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cost-history-table {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.cost-history-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 1.5fr;
    gap: 10px;
    padding: 15px;
    font-weight: bold;
}

.cost-history-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr 1.5fr;
    gap: 10px;
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
    transition: background-color 0.3s ease;
}

.cost-history-row:hover {
    background-color: #f8f9fa;
}

.cost-history-row:last-child {
    border-bottom: none;
}

/* Tendencias */
.trend-up {
    color: #dc3545 !important;
}

.trend-down {
    color: #28a745 !important;
}

/* Responsive */
@media (max-width: 768px) {
    .cost-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .projection-grid {
        grid-template-columns: 1fr;
    }
    
    .projections-tabs {
        flex-direction: column;
    }
    
    .cluster-cost-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .cluster-cost-details {
        grid-template-columns: 1fr;
    }
    
    .cost-history-header,
    .cost-history-row {
        grid-template-columns: 1fr;
        text-align: left;
    }
    
    .optimization-item {
        flex-direction: column;
        text-align: center;
    }
    
    .optimization-icon {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Animaciones */
@keyframes costUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.cost-summary-value.updating {
    animation: costUpdate 0.6s ease-in-out;
}

/* Integración con el tema existente */
.cost-summary-card .metric-value {
    color: white;
}

.cost-summary-card .metric-label {
    color: rgba(255, 255, 255, 0.9);
}

/* Estados de carga */
.cost-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.cost-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}