/* ============================================
   CALCULADORA DE GRASA CORPORAL - CSS
   ============================================ */

/* Datos Básicos */
.datos-basicos {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-radius: 12px;
}

.datos-basicos h3 {
    font-size: 1.125rem;
    color: #1e40af;
    margin-bottom: 1rem;
    font-weight: 700;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

/* Medidas Info */
.medidas-info {
    padding: 1rem;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.medidas-info p {
    margin: 0.5rem 0;
    color: #78350f;
    font-size: 0.875rem;
    font-weight: 500;
}

.medidas-grupo {
    margin-bottom: 1.5rem;
}

/* Gráfico de Porcentaje */
.grafico-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 12px;
}

.grafico-barra {
    height: 40px;
    background: linear-gradient(90deg, 
        #10b981 0%, 
        #10b981 10%, 
        #3b82f6 10%, 
        #3b82f6 25%, 
        #22c55e 25%, 
        #22c55e 40%, 
        #f59e0b 40%, 
        #f59e0b 60%, 
        #ef4444 60%, 
        #ef4444 100%
    );
    border-radius: 20px;
    position: relative;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.grafico-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 20px;
    transition: width 1s ease;
}

.grafico-indicador {
    position: absolute;
    top: -10px;
    width: 4px;
    height: calc(100% + 20px);
    background: #1f2937;
    border-radius: 2px;
    transition: left 1s ease;
}

.grafico-indicador::before {
    content: '▼';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: #1f2937;
    font-size: 1rem;
}

.grafico-leyenda {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 600;
}

.leyenda-item {
    text-align: center;
    flex: 1;
}

.leyenda-item.esencial { color: #10b981; }
.leyenda-item.atleta { color: #3b82f6; }
.leyenda-item.fitness { color: #22c55e; }
.leyenda-item.promedio { color: #f59e0b; }
.leyenda-item.obeso { color: #ef4444; }

/* Composición Grid */
.composicion-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.comp-card {
    padding: 1.5rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.comp-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.comp-card.grasa { border-color: #fbbf24; }
.comp-card.magra { border-color: #3b82f6; }
.comp-card.imc { border-color: #8b5cf6; }
.comp-card.ideal { border-color: #10b981; }

.comp-card:hover.grasa { border-color: #f59e0b; }
.comp-card:hover.magra { border-color: #2563eb; }
.comp-card:hover.imc { border-color: #7c3aed; }
.comp-card:hover.ideal { border-color: #059669; }

.comp-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.comp-label {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.comp-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
}

/* Tabla de Rangos */
.tabla-rangos {
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
}

.tabla-rangos h3 {
    font-size: 1.25rem;
    color: #1e40af;
    margin-bottom: 1.5rem;
    text-align: center;
}

.rangos-table {
    width: 100%;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.rangos-table table {
    width: 100%;
    border-collapse: collapse;
}

.rangos-table th {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.875rem;
}

.rangos-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.875rem;
    color: #4b5563;
}

.rangos-table tr:last-child td {
    border-bottom: none;
}

.rangos-table tr:hover {
    background: #f9fafb;
}

.rangos-table tr.activo {
    background: #dbeafe;
    font-weight: 600;
}

.rangos-table tr.activo td {
    color: #1e40af;
}

.categoria-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-esencial { background: #d1fae5; color: #065f46; }
.badge-atleta { background: #dbeafe; color: #1e40af; }
.badge-fitness { background: #d1fae5; color: #047857; }
.badge-promedio { background: #fed7aa; color: #92400e; }
.badge-obeso { background: #fee2e2; color: #991b1b; }

/* Recomendaciones */
.recomendaciones {
    padding: 2rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    margin: 2rem 0;
}

.recomendaciones h3 {
    font-size: 1.25rem;
    color: #1f2937;
    margin-bottom: 1rem;
}

.recomendacion-item {
    padding: 1rem;
    background: #f9fafb;
    border-left: 4px solid #3b82f6;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.recomendacion-item:last-child {
    margin-bottom: 0;
}

.recomendacion-item strong {
    color: #1e40af;
    font-weight: 700;
}

.recomendacion-item p {
    margin: 0.5rem 0 0 0;
    color: #4b5563;
    line-height: 1.6;
}

/* Clasificación en Resultado Principal */
.resultado-clasificacion {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.9375rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.clasif-esencial {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.clasif-atleta {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.clasif-fitness {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #047857;
}

.clasif-promedio {
    background: linear-gradient(135deg, #fed7aa 0%, #fdba74 100%);
    color: #92400e;
}

.clasif-obeso {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .method-buttons {
        grid-template-columns: 1fr;
    }

    .composicion-grid {
        grid-template-columns: 1fr;
    }

    .grafico-leyenda {
        flex-direction: column;
        gap: 0.5rem;
    }

    .leyenda-item {
        text-align: left;
    }

    .rangos-table {
        font-size: 0.75rem;
    }

    .rangos-table th,
    .rangos-table td {
        padding: 0.5rem;
    }
}

@media (max-width: 480px) {
    .datos-basicos {
        padding: 1rem;
    }

    .comp-icon {
        font-size: 2rem;
    }

    .comp-value {
        font-size: 1.25rem;
    }

    .resultado-clasificacion {
        font-size: 0.8125rem;
        padding: 0.375rem 1rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .breadcrumb,
    .calculator-header,
    .method-selector,
    .datos-basicos,
    .calc-form,
    .resultado-acciones {
        display: none !important;
    }

    .calculator-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
    }

    .grafico-container,
    .tabla-rangos,
    .recomendaciones {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}