.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.calculator-container {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 40px;
    margin-bottom: 40px;
}

.main-heading {
    text-align: center;
    margin-bottom: 40px;
}

.main-heading h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 10px;
}

.main-heading p {
    font-size: 1.1rem;
    color: #7f8c8d;
    max-width: 600px;
    margin: 0 auto;
}

.unit-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    gap: 0;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.unit-btn {
    padding: 10px 30px;
    border: none;
    background: transparent;
    color: #7f8c8d;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.unit-btn.active {
    background: #ffffff;
    color: #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calculator-inputs {
    max-width: 500px;
    margin: 0 auto;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.input-field {
    display: flex;
    flex-direction: column;
}

.input-field label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: border-color 0.3s ease;
}

.input-wrapper input:focus {
    outline: none;
    border-color: #3498db;
}

.unit-label {
    position: absolute;
    right: 16px;
    color: #7f8c8d;
    font-weight: 500;
}

.height-imperial {
    display: flex;
    gap: 10px;
}

.height-imperial .input-wrapper {
    flex: 1;
}

.hidden {
    display: none !important;
}

.calculate-button, .clear-button {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.calculate-button {
    background: #3498db;
    color: white;
}

.calculate-button:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

.clear-button {
    background: #f8f9fa;
    color: #7f8c8d;
}

.clear-button:hover {
    background: #e9ecef;
}

.results-section {
    margin-top: 40px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bmi-result {
    text-align: center;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 30px;
}

.bmi-result h2 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 15px;
}

.bmi-value {
    font-size: 4rem;
    font-weight: 700;
    color: #3498db;
    margin-bottom: 10px;
}

.bmi-category {
    font-size: 1.5rem;
    font-weight: 600;
    padding: 8px 20px;
    border-radius: 20px;
    display: inline-block;
}

.underweight {
    background: #e3f2fd;
    color: #1976d2;
}

.normal {
    background: #e8f5e9;
    color: #388e3c;
}

.overweight {
    background: #fff3e0;
    color: #f57c00;
}

.obese {
    background: #ffebee;
    color: #d32f2f;
}

.bmi-scale {
    position: relative;
    margin: 40px 0;
    padding: 20px 0;
}

.scale-bar {
    display: flex;
    height: 30px;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.scale-segment {
    flex: 1;
}

.scale-segment.underweight {
    background: #64b5f6;
}

.scale-segment.normal {
    background: #81c784;
}

.scale-segment.overweight {
    background: #ffb74d;
}

.scale-segment.obese {
    background: #e57373;
}

.scale-pointer {
    position: absolute;
    top: 15px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 20px solid #2c3e50;
    transform: translateX(-50%);
    transition: left 0.5s ease;
}

.scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.scale-labels span {
    text-align: center;
    flex: 1;
}


.bmi-interpretation {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.bmi-interpretation h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.bmi-interpretation p {
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 20px;
}

.health-tips {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.health-tips h4 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.health-tips ul {
    list-style: none;
    padding: 0;
}

.health-tips li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
}

.health-tips li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}


.bmi-chart-reference {
    margin-bottom: 30px;
}

.bmi-chart-reference h3 {
    color: #2c3e50;
    margin-bottom: 20px;
}

.bmi-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.bmi-table th {
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
}

.bmi-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.bmi-table tr:last-child td {
    border-bottom: none;
}

.underweight-row td:first-child {
    border-left: 4px solid #64b5f6;
}

.normal-row td:first-child {
    border-left: 4px solid #81c784;
}

.overweight-row td:first-child {
    border-left: 4px solid #ffb74d;
}

.obese-row td:first-child {
    border-left: 4px solid #e57373;
}


.additional-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.info-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
}

.info-card h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.info-card p {
    font-size: 1.8rem;
    font-weight: 600;
    color: #3498db;
    margin: 0;
}

.info-card small {
    color: #7f8c8d;
    font-size: 0.9rem;
}


.disclaimer {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.disclaimer h3 {
    color: #856404;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.disclaimer p {
    color: #856404;
    line-height: 1.6;
    margin: 0;
}


.blog-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

.blog-content {
    max-width: 800px;
    margin: 0 auto;
}

.blog-content h2 {
    font-family: 'Poppins', sans-serif;
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 20px;
}

.blog-content h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    color: #2c3e50;
    margin-top: 30px;
    margin-bottom: 15px;
}

.blog-content p {
    color: #5a6c7d;
    line-height: 1.8;
    margin-bottom: 20px;
}

.blog-content ul, .blog-content ol {
    color: #5a6c7d;
    line-height: 1.8;
    margin-bottom: 20px;
    padding-left: 30px;
}

.blog-content li {
    margin-bottom: 10px;
}

.blog-content strong {
    color: #2c3e50;
}


@media (max-width: 768px) {
    .calculator-container {
        padding: 20px;
    }

    .main-heading h1 {
        font-size: 2rem;
    }

    .main-heading p {
        font-size: 1rem;
    }

    .unit-btn {
        padding: 8px 20px;
        font-size: 0.9rem;
    }

    .bmi-value {
        font-size: 3rem;
    }

    .bmi-category {
        font-size: 1.2rem;
    }

    .scale-labels {
        font-size: 0.8rem;
    }

    .scale-labels span {
        font-size: 0.75rem;
    }

    .bmi-table {
        font-size: 0.9rem;
    }

    .bmi-table th, .bmi-table td {
        padding: 10px;
    }

    .additional-info {
        grid-template-columns: 1fr;
    }

    .blog-section {
        padding: 20px;
    }

    .blog-content h2 {
        font-size: 1.5rem;
    }

    .blog-content h3 {
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .main-heading h1 {
        font-size: 1.75rem;
    }

    .height-imperial {
        flex-direction: column;
    }

    .scale-labels span {
        font-size: 0.7rem;
    }
}


.input-wrapper.error input {
    border-color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 0.9rem;
    margin-top: 5px;
}


.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


@media print {
    .universal-header,
    .unit-toggle,
    .calculate-button,
    .clear-button,
    .blog-section,
    .site-footer {
        display: none;
    }

    .calculator-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .results-section {
        page-break-inside: avoid;
    }
}