/* Estilos para las tabs */
.tabs-container {
    margin-bottom: 2rem;
}

.tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 2rem;
}

.tab {
    padding: 1rem 2rem;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1.1em;
    color: #666;
    position: relative;
    transition: all 0.3s ease;
}

.tab.active {
    color: rgb(75, 192, 192);
    font-weight: bold;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgb(75, 192, 192);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Estilos para el análisis de variabilidad */
.variability-analysis-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.variability-analysis-container h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.analysis-description {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.table-container {
    overflow-x: auto;
}

#variability-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#variability-table th,
#variability-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#variability-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

#variability-table tbody tr:hover {
    background-color: rgba(75, 192, 192, 0.1);
}

.tendencia {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: bold;
    display: inline-block;
}

.tendencia.alza {
    background-color: rgba(255, 99, 132, 0.2);
    color: rgb(255, 99, 132);
}

.tendencia.baja {
    background-color: rgba(75, 192, 192, 0.2);
    color: rgb(75, 192, 192);
}

/* Estilos para las tabs de análisis */
.analysis-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 2px solid #e0e0e0;
    margin-bottom: 2rem;
}

.analysis-tab {
    padding: 1rem 2rem;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 1.1em;
    color: #666;
    position: relative;
    transition: all 0.3s ease;
}

.analysis-tab.active {
    color: rgb(75, 192, 192);
    font-weight: bold;
}

.analysis-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: rgb(75, 192, 192);
}

.analysis-content {
    display: none;
}

.analysis-content.active {
    display: block;
}

/* Estilos para el selector de período */
.period-selector {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.year-range-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.year-range-container > label {
    display: block;
    margin-bottom: 1rem;
    font-weight: bold;
    color: #2c3e50;
}

.year-controls {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.year-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.year-input label {
    font-size: 0.9rem;
    color: #666;
}

.year-select {
    padding: 0.5rem 2rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.year-select:hover {
    border-color: #4CAF50;
}

/* Estilos para la nueva fila de gráficos */
.charts-row {
    margin: 2rem 0;
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.charts-row .chart-container {
    width: 100%;
}

/* Ajustar los contenedores de gráficos */
.charts-column {
    margin-bottom: 4rem;
    width: 100%;
}

.chart-container {
    background: white;
    border-radius: 15px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    height: 650px;
}

.chart-header {
    margin-bottom: 1rem;
}

/* Asegurar que los gráficos respeten el contenedor */
#grafico-combo-mensual,
#grafico-linea,
#grafico-crecimiento,
#grafico-distribucion {
    width: 100% !important;
    height: 100% !important;
}

/* Ajustar el espaciado entre gráficos */
.charts-column:not(:last-child) {
    margin-bottom: 2rem;
}

@media screen and (max-width: 480px) {
    .header-logo {
        width: 30px;
        height: 30px;
    }
    
    .header-container h1 {
        font-size: 1.2rem;
    }
    
    .tab {
        padding: 0.75rem 1rem;
        font-size: 1em;
    }
}

/* Analysis section styles */
.variability-analysis-container {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    margin-top: 2rem;
}

.analysis-description {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.5;
}

/* Table styles */
.table-container {
    overflow-x: auto;
}

#variability-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

#variability-table th,
#variability-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

#variability-table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #2c3e50;
}

#variability-table tbody tr:hover {
    background-color: rgba(75, 192, 192, 0.1);
}

/* Trend indicators */
.tendencia {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: bold;
    display: inline-block;
}

.tendencia.alza {
    background-color: rgba(255, 99, 132, 0.2);
    color: rgb(255, 99, 132);
}

.tendencia.baja {
    background-color: rgba(75, 192, 192, 0.2);
    color: rgb(75, 192, 192);
}

/* Year selector styles */
.year-controls {
    display: flex;
    gap: 2rem;
    justify-content: center;
    align-items: center;
}

.year-input {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.year-select {
    padding: 0.5rem 2rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    background-color: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.year-select:hover {
    border-color: #4CAF50;
}

/* Chart specific styles */
#grafico-combo-mensual,
#grafico-linea,
#grafico-crecimiento,
#grafico-distribucion {
    width: 100%;
    height: 100%;
}

/* Header styles */
.header-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    margin: 0 auto;
}

.header-container h1 {
    margin: 0;
    font-size: 1.8rem;
    color: white;
}

@media screen and (max-width: 768px) {
    .header-container {
        padding: 0.5rem;
    }
    
    .header-container h1 {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    .header-container h1 {
        font-size: 1.2rem;
    }
}

/* MIFIC Table Styles */
.mific-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-size: 1.1em;
}

.mific-table th,
.mific-table td {
    padding: 15px 20px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.mific-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.mific-table tr:hover {
    background-color: #f8f9fa;
}

/* Price change indicators */
.price-change {
    font-weight: 500;
    color: #333; /* Default color for null values */
}

.price-change.positive {
    color: #dc3545; /* Red for price increases */
}

.price-change.negative {
    color: #28a745; /* Green for price decreases */
}

/* Responsive table */
@media screen and (max-width: 768px) {
    .table-container {
        overflow-x: auto;
    }
    
    .mific-table {
        min-width: 500px;
    }
}

/* Error message styling */
.error-message {
    color: #dc3545;
    padding: 10px;
    margin-top: 10px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

/* Actualizar los estilos de precios */
.price-up {
    color: #dc3545;
    font-weight: 500;
}

.price-down {
    color: #28a745;
    font-weight: 500;
}

.price-up, .price-down {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s;
}

.action-btn.create-user {
    background-color: #4CAF50;
    color: white;
}

.action-btn.login {
    background-color: #2196F3;
    color: white;
}

.action-btn.publish {
    background-color: #ff9800;
    color: white;
}

.action-btn:hover {
    opacity: 0.9;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.product-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.product-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #333;
}

.price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2c3e50;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.user-info, .location-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #666;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
} 