/* =========================================================
   حاسبة سعر الذهب — calculator.css
   اتجاه: RTL (عربي) | اللون الرئيسي: #C8972B (ذهبي)
   ========================================================= */

/* ── Wrapper ── */
.ogc-wrap {
    background: #ffffff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 28px 24px 20px;
    max-width: 480px;
    margin: 0 auto 2rem;
    font-family: 'Segoe UI', Tahoma, 'Arial', sans-serif;
    box-sizing: border-box;
    direction: rtl;
    text-align: right;
}

/* ── Title ── */
.ogc-title {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 14px;
    letter-spacing: 0;
}

.ogc-divider {
    height: 1px;
    background: #e5e5e5;
    margin-bottom: 22px;
}

/* ── Tab switcher ── */
.ogc-tabs {
    display: flex;
    flex-direction: row-reverse;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 22px;
}

.ogc-tab {
    flex: 1;
    padding: 11px 8px;
    font-size: 14px;
    font-weight: 600;
    background: #f9f9f9;
    color: #666666;
    border: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    line-height: 1.4;
    font-family: inherit;
}

.ogc-tab:first-child {
    border-left: 1px solid #e0e0e0;
}

.ogc-tab.active {
    background: #C8972B;
    color: #ffffff;
    font-weight: 700;
}

.ogc-tab:hover:not(.active) {
    background: #f0f0f0;
    color: #333;
}

/* ── Field wrapper ── */
.ogc-field {
    margin-bottom: 20px;
}

/* ── Labels ── */
.ogc-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

/* ── Karat pills ── */
.ogc-karat-pills {
    display: flex;
    flex-direction: row-reverse;
    gap: 8px;
    flex-wrap: wrap;
}

.ogc-karat {
    padding: 8px 20px;
    border-radius: 999px;
    border: 1px solid #d5d5d5;
    font-size: 14px;
    font-weight: 600;
    background: #ffffff;
    color: #555555;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.ogc-karat.active {
    background: #C8972B;
    color: #ffffff;
    border-color: #C8972B;
}

.ogc-karat:hover:not(.active) {
    border-color: #C8972B;
    color: #C8972B;
}

/* ── Number input ── */
.ogc-input-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    border: 1px solid #d5d5d5;
    border-radius: 8px;
    background: #ffffff;
    overflow: hidden;
    transition: border-color 0.15s;
}

.ogc-input-row:focus-within {
    border-color: #C8972B;
    box-shadow: 0 0 0 3px rgba(200, 151, 43, 0.12);
}

.ogc-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 14px;
    font-size: 16px;
    color: #1a1a1a;
    background: transparent;
    direction: ltr;
    text-align: right;
    -moz-appearance: textfield;
    font-family: inherit;
}

.ogc-input::-webkit-outer-spin-button,
.ogc-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ogc-input::placeholder {
    color: #bbbbbb;
    text-align: right;
}

.ogc-input-unit {
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: #888888;
    border-right: 1px solid #eeeeee;
    white-space: nowrap;
    order: -1;
}

/* ── Calculate button ── */
.ogc-btn {
    width: 100%;
    padding: 13px;
    background: #C8972B;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 20px;
    transition: background 0.15s, transform 0.1s;
    letter-spacing: 0.02em;
    font-family: inherit;
}

.ogc-btn:hover  { background: #b5851f; }
.ogc-btn:active { transform: scale(0.99); background: #a3761b; }

/* ── Result box ── */
.ogc-result {
    background: #FDF3DC;
    border: 1px solid #e8d49a;
    border-radius: 10px;
    padding: 18px 16px;
    margin-bottom: 18px;
    animation: ogc-fadein 0.2s ease;
}

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

.ogc-result-label {
    font-size: 13px;
    font-weight: 700;
    color: #8B6914;
    letter-spacing: 0;
    margin-bottom: 6px;
    direction: rtl;
    text-align: right;
}

.ogc-result-value {
    font-size: 28px;
    font-weight: 700;
    color: #6B4E0E;
    line-height: 1.2;
    word-break: break-word;
    direction: rtl;
    text-align: right;
}

.ogc-result-sub {
    font-size: 12px;
    color: #9B7A20;
    margin-top: 6px;
    direction: rtl;
}

/* ── Footer / live rate ── */
.ogc-footer {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #aaaaaa;
    margin-top: 4px;
}

.ogc-live-dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4caf50;
    flex-shrink: 0;
}

.ogc-live-dot.ogc-offline { background: #e57373; }

/* ── Error state ── */
.ogc-input-row.ogc-error {
    border-color: #e53935;
    box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.1);
}

/* ── Loading state on button ── */
.ogc-btn.ogc-loading {
    opacity: 0.75;
    cursor: not-allowed;
}

/* =========================================================
   Mobile responsive
   ========================================================= */
@media (max-width: 520px) {
    .ogc-wrap {
        padding: 20px 14px 16px;
        border-radius: 10px;
        margin: 0 0 1.5rem;
    }
    .ogc-title        { font-size: 19px; }
    .ogc-tab          { font-size: 13px; padding: 10px 4px; }
    .ogc-karat        { padding: 7px 14px; font-size: 13px; }
    .ogc-result-value { font-size: 22px; }
    .ogc-btn          { font-size: 15px; padding: 12px; }
    .ogc-input        { font-size: 15px; }
}

@media (max-width: 360px) {
    .ogc-karat       { padding: 6px 11px; font-size: 12px; }
    .ogc-karat-pills { gap: 6px; }
}
