/* =============================================================
   gold-calculator.css
   استایل شورت‌کد [gold_intrinsic_value_calculator]
   هماهنگ با ظاهر افزونه price-api-tabs
   ============================================================= */

/* ---------- کانتینر عمومی ---------- */
.gic-wrap {
    direction: rtl;
    font-family: inherit;
    max-width: 620px;
    margin: 0 auto;
    padding: 0 0 24px;
}

/* ---------- کارت ---------- */
.gic-card {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 4px 28px rgba(0, 0, 0, 0.07);
    border: 1px solid #ececec;
}

/* ---------- هدر کارت ---------- */
.gic-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1.5px solid #f0f0f0;
}

.gic-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #fef2f2;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #E11D33;
}

.gic-card-icon svg {
    width: 28px;
    height: 28px;
}

.gic-card-title {
    font-size: 20px;
    font-weight: 800;
    color: #111827;
    margin: 0 0 4px;
}

.gic-card-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

/* ---------- توضیحات ---------- */
.gic-description {
    background: #f8faff;
    border-right: 4px solid #E11D33;
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.9;
    color: #374151;
}

.gic-description p {
    margin: 0 0 10px;
}

.gic-description p:last-child {
    margin-bottom: 0;
}

/* ---------- متن لحظه‌ای ---------- */
.gic-live-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 14px;
    line-height: 1.5;
    text-align: center;
}


/* ---------- گرید کارت‌های آماری ---------- */
.gic-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.gic-stat-card {
    background: #fef2f2;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border: 1px solid rgba(225, 29, 51, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gic-stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(225, 29, 51, 0.10);
}

/* کارت سورمه‌ای (قیمت طلای ۱۸ عیار و ارزش ذاتی) */
.gic-stat-card.gic-stat-navy {
    background: #0f1e36;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.gic-stat-card.gic-stat-navy:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(15, 30, 54, 0.35);
}

.gic-stat-card.gic-stat-navy .gic-stat-label {
    color: #94a3b8;
}

.gic-stat-card.gic-stat-navy .gic-stat-value {
    color: #ffffff;
}

.gic-stat-card.gic-stat-navy .gic-stat-value small {
    color: #94a3b8;
}

/* برچسب */
.gic-stat-label {
    font-size: 12.5px;
    font-weight: 600;
    color: #6b7280;
    line-height: 1.4;
}

/* مقدار عددی */
.gic-stat-value {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    direction: ltr;
    text-align: right;
    white-space: nowrap;
}

.gic-stat-value small {
    font-size: 11px;
    font-weight: 600;
    color: #9ca3af;
    margin-right: 3px;
}

/* رنگ‌بندی مثبت / منفی */
.gic-positive {
    color: #16a34a !important;
}

.gic-negative {
    color: #dc2626 !important;
}

/* تغییر رنگ علامت ٪ و کلمه تومان همرنگ با مقدار در کارت‌های حباب */
.gic-positive small,
.gic-stat-value.gic-positive small {
    color: inherit !important;
}

.gic-negative small,
.gic-stat-value.gic-negative small {
    color: inherit !important;
}

/* ریسپانسیو */
@media (max-width: 480px) {
    .gic-stat-card {
        padding: 12px 14px;
        border-radius: 12px;
    }

    .gic-stat-label {
        font-size: 13px;
    }

    .gic-stat-value {
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .gic-stat-label {
        font-size: 12px;
    }

    .gic-stat-value {
        font-size: 14px;
    }
}

/* ---------- فیلدهای فرم ---------- */
.gic-field {
    margin-bottom: 20px;
}

.gic-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 8px;
}

.gic-hint {
    font-size: 12px;
    color: #9ca3af;
    margin: 6px 0 0;
    line-height: 1.5;
}

/* --- input --- */
.gic-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.gic-input {
    width: 100%;
    padding: 12px 16px;
    padding-left: 60px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: #111827;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
    direction: ltr;
    text-align: left;
    min-height: 48px; /* touch target مناسب */
}

.gic-input:focus {
    border-color: #E11D33;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(225, 29, 51, 0.1);
}

.gic-input-unit {
    position: absolute;
    left: 14px;
    font-size: 12px;
    font-weight: 700;
    color: #9ca3af;
    pointer-events: none;
    white-space: nowrap;
    user-select: none;
}

/* =====================================================
   custom dropdown (جایگزین select بومی)
   ===================================================== */

.gic-dropdown {
    position: relative;
    direction: rtl;
}

