/* styles.css */

/* Reset general */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Encabezado principal */
.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeInDown 1s ease-out;
}

.header h1 {
    font-size: 3rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Layout principal */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.calculator-section,
.info-section,
.chart-container,
.info-card,
.history-section {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #4a5568;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

/* Formularios */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.input-group {
    display: flex;
    align-items: center;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px;
    transition: all 0.3s ease;
}

.input-group:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-group input {
    border: none;
    background: transparent;
    flex: 1;
    font-size: 1.1rem;
    outline: none;
    padding: 5px;
}

.unit {
    color: #718096;
    font-weight: 500;
    margin-left: 10px;
}

.unit-toggle {
    display: flex;
    background: #e2e8f0;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 20px;
}

.unit-toggle button {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.unit-toggle button.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.calculate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* Resultados */
.result-container {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 15px;
    border-left: 5px solid #667eea;
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.result-container.show {
    display: block;
}

.imc-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: #667eea;
    text-align: center;
    margin-bottom: 10px;
}

.imc-category {
    font-size: 1.3rem;
    text-align: center;
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 8px;
    font-weight: 600;
}

.underweight { background: #bee3f8; color: #2b6cb0; }
.normal { background: #c6f6d5; color: #22543d; }
.overweight { background: #fbb6ce; color: #b83280; }
.obese { background: #feb2b2; color: #c53030; }

.recommendations {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-top: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.07);
}

.recommendations h4 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.recommendations ul {
    list-style: none;
}

.recommendations li {
    padding: 8px 0;
    border-bottom: 1px solid #e2e8f0;
}

.recommendations li:before {
    content: "\2713";
    color: #48bb78;
    font-weight: bold;
    margin-right: 10px;
}

/* Info extra */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.info-card {
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-5px);
}

.info-card h3 {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.info-card p {
    color: #718096;
    line-height: 1.6;
}

.imc-range-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.imc-range {
    width: 80%;
    text-align: center;
    font-weight: 600;
    color: #2d3748;
    padding: 12px 20px;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.imc-range:hover {
    transform: scale(1.03);
}


/* Historial */
.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin: 8px 0;
    background: #f7fafc;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.clear-history {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 10px;
}

.clear-history:hover {
    background: #c53030;
}

/* Animaciones */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 768px) {
    .header h1 { font-size: 2rem; }
    .main-content { grid-template-columns: 1fr; gap: 20px; }
    .container { padding: 10px; }
    .info-grid { grid-template-columns: 1fr; }
}
