/**
         * BMI Calculator Frontend Styles
         * Fully responsive with mobile-first approach
         */
        
        /* CSS Variables for Customization */
        .bmi-calculator-widget {
            --primary-color: #212950;           /* Primary button color */
            --secondary-color: #c4a484;         /* Warm Beige */
            --accent-color: #b45309;           /* Copper/Leaves */
            --success-color: #059669;          /* Success Green */
            --warning-color: #d97706;           /* Warning Orange */
            --danger-color: #dc2626;            /* Danger Red */
            --info-color: #1e40af;              /* Info Navy */
            --text-primary: #1f2937;            /* Dark Text */
            --text-secondary: #6b7280;          /* Medium Gray */
            --background: #faf9f6;              /* Creamy White */
            --card-bg: #fefdf8;                 /* Pure Cream */
            --border-color: #e5ddd5;           /* Soft Beige Border */
            --border-radius: 12px;
            --shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.1), 0 2px 4px -1px rgba(30, 64, 175, 0.06);
            --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            line-height: 1.6;
            color: var(--text-primary);
            max-width: 100%;
            margin: 0 auto;
            padding: 16px;
        }

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

        /* Container and Grid Layout */
        .bmi-calculator-container {
            width: 100%;
            margin: 0 auto;
            position: relative;
        }

        .calculator-header {
            text-align: center;
            margin-bottom: 1.5rem;
        }

        .calculator-header h1 {
            font-size: 1.8rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            color: inherit;
        }

        .calculator-header p {
            font-size: 1rem;
            color: var(--text-secondary);
            margin: 0 auto;
        }

        .calculator-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1.25rem;
        }

        /* Card Styles */
        .card {
            background: var(--card-bg);
            border-radius: var(--border-radius);
            box-shadow: var(--shadow);
            padding: 1.25rem;
            transition: var(--transition);
            border: 1px solid var(--border-color);
        }

        .card-header {
            margin-bottom: 1.25rem;
        }

        .card-title {
            font-size: 1.3rem;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
        }

        .card-subtitle {
            color: var(--text-secondary);
            font-size: 0.9rem;
        }

        /* Unit Toggle */
        .unit-toggle {
            display: flex;
            background: var(--background);
            border-radius: 8px;
            padding: 4px;
            margin-bottom: 1.25rem;
            position: relative;
            overflow: hidden;
        }

        .unit-btn {
            flex: 1;
            padding: 0.5rem 1rem;
            background: transparent;
            border: none;
            border-radius: 6px;
            font-weight: 500;
            cursor: pointer;
            transition: var(--transition);
            position: relative;
            z-index: 2;
            font-size: 0.875rem;
        }

        .unit-btn.active {
            background: var(--primary-color);
            color: white;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .unit-btn:not(.active) {
            color: var(--text-secondary);
        }

        .unit-btn:not(.active):hover {
            background: rgba(0, 0, 0, 0.05);
        }

        /* Form Styles */
        .form-group {
            margin-bottom: 1rem;
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        .form-field {
            position: relative;
        }

        .form-label {
            display: block;
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }

        .form-input {
            width: 100%;
            padding: 0.75rem 1rem;
            border: 2px solid var(--border-color);
            border-radius: 8px;
            font-size: 1rem;
            transition: var(--transition);
            background: white;
            color: var(--text-primary);
        }

        .form-input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(33, 41, 80, 0.1);
        }

        .form-input:invalid {
            border-color: var(--danger-color);
        }

        .form-input::placeholder {
            color: var(--text-secondary);
            opacity: 0.7;
        }

        /* Gender Selection */
        .gender-group {
            display: flex;
            gap: 0.75rem;
            margin-top: 0.5rem;
        }

        .radio-option {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
            padding: 0.5rem 0.75rem;
            border-radius: 6px;
            transition: var(--transition);
        }

        .radio-option:hover {
            background: var(--background);
        }

        .radio-input {
            width: 18px;
            height: 18px;
            accent-color: var(--primary-color);
        }

        /* Calculate Button */
        .calculate-btn {
            width: 100%;
            padding: 0.875rem;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: var(--transition);
            position: relative;
            overflow: hidden;
            margin-top: 0.5rem;
        }

        .calculate-btn:hover {
            opacity: 0.9;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(33, 41, 80, 0.2);
        }

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

        /* Results Section */
        .results-grid {
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
        }

        .result-main {
            text-align: center;
            padding: 1.5rem;
            background-color: var(--primary-color);
            color: white;
            border-radius: var(--border-radius);
            position: relative;
            overflow: hidden;
        }

        .bmi-value {
            font-size: 2.5rem;
            font-weight: 700;
            margin: 0.75rem 0;
            position: relative;
            z-index: 1;
        }

        .bmi-category {
            font-size: 1.2rem;
            font-weight: 500;
            opacity: 0.9;
            position: relative;
            z-index: 1;
        }

        .bmi-description {
            font-size: 0.9rem;
            opacity: 0.8;
            margin-top: 0.5rem;
            position: relative;
            z-index: 1;
        }

        /* BMI Progress Indicator */
        .bmi-progress {
            margin: 1.25rem 0;
            position: relative;
            z-index: 1;
        }

        .progress-bar {
            height: 8px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 4px;
            overflow: hidden;
            position: relative;
        }

        .progress-fill {
            height: 100%;
            background: white;
            border-radius: 4px;
            transition: width 1s ease-out;
            position: relative;
        }

        /* BMI Ranges */
        .bmi-ranges {
            display: grid;
            gap: 0.5rem;
        }

        .range-item {
            display: grid;
            grid-template-columns: 1fr auto;
            padding: 0.75rem 1rem;
            border-radius: 8px;
            transition: var(--transition);
            border: 2px solid transparent;
        }

        .range-item.active {
            background: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
            box-shadow: 0 4px 12px rgba(33, 41, 80, 0.3);
        }

        .range-item:not(.active) {
            background: var(--background);
            color: var(--text-primary);
        }

        .range-item:not(.active):hover {
            background: #f3f4f6;
        }

        .range-label {
            font-weight: 500;
        }

        .range-value {
            font-weight: 600;
            opacity: 0.8;
        }

        /* Additional Metrics */
        .metrics-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 1rem;
        }

        .metric-card {
            background: var(--background);
            padding: 1rem;
            border-radius: 8px;
            text-align: center;
            border: 2px solid transparent;
            transition: var(--transition);
        }

        .metric-card:hover {
            border-color: var(--accent-color);
        }

        .metric-value {
            font-size: 1.3rem;
            font-weight: 600;
            color: var(--accent-color);
            margin-bottom: 0.25rem;
        }

        .metric-label {
            font-size: 0.9rem;
            color: var(--text-secondary);
        }

        /* Health Insights */
        .insights-list {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .insight-item {
            display: flex;
            gap: 1rem;
            padding: 1rem;
            background: var(--background);
            border-radius: 8px;
            border-left: 4px solid var(--accent-color);
            transition: var(--transition);
        }

        .insight-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            flex-shrink: 0;
        }

        .insight-icon.success {
            background: #dcfce7;
            color: var(--success-color);
        }

        .insight-icon.warning {
            background: #fef3c7;
            color: var(--warning-color);
        }

        .insight-icon.danger {
            background: #fee2e2;
            color: var(--danger-color);
        }

        .insight-icon.info {
            background: #dbeafe;
            color: var(--info-color);
        }

        .insight-content h4 {
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 0.25rem;
            font-size: 0.95rem;
        }

        .insight-content p {
            color: var(--text-secondary);
            font-size: 0.85rem;
            line-height: 1.5;
            margin: 0;
        }

        /* Loading Animation */
        .loading {
            text-align: center;
            padding: 1rem;
            display: none;
        }

        .spinner {
            width: 36px;
            height: 36px;
            border: 4px solid #f3f3f3;
            border-top: 4px solid var(--primary-color);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin: 0 auto 1rem;
        }

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

        /* Error States */
        .error-message {
            color: var(--danger-color);
            font-size: 0.8rem;
            margin-top: 0.25rem;
            display: none;
        }

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

        .form-field.error .error-message {
            display: block;
        }

        /* Animation Classes */
        .fade-in {
            animation: fadeIn 0.5s ease-out;
        }

        .slide-up {
            animation: slideUp 0.5s ease-out;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

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

        /* Accessibility */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        /* Focus States */
        .unit-btn:focus,
        .calculate-btn:focus,
        .form-input:focus,
        .radio-input:focus {
            outline: 2px solid var(--primary-color);
            outline-offset: 2px;
        }

        /* Tablet and Desktop Styles */
        @media (min-width: 768px) {
            .bmi-calculator-widget {
                padding: 24px;
                max-width: 1200px;
            }
            
            .calculator-header h1 {
                font-size: 2.2rem;
            }
            
            .calculator-header p {
                font-size: 1.1rem;
                max-width: 600px;
            }
            
            .calculator-grid {
                grid-template-columns: 1fr 1fr;
                gap: 2rem;
            }
            
            .card {
                padding: 1.5rem;
            }
            
            .card-title {
                font-size: 1.5rem;
            }
            
            .form-row {
                grid-template-columns: 1fr 1fr;
            }
            
            .bmi-value {
                font-size: 3rem;
            }
            
            .metrics-grid {
                grid-template-columns: 1fr 1fr;
            }
        }

        /* Large Desktop Styles */
        @media (min-width: 1024px) {
            .calculator-grid {
                grid-template-columns: 1fr 1.5fr;
            }
            
            .bmi-value {
                font-size: 3.5rem;
            }
        }

        /* High Contrast Mode Support */
        @media (prefers-contrast: high) {
            .bmi-calculator-widget {
                --border-color: #000000;
                --text-secondary: #000000;
            }
            
            .card {
                border: 2px solid var(--border-color);
            }
        }

        /* Reduced Motion Support */
        @media (prefers-reduced-motion: reduce) {
            .bmi-calculator-widget * {
                animation-duration: 0.01ms !important;
                animation-iteration-count: 1 !important;
                transition-duration: 0.01ms !important;
            }
        }

        /* Dark Mode Support */
        @media (prefers-color-scheme: dark) {
            .bmi-calculator-widget {
                --text-primary: #f9fafb;
                --text-secondary: #d1d5db;
                --background: #374151;
                --card-bg: #1f2937;
                --border-color: #4b5563;
            }
        }

.bmi-calculator-container {
  max-width: 100%;
  width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
  padding: 10px;
}

.calculator-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.card {
  width: 100%;
  box-sizing: border-box;
}

/* Ensure form inputs don’t overflow */
.form-input {
  width: 100%;
  max-width: 100%;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .calculator-grid {
    display: block;
  }
  .form-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
}
