:root {
    --bfc-primary: #8b5cf6;
    --bfc-primary-light: #a78bfa;
    --bfc-primary-dark: #7c3aed;
    --bfc-bg: #ffffff;
    --bfc-bg-light: #f9fafb;
    --bfc-text: #1f2937;
    --bfc-text-light: #6b7280;
    --bfc-border: #e5e7eb;
    --bfc-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --bfc-blue: #3b82f6;
    --bfc-green: #10b981;
    --bfc-orange: #f59e0b;
    --bfc-red: #ef4444;
    --bfc-gradient: linear-gradient(135deg, #ffffff 0%, #f5f3ff 100%);
}

/* Dark Mode */
.bfc-dark-mode {
    --bfc-bg: #1f2937;
    --bfc-bg-light: #111827;
    --bfc-text: #f9fafb;
    --bfc-text-light: #9ca3af;
    --bfc-border: #374151;
    --bfc-gradient: linear-gradient(135deg, #1f2937 0%, #111827 100%);
}

.bfc-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

.bfc-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* Cards */
.bfc-calculator-card,
.bfc-results-card {
    background: var(--bfc-gradient);
    border-radius: 24px;
    padding: 30px;
    box-shadow: var(--bfc-shadow);
    border: 1px solid var(--bfc-border);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bfc-calculator-card:hover,
.bfc-results-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 25px 30px -12px rgba(139, 92, 246, 0.25);
}

.bfc-calculator-card::before,
.bfc-results-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--bfc-primary), var(--bfc-primary-light));
}

/* Title */
.bfc-title {
    color: var(--bfc-text);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 30px;
    text-align: center;
    letter-spacing: -0.02em;
}

/* Unit Toggle */
.bfc-unit-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    padding: 4px;
    background: var(--bfc-bg-light);
    border-radius: 12px;
    border: 1px solid var(--bfc-border);
}

.bfc-unit-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    color: var(--bfc-text-light);
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.bfc-unit-btn.active {
    background: var(--bfc-primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(139, 92, 246, 0.2);
}

/* Form */
.bfc-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bfc-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bfc-input-group label {
    color: var(--bfc-text);
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bfc-input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--bfc-border);
    border-radius: 12px;
    background: var(--bfc-bg);
    color: var(--bfc-text);
    font-size: 16px;
    transition: all 0.3s ease;
}

.bfc-input-group input:focus {
    outline: none;
    border-color: var(--bfc-primary);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.bfc-input-group input.error {
    border-color: var(--bfc-red);
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.bfc-measurement-group {
    position: relative;
}

.bfc-unit-label {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--bfc-text-light);
    font-size: 14px;
    font-weight: 600;
}

/* Gender Options */
.bfc-gender-options {
    display: flex;
    gap: 20px;
}

.bfc-radio {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--bfc-text);
    font-weight: 500;
    cursor: pointer;
}

.bfc-radio input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--bfc-primary);
}

/* Calculate Button */
.bfc-calculate-btn {
    margin-top: 20px;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--bfc-primary), var(--bfc-primary-dark));
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.bfc-calculate-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.bfc-calculate-btn:hover::before {
    width: 300px;
    height: 300px;
}

.bfc-calculate-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
}

.bfc-calculate-btn.loading span::after {
    content: '...';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* Results Section */
.bfc-results-title {
    color: var(--bfc-text);
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 25px;
    text-align: center;
}

/* Gauge */
.bfc-gauge-container {
    text-align: center;
    margin-bottom: 30px;
}

#bfc-gauge {
    max-width: 200px;
    height: auto;
}

/* Results Grid */
.bfc-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.bfc-result-item {
    background: var(--bfc-bg-light);
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    border: 1px solid var(--bfc-border);
    transition: transform 0.3s ease;
}

.bfc-result-item:hover {
    transform: scale(1.02);
}

.bfc-result-label {
    display: block;
    color: var(--bfc-text-light);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}

.bfc-result-value {
    display: block;
    color: var(--bfc-text);
    font-size: 28px;
    font-weight: 700;
}

/* Progress Bar */
.bfc-progress-container {
    margin: 30px 0;
}

.bfc-progress-bar {
    height: 20px;
    background: var(--bfc-bg-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.bfc-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bfc-blue), var(--bfc-green), var(--bfc-orange), var(--bfc-red));
    transition: width 0.6s ease;
}

.bfc-progress-labels {
    display: flex;
    justify-content: space-between;
    color: var(--bfc-text-light);
    font-size: 12px;
    font-weight: 600;
}

/* Health Message */
.bfc-health-message {
    background: var(--bfc-bg-light);
    padding: 20px;
    border-radius: 16px;
    margin: 20px 0;
    color: var(--bfc-text);
    font-size: 16px;
    line-height: 1.6;
    border-left: 4px solid var(--bfc-primary);
}

/* Tips Section */
.bfc-tips-section {
    margin: 25px 0;
}

.bfc-tips-section h4 {
    color: var(--bfc-text);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 15px;
}

.bfc-tips-list {
    list-style: none;
    padding: 0;
}

.bfc-tips-list li {
    color: var(--bfc-text);
    padding: 12px 0 12px 30px;
    position: relative;
    border-bottom: 1px solid var(--bfc-border);
}

.bfc-tips-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--bfc-green);
    font-weight: 700;
}

/* Range Reference */
.bfc-range-reference {
    background: var(--bfc-bg-light);
    padding: 15px;
    border-radius: 12px;
    margin: 20px 0;
    color: var(--bfc-text);
    font-size: 14px;
    line-height: 1.6;
}

/* Action Buttons */
.bfc-action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.bfc-share-btn,
.bfc-copy-btn,
.bfc-print-btn {
    flex: 1;
    min-width: 100px;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.bfc-share-btn {
    background: var(--bfc-bg-light);
    color: var(--bfc-text);
    border: 1px solid var(--bfc-border);
}

.bfc-share-btn:hover {
    background: var(--bfc-primary);
    color: white;
    transform: translateY(-2px);
}

.bfc-copy-btn,
.bfc-print-btn {
    background: var(--bfc-primary);
    color: white;
}

.bfc-copy-btn:hover,
.bfc-print-btn:hover {
    background: var(--bfc-primary-dark);
    transform: translateY(-2px);
}

/* Dark Mode Toggle */
.bfc-dark-mode-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bfc-bg-light);
    border: 1px solid var(--bfc-border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bfc-dark-mode-toggle:hover {
    transform: rotate(180deg);
    background: var(--bfc-primary);
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bfc-container {
        grid-template-columns: 1fr;
    }
    
    .bfc-results-grid {
        grid-template-columns: 1fr;
    }
    
    .bfc-action-buttons {
        flex-direction: column;
    }
    
    .bfc-share-btn,
    .bfc-copy-btn,
    .bfc-print-btn {
        width: 100%;
    }
}

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

.bfc-results-card {
    animation: fadeIn 0.6s ease;
}