/* =====================================================
   Resin Art Calculator v2 — Frontend Styles
   ===================================================== */

.rac-calculator {
    max-width: 680px; margin: 0 auto;
    font-family: inherit; direction: rtl;
}

/* Notice */
.rac-notice {
    background: #fff3cd; border: 1px solid #ffc107;
    padding: 12px 16px; border-radius: 8px; color: #856404; margin-bottom: 16px;
}

/* ── Fields ── */
.rac-field { margin-bottom: 16px; }
.rac-field label { display: block; font-weight: 700; margin-bottom: 6px; color: #1e293b; font-size: 14px; }
.rac-field select {
    width: 100%; max-width: 340px; padding: 10px 14px;
    border: 1px solid #cbd5e1; border-radius: 8px; font-size: 15px;
    box-sizing: border-box; outline: none; transition: border-color .2s, box-shadow .2s;
}
.rac-field select:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15); }

/* ── Input with unit suffix ── */
.rac-input-unit-wrap {
    display: flex; align-items: center; gap: 0;
    max-width: 200px; border: 1px solid #cbd5e1; border-radius: 8px;
    overflow: hidden; transition: border-color .2s, box-shadow .2s;
}
.rac-input-unit-wrap:focus-within {
    border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.rac-input-unit-wrap input[type="number"] {
    border: none; outline: none; padding: 10px 12px;
    font-size: 15px; flex: 1; width: 100%; background: transparent;
}
.rac-unit-tag {
    background: #f1f5f9; padding: 10px 12px;
    font-size: 13px; font-weight: 700; color: #64748b;
    border-right: 1px solid #e2e8f0; white-space: nowrap;
}

/* ── Radio groups ── */
.rac-radio-group { display: flex; gap: 14px; flex-wrap: wrap; }
.rac-radio-group label {
    display: flex; align-items: center; gap: 7px;
    font-weight: 400; font-size: 14px; cursor: pointer;
    padding: 8px 14px; border: 1px solid #e2e8f0; border-radius: 8px;
    transition: all .15s;
}
.rac-radio-group label:has(input:checked) {
    border-color: #3b82f6; background: #eff6ff; color: #1d4ed8; font-weight: 700;
}

/* ── Dims group ── */
.rac-dims-group {
    background: #f8fafc; border: 1px solid #e2e8f0;
    border-radius: 10px; padding: 16px; margin-bottom: 16px;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 12px;
}
.rac-dims-group .rac-field { margin-bottom: 0; }

/* ── Advanced ── */
.rac-toggle-label {
    display: flex !important; align-items: center;
    gap: 8px; cursor: pointer; font-weight: 600 !important; font-size: 14px;
}
#rac-advanced-fields {
    background: #eff6ff; border: 1px solid #bfdbfe;
    border-radius: 10px; padding: 16px; margin-bottom: 16px;
}

/* ── Error ── */
.rac-error {
    background: #fef2f2; border: 1px solid #fca5a5; color: #b91c1c;
    padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 14px;
}

/* ── Results ── */
.rac-results { margin-top: 24px; }
.rac-results h3 {
    font-size: 16px; font-weight: 800; margin-bottom: 14px;
    color: #0f172a; border-bottom: 2px solid #3b82f6; padding-bottom: 8px;
}
.rac-results-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px;
    margin-bottom: 16px;
}
.rac-result-box {
    background: #fff; border: 1px solid #e2e8f0; border-radius: 12px;
    padding: 14px 12px; text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    display: flex; flex-direction: column; gap: 5px;
    transition: transform .15s, box-shadow .15s;
}
.rac-result-box:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.rac-result-label  { font-size: 11px; color: #94a3b8; text-transform: uppercase; letter-spacing: .05em; }
.rac-result-value  { font-size: 22px; font-weight: 900; color: #0f172a; }
.rac-result-sub    { font-size: 12px; color: #94a3b8; }
.rac-result-resin .rac-result-value    { color: #1d4ed8; }
.rac-result-hardener .rac-result-value { color: #15803d; }

/* ── Ratio Bar (visual) ── */
#rac-ratio-section { margin-bottom: 16px; }
#rac-ratio-section h4 {
    font-size: 13px; font-weight: 700; color: #64748b;
    margin: 0 0 8px; text-transform: uppercase; letter-spacing: .04em;
}
.rac-visual-ratio-bar {
    display: flex; height: 36px; border-radius: 10px;
    overflow: hidden; border: 1px solid #e2e8f0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,.06);
}
.rac-vbar-resin {
    background: linear-gradient(90deg, #3b82f6, #1d4ed8);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; color: #fff;
    transition: width .5s cubic-bezier(.4,0,.2,1);
    min-width: 40px;
}
.rac-vbar-hardener {
    background: linear-gradient(90deg, #10b981, #059669);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 800; color: #fff;
    transition: width .5s cubic-bezier(.4,0,.2,1);
    min-width: 24px;
}

/* ── Woo Box ── */
.rac-woo-box {
    margin-top: 20px; background: #fff; border: 1px solid #d1d5db;
    border-radius: 12px; padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.rac-woo-box h3 { font-size: 15px; font-weight: 800; margin: 0 0 14px; color: #374151; }

/* ── Responsive ── */
@media(max-width:480px) {
    .rac-results-grid { grid-template-columns: 1fr 1fr; }
    .rac-input-unit-wrap { max-width: 100%; }
    .rac-dims-group { grid-template-columns: 1fr; }
}
