/* =========================
   فونت
========================= */

@font-face {
    font-family: "IRANSans";
    src: url("./fonts/IRANSans(FaNum)_Regular.ttf") format("truetype");
    font-weight: 400;
}

@font-face {
    font-family: "IRANSans";
    src: url("./fonts/IRANSans(FaNum)_Medium.ttf") format("truetype");
    font-weight: 500;
}

@font-face {
    font-family: "IRANSans";
    src: url("./fonts/IRANSans(FaNum)_Bold.ttf") format("truetype");
    font-weight: 700;
}

@font-face {
    font-family: "IRANSans";
    src: url("./fonts/IRANSans(FaNum)_Black.ttf") format("truetype");
    font-weight: 900;
}

@font-face {
    font-family: "IRANSans";
    src: url("./fonts/IRANSans(FaNum)_Light.ttf") format("truetype");
    font-weight: 300;
}


/* =========================
   تنظیمات کلی
========================= */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "IRANSans", Tahoma, Arial, sans-serif;
    background: #f5f6f8;
    color: #222;
}


/* =========================
   کانتینر اصلی
========================= */

.container {
    width: min(1100px, calc(100% - 40px));
    margin: 50px auto;
}


/* =========================
   هدر
========================= */

.page-header {
    background: #ffffff;
    border-radius: 16px;
    padding: 35px 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.page-header h1 {
    margin: 0 0 10px;
    font-size: 30px;
    font-weight: 900;
}

.page-header p {
    margin: 0;
    color: #777;
    font-size: 15px;
}


/* =========================
   باکس قیمت‌ها
========================= */

.price-control-card {
    margin-top: 25px;
    padding: 25px;

    background: #ffffff;

    border-radius: 16px;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.05);
}


/* سه ستون */

.price-control-grid {
    display: grid;

    grid-template-columns:
        1fr
        1fr
        1fr;

    gap: 20px;

    align-items: start;
}


/* باکس قیمت */

.price-box {
    display: grid;

    grid-template-rows: 26px 56px;

    gap: 10px;

    width: 100%;

    text-align: center;
}

.price-box label {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;

    margin: 0;

    font-size: 15px;

    font-weight: 700;

    text-align: center;
}

.price-box .input-wrapper {
    width: 100%;
    max-width: 100%;
}

.price-box .input-wrapper input {
    text-align: center;
}

/* باکس دکمه */

.refresh-box {
    display: grid;

    grid-template-rows:
        26px
        56px;

    gap: 10px;

    width: 100%;

    text-align: center;
}

/* توضیح ورود دستی */

.manual-input-note {
    margin-top: 18px;

    padding-top: 15px;

    border-top: 1px solid #eeeeee;

    text-align: center;

    color: #777;

    font-size: 14px;

    line-height: 2;
}


.input-wrapper {
    display: flex;

    align-items: center;

    width: 100%;
    min-height: 56px;

    border: 1px solid #ddd;

    border-radius: 10px;

    overflow: hidden;

    background: #fafafa;
}


.input-wrapper input {
    width: 100%;

    height: 56px;

    border: none;

    outline: none;

    background: transparent;

    padding: 14px 12px;

    font-family: inherit;

    font-size: 17px;

    font-weight: 500;

    direction: ltr;

    text-align: center;
}


.input-wrapper span {
    padding: 0 15px;
    color: #777;
    font-size: 14px;
    white-space: nowrap;
}


/* =========================
   دکمه
========================= */

.calculate-button {
    display: block;
    width: 100%;
    margin-top: 25px;
    padding: 15px 20px;

    border: none;
    border-radius: 12px;

    background: #222;
    color: white;

    font-family: inherit;
    font-size: 16px;
    font-weight: 700;

    cursor: pointer;

    transition: 0.2s;
}


.calculate-button:hover {
    opacity: 0.9;
}


/* =========================
   نتیجه
========================= */

.result-section {
    margin-top: 25px;
}


/* =========================
   موبایل
========================= */

@media (max-width: 700px) {

    .container {
        width: min(100% - 20px, 1100px);
        margin: 20px auto;
    }

    .input-section {
        grid-template-columns: 1fr;
    }

    .page-header {
        padding: 25px 20px;
    }

    .page-header h1 {
        font-size: 24px;
    }

}

/* =========================
   سناریوهای دلار
========================= */

.scenarios-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}
.scenarios-card + .scenarios-card {
    margin-top: 20px;
}

