/* =====================================================
   Fitness Calculator – RTL Persian Style
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700;900&display=swap');

/* ---------- Variables ---------- */
:root {
    --fc-bg:        #0f1117;
    --fc-surface:   #1a1d27;
    --fc-surface2:  #22263a;
    --fc-border:    #2e334d;
    --fc-accent:    #5b7fff;
    --fc-accent2:   #7c5cfc;
    --fc-green:     #3ecf8e;
    --fc-orange:    #ff9f43;
    --fc-red:       #ff6b6b;
    --fc-blue:      #4fc3f7;
    --fc-text:      #e8eaf6;
    --fc-muted:     #8892b0;
    --fc-radius:    16px;
    --fc-shadow:    0 8px 32px rgba(0,0,0,.45);
}

/* ---------- Card ---------- */
.fc-card {
    direction: rtl;
    font-family: 'Vazirmatn', sans-serif;
    background: var(--fc-surface);
    border: 1px solid var(--fc-border);
    border-radius: var(--fc-radius);
    box-shadow: var(--fc-shadow);
    padding: 28px 28px 24px;
    margin: 24px auto;
    max-width: 540px;
    color: var(--fc-text);
    position: relative;
    overflow: hidden;
}

.fc-card::before {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 220px; height: 220px;
    background: radial-gradient(circle at top right, rgba(91,127,255,.18) 0%, transparent 70%);
    pointer-events: none;
}

/* ---------- Header ---------- */
.fc-card__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--fc-border);
}

.fc-icon {
    font-size: 2rem;
    line-height: 1;
}

.fc-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--fc-accent), var(--fc-accent2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Fields ---------- */
.fc-field {
    margin-bottom: 18px;
}

.fc-field label {
    display: block;
    font-size: .85rem;
    font-weight: 500;
    color: var(--fc-muted);
    margin-bottom: 8px;
}

.fc-field input[type="number"],
.fc-field select {
    width: 100%;
    background: var(--fc-surface2);
    border: 1px solid var(--fc-border);
    border-radius: 10px;
    color: var(--fc-text);
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    padding: 12px 14px;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
    direction: rtl;
}

.fc-field input[type="number"]:focus,
.fc-field select:focus {
    border-color: var(--fc-accent);
}

.fc-field input[type="number"]::placeholder {
    color: var(--fc-border);
}

/* ---------- Radio ---------- */
.fc-radio-group {
    display: flex;
    gap: 20px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.fc-radio-group label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--fc-text);
    font-size: .95rem;
    cursor: pointer;
    margin-bottom: 0;
}

.fc-radio-group input[type="radio"] {
    accent-color: var(--fc-accent);
    width: 17px; height: 17px;
}

/* ---------- Slider ---------- */
.fc-slider-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
}

.fc-slider-wrap input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    height: 6px;
    border-radius: 3px;
    background: var(--fc-border);
    direction: ltr;
}

.fc-slider-wrap input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: var(--fc-accent);
    cursor: pointer;
    box-shadow: 0 0 8px rgba(91,127,255,.5);
}

.fc-slider-val {
    font-weight: 700;
    color: var(--fc-accent);
    min-width: 42px;
    text-align: center;
}

/* ---------- Button ---------- */
.fc-btn {
    width: 100%;
    padding: 13px;
    margin-top: 6px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--fc-accent), var(--fc-accent2));
    color: #fff;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: .3px;
    transition: opacity .2s, transform .15s;
    box-shadow: 0 4px 20px rgba(91,127,255,.35);
}

.fc-btn:hover  { opacity: .9; transform: translateY(-1px); }
.fc-btn:active { transform: translateY(0); }

/* ---------- Result box ---------- */
.fc-result {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--fc-border);
    animation: fc-fadein .35s ease;
}

@keyframes fc-fadein {
    from { opacity:0; transform: translateY(8px); }
    to   { opacity:1; transform: translateY(0); }
}

.fc-result__value {
    font-size: 2.6rem;
    font-weight: 900;
    color: var(--fc-accent);
    text-align: center;
    line-height: 1.1;
    margin-bottom: 4px;
}

.fc-result__value--accent { color: var(--fc-green); }

.fc-result__label {
    text-align: center;
    font-size: .95rem;
    color: var(--fc-muted);
    margin-bottom: 16px;
}

/* ---------- BMI Gauge ---------- */
.fc-gauge-wrap { margin: 16px 0; }

.fc-gauge {
    position: relative;
    height: 14px;
    border-radius: 7px;
    background: linear-gradient(to left, #ef5350, #ffa726, #66bb6a, #4fc3f7);
    overflow: visible;
    margin-bottom: 8px;
}

.fc-gauge__pointer {
    position: absolute;
    top: -5px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--fc-accent);
    transform: translateX(50%);
    transition: right .5s cubic-bezier(.4,0,.2,1);
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.fc-gauge__legend {
    display: flex;
    justify-content: space-between;
    font-size: .75rem;
    font-weight: 600;
}

/* ---------- Table ---------- */
.fc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .84rem;
    margin-top: 14px;
    direction: rtl;
}

.fc-table th,
.fc-table td {
    padding: 9px 12px;
    border: 1px solid var(--fc-border);
    text-align: right;
}

.fc-table th {
    background: var(--fc-surface2);
    font-weight: 700;
    color: var(--fc-accent);
}

.fc-table tr:hover td { background: rgba(91,127,255,.06); }

/* ---------- Macro grid ---------- */
.fc-macro-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-top: 8px;
}

.fc-macro-box {
    background: var(--fc-surface2);
    border: 1px solid var(--fc-border);
    border-radius: 12px;
    padding: 18px 10px;
    text-align: center;
    transition: transform .2s;
}

.fc-macro-box:hover { transform: translateY(-3px); }

.fc-macro-box__icon   { font-size: 1.6rem; margin-bottom: 6px; }
.fc-macro-box__label  { font-size: .8rem; color: var(--fc-muted); margin-bottom: 8px; font-weight: 600; }
.fc-macro-box__value  { font-size: 1.5rem; font-weight: 900; margin-bottom: 4px; }
.fc-macro-box__unit   { font-size: .72rem; color: var(--fc-muted); }

.fc-macro-box--protein .fc-macro-box__value { color: #ff9f43; }
.fc-macro-box--fat     .fc-macro-box__value { color: #3ecf8e; }
.fc-macro-box--carb    .fc-macro-box__value { color: #5b7fff; }

/* ---------- WHR label colors ---------- */
.fc-whr-low    { color: var(--fc-green);  font-weight: 700; }
.fc-whr-medium { color: var(--fc-orange); font-weight: 700; }
.fc-whr-high   { color: var(--fc-red);    font-weight: 700; }

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
    .fc-card { padding: 20px 16px 18px; }
    .fc-macro-grid { grid-template-columns: 1fr; }
    .fc-result__value { font-size: 2rem; }
}