/* --- دکمه trigger --- */
.gic-dropdown-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 16px 0 14px;
    min-height: 50px;
    border: 1.5px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: #111827;
    background: #fafafa;
    cursor: pointer;
    text-align: right;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    box-sizing: border-box;
}

.gic-dropdown-btn:hover {
    background: #f4f4f5;
    border-color: #d1d5db;
}

.gic-dropdown-btn:focus {
    outline: none;
    border-color: #E11D33;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(225, 29, 51, 0.1);
}

/* وقتی باز است */
.gic-dropdown.is-open .gic-dropdown-btn {
    border-color: #E11D33;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(225, 29, 51, 0.1);
    border-radius: 12px 12px 0 0;
    border-bottom-color: transparent;
}

/* متن مقدار انتخابی */
.gic-dropdown-val {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gic-dropdown-val.placeholder {
    color: #9ca3af;
}

/* آیکون فلش */
.gic-dropdown-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: transform 0.22s cubic-bezier(.4,0,.2,1), color 0.2s;
}

.gic-dropdown-arrow svg {
    width: 16px;
    height: 16px;
}

.gic-dropdown.is-open .gic-dropdown-arrow {
    transform: rotate(180deg);
    color: #E11D33;
}

/* --- پنل لیست --- */
.gic-dropdown-list {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    z-index: 999;
    background: #fff;
    border: 1.5px solid #E11D33;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.10);
    overflow: hidden;
    /* انیمیشن ظاهر شدن */
    animation: gic-dropdown-in 0.18s cubic-bezier(.4,0,.2,1);
    max-height: 280px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@keyframes gic-dropdown-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- عنوان گروه --- */
.gic-dropdown-group-label {
    padding: 8px 16px 5px;
    font-size: 11px;
    font-weight: 800;
    color: #9ca3af;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: #fafafa;
    border-bottom: 1px solid #f3f4f6;
    border-top: 1px solid #f3f4f6;
    user-select: none;
}

.gic-dropdown-group-label:first-child {
    border-top: none;
}

/* --- گزینه‌ها --- */
.gic-dropdown-option {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: right;
    transition: background 0.13s;
    border-bottom: 1px solid #f9fafb;
    gap: 10px;
}

.gic-dropdown-option:last-child {
    border-bottom: none;
}

.gic-dropdown-option:hover {
    background: #fef2f2;
    color: #E11D33;
}

.gic-dropdown-option strong {
    font-weight: 700;
    margin-right: 2px;
}

/* گزینه انتخاب‌شده */
.gic-dropdown-option.is-selected {
    background: #fef2f2;
    color: #E11D33;
    font-weight: 600;
}

.gic-dropdown-option.is-selected::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #E11D33;
    flex-shrink: 0;
    margin-left: auto;
}

/* --- حالت موبایل --- */
@media (max-width: 480px) {
    .gic-dropdown-btn {
        font-size: 14px;
        min-height: 50px;
        padding: 0 14px 0 12px;
        border-radius: 10px;
    }

    .gic-dropdown.is-open .gic-dropdown-btn {
        border-radius: 10px 10px 0 0;
    }

    .gic-dropdown-list {
        border-radius: 0 0 10px 10px;
        max-height: 240px;
    }

    .gic-dropdown-option {
        font-size: 14px;
        padding: 13px 14px;
        min-height: 46px;
    }

    .gic-dropdown-group-label {
        font-size: 10px;
        padding: 7px 14px 4px;
    }
}

@media (max-width: 360px) {
    .gic-dropdown-btn {
        font-size: 13px;
    }

    .gic-dropdown-option {
        font-size: 13px;
    }
}

/* ---------- دکمه محاسبه ---------- */
.gic-btn-calc {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #E11D33 0%, #B8172A 100%);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    box-shadow: 0 4px 18px rgba(225, 29, 51, 0.3);
    margin-top: 8px;
}

.gic-btn-calc svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.gic-btn-calc:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(225, 29, 51, 0.4);
}

.gic-btn-calc:active {
    transform: translateY(0) scale(0.98);
}

.gic-btn-calc:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ---------- دکمه Ghost ---------- */
.gic-btn-ghost {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 20px;
    background: #fef2f2;
    color: #E11D33;
    border: 1px solid #fecdd3;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 10px;
}

.gic-btn-ghost:hover {
    background: #fde8eb;
}

.gic-btn-ghost:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ---------- باکس نتیجه ---------- */
.gic-result {
    margin-top: 24px;
    background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
    border: 1.5px solid #fecdd3;
    border-radius: 16px;
    padding: 24px 20px;
    text-align: center;
    animation: gic-fadeIn 0.35s ease;
}