.scenarios-card h2 {
    margin: 0 0 20px;
    font-size: 20px;
    font-weight: 700;
}

.scenarios-list {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.scenario-item {
    padding: 14px;
    border-radius: 10px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
}

.scenario-down {
    background: #fff1f1;
    color: #c0392b;
}

.scenario-up {
    background: #eefaf2;
    color: #218c52;
}

@media (max-width: 700px) {

    .scenarios-list {
        grid-template-columns: repeat(2, 1fr);
    }

}

/* =========================
   جدول تحلیل حساسیت
========================= */

.table-card {
    position: relative;
    overflow: hidden;

    background: #ffffff;

    border-radius: 16px;
    padding: 25px;

    box-shadow:
        0 4px 20px rgba(0, 0, 0, 0.05);
}



.table-header {
    text-align: center;
}

.table-header h2 {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 900;
}

.table-header p {
    margin: 0;
    color: #777;
    font-size: 14px;
}

/* اطلاعات بالای جدول */

.table-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 25px 0;
}


.info-item {
    background: #f7f8fa;
    border-radius: 10px;
    padding: 15px;
    text-align: center;
}


.info-item span {
    display: block;
    color: #777;
    font-size: 13px;
    margin-bottom: 6px;
}


.info-item strong {
    display: block;
    font-size: 17px;
    font-weight: 700;
}


/* اسکرول جدول */

.table-wrapper {
    width: 100%;
    overflow-x: auto;
}


/* خود جدول */

#sensitivity-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 4px;

    /* جدول از چپ به راست چیده شود */
    direction: ltr;
}


/* سلول‌های جدول */

#sensitivity-table th,
#sensitivity-table td {
    padding: 14px 10px;
    text-align: center;
    border-radius: 8px;
    white-space: nowrap;

    /* متن فارسی همچنان راست‌به‌چپ باشد */
    direction: rtl;
}


/* هدر دلار */

#sensitivity-table thead th {
    background: #222;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}


/* ستون انس */

#sensitivity-table tbody th {
    background: #222;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}


/* خانه‌های قیمت */

#sensitivity-table tbody td {
    font-size: 13px;
    font-weight: 500;
    transition: 0.2s;
}

/* گوشه بالا سمت راست */

#sensitivity-table thead th:first-child {
    background: #111;
}


/* یادداشت زیر جدول */

.table-note {
    margin-top: 20px;
    padding: 18px 20px;
    border-radius: 10px;
    background: #fff8e6;
    color: #856404;

    font-size: 16px;
    line-height: 2;

    text-align: center;
}


/* موبایل */

@media (max-width: 700px) {

    .table-info {
        grid-template-columns: 1fr;
    }

    .table-card {
        padding: 15px;
    }

}

/* =========================
   رنگ‌بندی قیمت‌ها
========================= */

/* =========================
   رنگ‌بندی تحلیلی جدول
========================= */

#sensitivity-table tbody td {
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.refresh-gold-button {
    width: 100%;
    height: 56px;

    padding: 12px 15px;

    border: none;

    border-radius: 10px;

    background: #222;

    color: #ffffff;

    font-family: inherit;

    font-size: 14px;

    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        opacity 0.2s ease;
}

.refresh-gold-button:hover {
    background: #111;
}

.refresh-gold-button:disabled {
    opacity: 0.6;
    cursor: wait;
}


.refresh-gold-button:hover {
    background: #111;
}


.refresh-gold-button:disabled {
    opacity: 0.6;

    cursor: wait;
}

.gold-update-info {
    width: 100%;
    height: 26px;

    display: flex;

    align-items: center;
    justify-content: center;

    text-align: center;

    color: #777;

    font-size: 12px;

    line-height: 1;

    white-space: nowrap;
}

.price-control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    align-items: stretch;
}

@media (max-width: 700px) {

    .price-control-grid {
        grid-template-columns: 1fr;
    }

    .price-control-card {
        padding: 18px;
    }

}

.is-hidden {
    display: none !important;
}

.input-wrapper input::placeholder {
    font-family: inherit;
    font-size: 13px;
    color: #999;
    opacity: 1;
}

.watermark-logo {
    position: absolute;

    top: 60%;
    left: 55%;

    width: 120%;

    transform: translate(-50%, -50%);

    opacity: 0.2;

    z-index: 100;

    pointer-events: none;

    user-select: none;

    object-fit: contain;
}