/* Arab Flex Calculators v2.0 — Light Theme */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800&display=swap');

.afc { direction: rtl; font-family: 'Cairo', sans-serif; max-width: 640px; margin: 30px auto; background: #fff; border-radius: 20px; box-shadow: 0 4px 24px rgba(0,0,0,.06); overflow: hidden; border: 1px solid #f0f0f0; }

/* Header */
.afc-header { background: linear-gradient(135deg, #fff8f0, #fff); padding: 28px 24px 20px; text-align: center; border-bottom: 1px solid #f0f0f0; }
.afc-icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 12px; color: #fff; }
.afc-brand { font-size: 12px; color: #ff6b00; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 6px; }
.afc-title { font-size: 22px; font-weight: 800; color: #222; margin: 0 0 4px; line-height: 1.4; }
.afc-title span { color: #ff6b00; }
.afc-subtitle { font-size: 14px; color: #888; margin: 0; }

/* Body */
.afc-body { padding: 24px; }

/* Note */
.afc-note { background: #fff8f0; border: 1px solid #ffe0b2; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #e65100; margin-bottom: 20px; text-align: center; }

/* Form Grid */
.afc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.afc-grid.cols-1 { grid-template-columns: 1fr; }
.afc-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* Form Group */
.afc-group { display: flex; flex-direction: column; }
.afc-group label { font-size: 13px; font-weight: 700; color: #555; margin-bottom: 6px; }

/* Inputs */
.afc-input-wrap { position: relative; }
.afc-input-wrap input, .afc select { width: 100%; padding: 12px 14px; border: 2px solid #e8e8e8; border-radius: 10px; font-family: 'Cairo', sans-serif; font-size: 15px; color: #333; background: #fafafa; transition: border-color .2s; box-sizing: border-box; -webkit-appearance: none; }
.afc-input-wrap input:focus, .afc select:focus { border-color: #ff6b00; outline: none; background: #fff; }
.afc-unit { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: #999; font-weight: 600; pointer-events: none; }

/* Select fix for WoodMart */
.afc select { appearance: auto !important; -webkit-appearance: menulist !important; -moz-appearance: menulist !important; background: #fafafa !important; padding-right: 14px !important; height: auto !important; min-height: 46px !important; opacity: 1 !important; position: relative !important; z-index: 1 !important; }
.afc .select2-container { display: none !important; }

/* Tabs */
.afc-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.afc-tab { flex: 1; padding: 10px; border: 2px solid #e8e8e8; border-radius: 10px; background: #fafafa; font-family: 'Cairo', sans-serif; font-size: 14px; font-weight: 700; color: #888; cursor: pointer; text-align: center; transition: all .2s; }
.afc-tab.active { border-color: #ff6b00; background: #fff8f0; color: #ff6b00; }

/* Activity/Goal Cards */
.afc-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; margin-bottom: 16px; }
.afc-opt { border: 2px solid #e8e8e8; border-radius: 12px; padding: 12px 8px; text-align: center; cursor: pointer; transition: all .2s; background: #fafafa; }
.afc-opt.active { border-color: #ff6b00; background: #fff8f0; }
.afc-opt-icon { font-size: 24px; margin-bottom: 4px; }
.afc-opt-title { font-size: 12px; font-weight: 700; color: #333; }
.afc-opt-desc { font-size: 10px; color: #999; }

/* Button */
.afc-btn { display: block; width: 100%; padding: 14px; border: none; border-radius: 12px; background: linear-gradient(135deg, #ff6b00, #e55a00); color: #fff; font-family: 'Cairo', sans-serif; font-size: 16px; font-weight: 700; cursor: pointer; transition: all .2s; margin-top: 8px; }
.afc-btn:hover { background: linear-gradient(135deg, #e55a00, #cc4e00); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(255,107,0,.3); }

/* Error */
.afc-error { display: none; background: #fff0f0; border: 1px solid #fcc; border-radius: 8px; padding: 8px 12px; color: #d32f2f; font-size: 13px; text-align: center; margin-bottom: 12px; }
.afc-error.show { display: block; }

/* Results */
.afc-result { display: none; margin-top: 20px; padding-top: 20px; border-top: 2px solid #f0f0f0; animation: afcFadeIn .4s ease; }
.afc-result.show { display: block; }

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

/* Result Center */
.afc-res-center { text-align: center; margin-bottom: 16px; }
.afc-res-label { font-size: 13px; color: #888; margin-bottom: 4px; }
.afc-res-val { font-size: 48px; font-weight: 800; color: #ff6b00; line-height: 1.1; }
.afc-res-unit { font-size: 14px; color: #666; }

/* Cards Grid */
.afc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.afc-card-sm { background: #fafafa; border: 1px solid #f0f0f0; border-radius: 12px; padding: 14px 10px; text-align: center; }
.afc-card-sm-icon { font-size: 20px; margin-bottom: 4px; }
.afc-card-sm-val { font-size: 22px; font-weight: 800; color: #333; }
.afc-card-sm-label { font-size: 11px; color: #999; }

/* Gauge */
.afc-gauge { height: 14px; border-radius: 99px; position: relative; margin: 12px 0 6px; overflow: visible; }
.afc-gauge-needle { position: absolute; top: -4px; width: 4px; height: 22px; background: #333; border-radius: 4px; transform: translateX(-50%); transition: left .5s ease; }
.afc-gauge-labels { display: flex; justify-content: space-between; font-size: 10px; color: #999; }

/* Tips */
.afc-tip { background: #f0faf4; border: 1px solid #c8e6c9; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #2e7d32; margin-top: 12px; line-height: 1.6; }
.afc-warn { background: #fff8e1; border: 1px solid #ffe082; border-radius: 10px; padding: 12px 14px; font-size: 13px; color: #e65100; margin-top: 12px; line-height: 1.6; }
.afc-ref { background: #f5f5f5; border: 1px solid #e0e0e0; border-radius: 10px; padding: 10px 14px; font-size: 11px; color: #999; margin-top: 12px; }

/* CTA */
.afc-cta { background: linear-gradient(135deg, #fff8f0, #fff3e0); border: 1px solid #ffe0b2; border-radius: 12px; padding: 16px; text-align: center; margin-top: 16px; }
.afc-cta p { font-size: 14px; font-weight: 700; color: #333; margin: 0 0 10px; }
.afc-cta a { display: inline-block; padding: 10px 24px; background: #ff6b00; color: #fff; border-radius: 8px; text-decoration: none; font-weight: 700; font-size: 14px; transition: background .2s; }
.afc-cta a:hover { background: #e55a00; }

/* Watermark */
.afc-watermark { text-align: center; padding: 12px; font-size: 11px; color: #ccc; border-top: 1px solid #f5f5f5; }
.afc-watermark a { color: #ff6b00; text-decoration: none; }

/* Food Table */
.afc-food-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.afc-food-table th { background: #ff6b00; color: #fff; padding: 10px 8px; text-align: center; font-weight: 700; }
.afc-food-table td { padding: 8px; border-bottom: 1px solid #f0f0f0; text-align: center; }
.afc-food-table tr:nth-child(even) { background: #fafafa; }
.afc-food-table .food-name { text-align: right; font-weight: 600; }
.afc-food-table .food-selected { background: #fff8f0 !important; border-right: 3px solid #ff6b00; }

/* Search Input */
.afc-search { width: 100%; padding: 12px 14px; border: 2px solid #e8e8e8; border-radius: 10px; font-family: 'Cairo', sans-serif; font-size: 14px; margin-bottom: 12px; box-sizing: border-box; }
.afc-search:focus { border-color: #ff6b00; outline: none; }

/* Responsive */
@media (max-width: 600px) {
    .afc { margin: 15px 10px; border-radius: 16px; }
    .afc-header { padding: 20px 16px 16px; }
    .afc-title { font-size: 18px; }
    .afc-body { padding: 16px; }
    .afc-grid { grid-template-columns: 1fr; }
    .afc-grid.cols-3 { grid-template-columns: 1fr; }
    .afc-options { grid-template-columns: 1fr 1fr; }
    .afc-res-val { font-size: 36px; }
    .afc-cards { grid-template-columns: 1fr 1fr; }
}
