/* Estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

select, button {
    padding: 0.5rem;
    border-radius: 4px;
    border: 1px solid #ddd;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#reset-filters {
    background-color: #e74c3c;
}

#reset-filters:hover {
    background-color: #c0392b;
}

main {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-section {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.dashboard-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

/* KPI Cards */
.kpi-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.kpi-card {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.kpi-card h3 {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 0.5rem;
}

.kpi-card p {
    font-size: 1.8rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Charts */
.charts-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.chart-wrapper {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.chart-wrapper h3 {
    font-size: 1rem;
    color: #7f8c8d;
    margin-bottom: 1rem;
    text-align: center;
}

.chart-wrapper.wide {
    grid-column: 1 / -1;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table.display {
    width: 100%;
    border-collapse: collapse;
}

table.display th, table.display td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table.display th {
    background-color: #f2f2f2;
    font-weight: bold;
}

table.display tr:hover {
    background-color: #f5f5f5;
}

/* Footer */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* Estilos para la sección de predicción */
.prediction-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.button-group {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.primary-button {
    background-color: #2c3e50;
}

.primary-button:hover {
    background-color: #1a2530;
}

.prediction-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    background-color: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.model-info, .product-info, .prediction-result-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.status {
    font-weight: bold;
    padding: 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.status.training {
    background-color: #f39c12;
    color: white;
}

.status.trained {
    background-color: #2ecc71;
    color: white;
}

.model-metrics, .product-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.metric, .detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric span:first-child, .detail span:first-child {
    font-size: 0.9rem;
    color: #7f8c8d;
}

.metric span:last-child, .detail span:last-child {
    font-weight: bold;
    color: #2c3e50;
}

.prediction-result-container {
    text-align: center;
}

#prediction-result {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 0.5rem;
    border-radius: 4px;
}

.high-probability {
    color: #2ecc71;
}

.medium-probability {
    color: #f39c12;
}

.low-probability {
    color: #e74c3c;
}

.probability {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

/* Estilos para tablas de predicción */
#segment-prediction-table, #products-prediction-table {
    width: 100%;
    border-collapse: collapse;
}

#segment-prediction-table th, #segment-prediction-table td,
#products-prediction-table th, #products-prediction-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

#segment-prediction-table th, #products-prediction-table th {
    background-color: #f2f2f2;
    font-weight: bold;
}

.high-probability-row {
    background-color: rgba(46, 204, 113, 0.1);
}

.medium-probability-row {
    background-color: rgba(243, 156, 18, 0.1);
}

.low-probability-row {
    background-color: rgba(231, 76, 60, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .filters, .prediction-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group, .button-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .kpi-cards, .charts-container, .prediction-info {
        grid-template-columns: 1fr;
    }
}