/**
 * Estilos para la calculadora de calorías
 */

.calculadora-calorias-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #333;
    line-height: 1.5;
}

.calculadora-titulo {
    text-align: center;
    margin-bottom: 30px;
}

/* Tabs */
.calculadora-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.tab-button {
    padding: 10px 20px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    cursor: pointer;
    margin-right: 5px;
    border-radius: 5px 5px 0 0;
    font-weight: 600;
    transition: background-color 0.3s;
}

.tab-button.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* Formulario */
.calculadora-form {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.form-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

.macros-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.total-porcentaje {
    grid-column: 1 / -1;
    margin-top: 10px;
    font-weight: 600;
}

.porcentaje-alert {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 5px;
}

.form-actions {
    margin-top: 20px;
    text-align: center;
}

.btn-calcular {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.btn-calcular:hover {
    background-color: #2980b9;
}

.loading {
    margin-top: 10px;
    font-style: italic;
    color: #666;
}

/* Resultados */
.resultado-container {
    background-color: #fff;
    border: 1px solid #2ecc71;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

.resultado-header {
    background-color: #2ecc71;
    color: white;
    padding: 15px 20px;
}

.resultado-header h3 {
    margin: 0;
    font-size: 20px;
}

.resultado-body {
    padding: 20px;
}

.resultado-section {
    margin-bottom: 25px;
}

.resultado-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.resultado-item {
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed #eee;
    padding-bottom: 8px;
}

.resultado-label {
    font-weight: 600;
    flex: 1;
}

.resultado-value {
    font-weight: 700;
    color: #2c3e50;
    text-align: right;
    margin-left: 10px;
}

.resultado-unit {
    color: #7f8c8d;
    margin-left: 5px;
    font-size: 0.9em;
}

/* Gráfico de macros */
.macros-chart-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.macros-chart {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background-color: #f5f5f5;
    position: relative;
    overflow: hidden;
}

.chart-segment {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transform-origin: center;
    clip-path: polygon(50% 50%, 50% 0%, 100% 0%, 100% 100%, 0% 100%, 0% 0%, 50% 0%);
}

.chart-proteinas {
    background-color: #3498db;
    z-index: 3;
}

.chart-carbohidratos {
    background-color: #2ecc71;
    z-index: 2;
}

.chart-grasas {
    background-color: #e74c3c;
    z-index: 1;
}

.chart-legend {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 0 10px;
}

.legend-color {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    margin-right: 5px;
}

.proteinas-color {
    background-color: #3498db;
}

.carbohidratos-color {
    background-color: #2ecc71;
}

.grasas-color {
    background-color: #e74c3c;
}

.resultado-alert {
    background-color: #fcf8e3;
    border: 1px solid #faebcc;
    color: #8a6d3b;
    padding: 10px 15px;
    border-radius: 4px;
    margin-top: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .macros-inputs {
        grid-template-columns: 1fr;
    }
    
    .resultado-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .resultado-value {
        margin-top: 5px;
    }
}