.gic-result-label {
    font-size: 14px;
    color: #9ca3af;
    margin-bottom: 8px;
    font-weight: 500;
}

.gic-result-value {
    font-size: 38px;
    font-weight: 900;
    color: #E11D33;
    letter-spacing: -1px;
    line-height: 1.1;
    direction: ltr;
}

.gic-result-unit {
    font-size: 16px;
    color: #6b7280;
    margin-top: 4px;
    font-weight: 600;
}

.gic-result-detail {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #fecdd3;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.7;
}

.gic-result-detail b {
    color: #111827;
}

/* ---------- خطا ---------- */
.gic-error {
    margin-top: 10px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecdd3;
    border-radius: 10px;
    font-size: 13px;
    color: #E11D33;
    font-weight: 600;
    line-height: 1.6;
}

/* ---------- انیمیشن اسپینر (در صورت نیاز آینده) ---------- */
.gic-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid #f3f4f6;
    border-top-color: #E11D33;
    border-radius: 50%;
    animation: gic-spin 0.7s linear infinite;
}

/* ---------- انیمیشن‌ها ---------- */
@keyframes gic-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes gic-spin {
    to { transform: rotate(360deg); }
}

/* ---------- ریسپانسیو ---------- */

/* تبلت */
@media (max-width: 640px) {
    .gic-wrap {
        padding: 0 0 16px;
    }

    .gic-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .gic-card-header {
        gap: 12px;
        margin-bottom: 22px;
        padding-bottom: 16px;
    }

    .gic-card-icon {
        width: 44px;
        height: 44px;
        border-radius: 12px;
    }

    .gic-card-icon svg {
        width: 22px;
        height: 22px;
    }
}

/* موبایل */
@media (max-width: 480px) {
    .gic-wrap {
        padding: 0 0 12px;
    }

    .gic-description {
        font-size: 13px;
        padding: 14px 16px;
        border-right-width: 3px;
        border-radius: 10px;
    }

    .gic-card {
        padding: 20px 16px;
        border-radius: 14px;
        box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
    }

    .gic-card-header {
        gap: 10px;
        margin-bottom: 20px;
        padding-bottom: 14px;
    }

    .gic-card-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        flex-shrink: 0;
    }

    .gic-card-icon svg {
        width: 20px;
        height: 20px;
    }

    .gic-card-title {
        font-size: 16px;
        line-height: 1.3;
    }

    .gic-card-subtitle {
        font-size: 12px;
    }

    .gic-field {
        margin-bottom: 16px;
    }

    .gic-label {
        font-size: 13px;
        margin-bottom: 6px;
    }

    /* --- دراپ‌داون موبایل --- */
    .gic-select {
        font-size: 14px;
        padding: 13px 14px;
        padding-left: 42px;
        min-height: 50px;
        border-radius: 10px;
    }

    .gic-select-arrow {
        left: 10px;
        width: 22px;
        height: 22px;
    }

    .gic-select-arrow svg {
        width: 14px;
        height: 14px;
    }

    /* --- اینپوت موبایل --- */
    .gic-input {
        font-size: 14px;
        padding: 13px 14px;
        padding-left: 58px;
        min-height: 50px;
        border-radius: 10px;
    }

    .gic-input-unit {
        font-size: 11px;
        left: 12px;
    }

    .gic-hint {
        font-size: 11px;
        margin-top: 5px;
    }

    /* --- دکمه موبایل --- */
    .gic-btn-calc {
        font-size: 15px;
        padding: 14px 16px;
        border-radius: 12px;
        min-height: 52px;
    }

    .gic-btn-calc svg {
        width: 18px;
        height: 18px;
    }

    /* --- نتیجه موبایل --- */
    .gic-result {
        padding: 20px 16px;
        border-radius: 14px;
    }

    .gic-result-value {
        font-size: 28px;
        letter-spacing: -0.5px;
    }

    .gic-result-unit {
        font-size: 14px;
    }

    .gic-result-detail {
        font-size: 12px;
        gap: 5px;
    }

    /* --- OTP --- */
    .gic-otp-input {
        font-size: 18px;
        letter-spacing: 5px;
    }
}

/* موبایل‌های خیلی کوچک */
@media (max-width: 360px) {
    .gic-card {
        padding: 16px 12px;
    }

    .gic-card-title {
        font-size: 15px;
    }

    .gic-select {
        font-size: 13px;
        padding-left: 38px;
    }

    .gic-input {
        font-size: 13px;
    }

    .gic-result-value {
        font-size: 24px;
    }

    .gic-btn-calc {
        font-size: 14px;
    }
}
