/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Tab Navigation */
.tabs-nav {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 10px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tab-button {
    background: transparent;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    border-radius: 10px;
    color: white;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    flex: 1;
    justify-content: center;
    text-align: center;
}

.tab-button:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.tab-button.active {
    background: rgba(255, 255, 255, 0.25);
    color: #ffd700;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.tab-button i {
    font-size: 1.1rem;
}

/* Calculator Container */
.calculators-container {
    position: relative;
}

.calculator {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.calculator.active {
    display: block;
}

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

/* Calculator Header */
.calculator-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.calculator-header h2 {
    font-size: 2rem;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.calculator-header h2 i {
    margin-right: 10px;
    color: #667eea;
}

.calculator-header p {
    color: #666;
    font-size: 1.05rem;
}

/* Form Styles */
.calculator-form {
    max-width: 600px;
    margin: 0 auto 30px;
}

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

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 0.95rem;
}

input[type="number"],
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e1e1;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafafa;
}

input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input[type="number"]:invalid {
    border-color: #ff6b6b;
}

select {
    cursor: pointer;
}

/* Calculate Button */
.calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 16px 24px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

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

/* Results Section */
.results {
    max-width: 600px;
    margin: 30px auto 0;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9ff 0%, #f0f4ff 100%);
    border-radius: 15px;
    border: 2px solid #e8eeff;
}

.results h3 {
    text-align: center;
    color: #333;
    margin-bottom: 25px;
    font-size: 1.5rem;
    font-weight: 600;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #e1e8ff;
}

.result-item:last-child {
    border-bottom: none;
}

.result-item.main-result {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0 10px;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.result-item.category {
    font-weight: 600;
}

.result-item .label {
    font-weight: 500;
    color: inherit;
}

.result-item .value {
    font-weight: 600;
    font-size: 1.1rem;
    color: inherit;
}

.main-result .value {
    font-size: 1.3rem;
    font-weight: 700;
}

.formula-note {
    text-align: center;
    margin-top: 15px;
    color: #666;
}

.formula-note i {
    margin-right: 5px;
    color: #667eea;
}

/* BMI Category Colors */
.category.underweight .value {
    color: #3498db;
    font-weight: 600;
}

.category.normal .value {
    color: #27ae60;
    font-weight: 600;
}

.category.overweight .value {
    color: #f39c12;
    font-weight: 600;
}

.category.obese .value {
    color: #e74c3c;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .tabs-nav {
        flex-direction: column;
        gap: 5px;
    }
    
    .tab-button {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .calculator {
        padding: 25px 20px;
    }
    
    .calculator-header h2 {
        font-size: 1.6rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        margin-bottom: 20px;
    }
    
    .results {
        padding: 20px;
    }
    
    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
        text-align: left;
    }
    
    .result-item.main-result {
        text-align: center;
        align-items: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.7rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .tab-button {
        padding: 10px 15px;
        font-size: 0.85rem;
        gap: 5px;
    }
    
    .calculator {
        padding: 20px 15px;
    }
    
    .calculator-header h2 {
        font-size: 1.4rem;
    }
    
    .calculate-btn {
        font-size: 1rem;
        padding: 14px 20px;
    }
}

/* Loading States */
.calculate-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.calculate-btn.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error States */
.error {
    border-color: #e74c3c !important;
    background-color: #ffeaea !important;
}

.error-message {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Success States */
.success {
    border-color: #27ae60 !important;
    background-color: #eafaf1 !important;
}