*{
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root{
    /* Colors  */
    --primary-color:#3B82F6;
    --secondary-color:#10B981;
    --danger-color:#EF4444;
    --warning-color:#F59E0B;
    --bg-color:#F3F4F6;
    --card-bg:#FFFFFF;
    --text-primary:#1F2937;
    --text-secondary:#6B7280;
    --border-color:#E5E7Eb;

    /* BMI Category Colors */
    --underweight-color:#3B82F6;
    --normal-color:#10B981;
    --overweight-color:#F59E0B;
    --obese-color:#EF4444;

    /* Spacing  */
    --spacing-xs:0.5rem;
    --spacing-sm:1rem;
    --spacing-md:1.5rem;
    --spacing-lg:2rem;
    --spacing-xl:3rem;

    /* Border Radius  */
    --radius-sm:0.375rem;
    --radius-md:0.5rem;
    --radius-lg:0.75rem;
    --radius-xl:1rem;

    /* Shadows  */
    --shadow-sm:0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md:0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg:0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl:0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: var(--spacing-md);
    color: var(--text-primary);
}

.container {
    max-width: 600px;
    margin: 0 auto;
}

header{
    text-align: center;
    margin-bottom: var(--spacing-lg);
    color: #fff;
}

header h1{
    font-size: 2.5rem;
    margin-bottom: var(--spacing-xs);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
.subtitle{
    font-size: 1.1rem;
    opacity: 0.9;
}

.calculator-card{
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-xl);
    margin-bottom: var(--spacing-lg);
}

/* Form Inputs */
.input-group{
    margin-bottom: var(--spacing-md);
}

.input-group label{
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xs);
    font-weight: 600;
    color: var(--text-primary);
}

.label-text{
    font-size: 0.95rem;
}

.label-icon{
    font-size: 1.2rem;
}

.input-group input{
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all 0.3 ease;
    background: var(--bg-color);
}

.input-group input:focus{
    outline: none;
    border-color: var(--primary-color);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59, 136, 246, 0.1);
}

.input-group input.error{
    border-color: var(--danger-color);
}

.error-message{
    display: block;
    color: var(--danger-color);
    font-size: 0.85rem;
    margin-top: var(--spacing-xs);
    min-height: 1.2rem;
}

/* Buttons  */
.button-group{
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.btn{
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary{
    background: linear-gradient(135deg, var(--primary-color), #2563eb);
    color: #fff;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover{
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary{
    background: var(--bg-color);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}
.btn-secondary:hover{
    background: var(--border-color);
}

.results{
    margin-top: var(--spacing-lg);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    text-align: center;
    display: none;
    animation: slideIn 0.4s ease;
}

.results.show{
    display: block;
}

@keyframes slideIn {
    from{
        opacity: 0;
        transform: translateY(-20px);
    }to{
        opacity: 1;
        transform: translateY(0);
    }
}

.results.underweight{
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.05));
    border: 2px solid var(--underweight-color);
}

.results.normal {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 2px solid var(--normal-color);
}

.results.overweight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.05));
    border: 2px solid var(--overweight-color);
}

.results.obese {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.05));
    border: 2px solid var(--obese-color);
}

.results h2{
    font-size: 1.25rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-secondary);
}

.bmi-value{
    font-size: 3.5rem;
    font-weight: 700;
    margin: var(--spacing-sm) 0;
}

.bmi-category{
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
}

.bmi-message{
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* History Section  */
.history{
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 2px solid var(--border-color);
    display: none;
}

.history.show{
    display: block;
}

.history h3{
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.history-list{
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.history-item{
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm);
    background: var(--bg-color);
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.history-item.underweight{
    border-color: var(--underweight-color)
}

.history-item.normal{
    border-color: var(--normal-color);
}

.history-item.overweight{
    border-color: var(--overweight-color);
}

.history-item.obese{
    border-color: var(--obese-color);
}

.history-info{
    flex: 1;
}

.history-bmi{
    font-size: 1.5rem;
    font-weight: 700;
    color:var(--primary-color);
}

.history-details{
    font-size: 0.85rem;
    color: var(--secondary-color);
}

.history-delete{
    background: none;
    border: none;
    color: var(--danger-color);
    font-size: 1.25rem;
    cursor: pointer;
    padding: var(--spacing-xs);
    transition: transform 0.2s;
}

.history-delete:hover{
    transform: scale(1.2);
}

/* BMI GUIDE */

.bmi-guide{
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-xl);
    margin-bottom: var(--spacing-lg);
}

.bmi-guide h3{
    text-align: center;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.guide-grid{
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.guide-item{
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    text-align: center;
    border: 2px solid;
}

.guide-item.underweight{
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--underweight-color);
}

.guide-item.normal{
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--normal-color);
}

.guide-item.overweight{
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--overweight-color);
}

.guide-item.obese{
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--obese-color);
}

.guide-item .range{
    display: block;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: var(--spacing-xs);
    color: var(--text-primary);
}

.guide-item .category{
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Footer  */
footer{
    text-align: center;
    color: #FFFFFF;
    padding: var(--spacing-md);
}

footer a{
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 2px solid #FFFFFF;
}

footer a:hover{
    opacity: 0.8;
}

/* RESPONSIVE DESIGN  */

@media screen and (max-width:640px){
    body{
        padding: var(--spacing-sm);
    }

    header h1{
        font-size: 2rem;
    }

    .subtitle{
        font-size: 1rem;
    }

    .calculator-card{
        padding: var(--spacing-md);
    }

    .button-group{
        grid-template-columns: 1fr;
    }

    .bmi-value{
        font-size: 2.5rem;
    }

    .guide-grid{
        grid-template-columns: 1fr;
    }
}

@media (max-width:480px){
    header h1{
        font-size: 1.75rem;
    }

    .bmi-value{
        font-size: 2rem;
    }

    .bmi-category{
        font-size: 1.25rem;
    }
}
