@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSans(FaNum)_Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSans(FaNum)_Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSans(FaNum)_Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSans(FaNum)_Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'IRANSans';
    src: url('../fonts/IRANSans(FaNum)_Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}


/* =========================
   Base
========================= */

* {
    box-sizing: border-box;
}

html {
    direction: rtl;
}

body {
    margin: 0;
    min-height: 100vh;

    font-family: 'IRANSans', sans-serif;
    font-weight: 400;

    background: #0b1220;
    color: #f1f5f9;
}

button,
input {
    font-family: inherit;
}


/* =========================
   Container
========================= */

.container {
    width: min(1400px, calc(100% - 40px));
    margin: 0 auto;
    padding: 50px 0 80px;
}


/* =========================
   Header
========================= */

.page-header {
    text-align: center;
    margin-bottom: 45px;
}

.page-header h1 {
    margin: 0 0 12px;

    font-size: 34px;
    font-weight: 900;
}

.page-header p {
    margin: 0;

    color: #94a3b8;
    font-size: 16px;
    font-weight: 300;
}


/* =========================
   Sections
========================= */

.input-section,
.results-section {
    background: #111a2b;
    border: 1px solid #1e293b;
    border-radius: 18px;
    padding: 30px;

    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.18);
}

.results-section {
    margin-top: 30px;
}

.section-title {
    text-align: center;
    margin-bottom: 30px;
}

.section-title h2 {
    margin: 0 0 8px;

    font-size: 24px;
    font-weight: 700;
}

.section-title p {
    margin: 0;

    color: #94a3b8;
    font-size: 14px;
    font-weight: 300;
}


/* =========================
   Inputs
========================= */

.inputs-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.input-card {
    background: #0d1626;
    border: 1px solid #1e293b;
    border-radius: 14px;

    padding: 18px;
}

.input-card label {
    display: block;
    margin-bottom: 10px;

    font-size: 14px;
    font-weight: 500;

    color: #cbd5e1;
}

.input-wrapper {
    display: flex;
    align-items: center;

    background: #111c30;
    border: 1px solid #26344a;
    border-radius: 10px;

    overflow: hidden;
}

.input-wrapper input {
    width: 100%;
    min-width: 0;

    border: 0;
    outline: none;

    background: transparent;
    color: #f8fafc;

    padding: 12px 14px;

    font-size: 17px;
    font-weight: 500;

    direction: ltr;
    text-align: right;
}

.input-wrapper input::placeholder {
    color: #64748b;
    font-size: 12px;
    font-weight: 300;
}

.input-wrapper span {
    padding: 0 13px;

    color: #64748b;

    font-size: 12px;
    white-space: nowrap;
}


/* =========================
   Buttons
========================= */

.actions {
    display: flex;
    justify-content: center;
    gap: 14px;

    margin-top: 28px;
}

.btn {
    border: 0;
    border-radius: 10px;

    padding: 13px 25px;

    cursor: pointer;

    font-size: 14px;
    font-weight: 700;

    transition:
        transform 0.2s ease,
        opacity 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: #16a34a;
    color: #ffffff;
}

.btn-secondary {
    background: #263449;
    color: #ffffff;
}

.btn:active {
    transform: translateY(0);
}


/* =========================
   Results
========================= */

.results-placeholder {
    min-height: 180px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1px dashed #334155;
    border-radius: 14px;

    color: #64748b;
}

.results-placeholder p {
    margin: 0;

    font-size: 14px;
}


/* =========================
   Responsive
========================= */

@media (max-width: 1000px) {

    .inputs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {

    .container {
        width: min(100% - 24px, 1400px);
        padding-top: 30px;
    }

    .input-section,
    .results-section {
        padding: 20px;
    }

    .inputs-grid {
        grid-template-columns: 1fr;
    }

    .actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .page-header h1 {
        font-size: 26px;
    }
}

.calculate-actions {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}


#calculateBtn {
    border: none;
    border-radius: 10px;
    padding: 12px 30px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}
/* =========================================
   GOLD IMPLICIT DOLLAR CHART
   ========================================= */

.chart-container {
    width: 100%;
    box-sizing: border-box;

    background: #ffffff;

    border: 1px solid #dce3eb;
    border-radius: 14px;

    padding: 32px 30px 22px;

    overflow: hidden;
}


/* عنوان */

.chart-title {
    text-align: center;

    margin-bottom: 35px;
}

.chart-title h2 {
    margin: 0;

    font-size: 24px;
    font-weight: 800;

    color: #111827;
}

.chart-title p {
    margin: 10px 0 0;

    font-size: 16px;

    color: #64748b;
}


/* محدوده ستون‌ها */

.bars-container {

    width: 100%;

    height: 390px;

    display: flex;

    align-items: flex-end;

    justify-content: center;

    gap: 26px;

    direction: ltr;

    padding: 0 20px;

    box-sizing: border-box;
}


/* هر ستون */

.chart-item {

    flex: 1;

    max-width: 150px;

    min-width: 75px;

    height: 100%;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: flex-end;

    position: relative;
}


/* عدد بالای ستون */

.chart-value {

    width: 100%;

    text-align: center;

    direction: rtl;

    font-size: 15px;

    font-weight: 700;

    color: #111827;

    margin-bottom: 8px;

    white-space: nowrap;
}


/* فضای ستون */

.chart-bar-area {

    width: 100%;

    height: 290px;

    display: flex;

    align-items: flex-end;

    justify-content: center;
}


/* خود ستون */

.chart-bar {

    width: 78%;

    min-height: 35px;

    border-radius: 5px 5px 0 0;

    transition:
        height 0.5s ease,
        transform 0.2s ease;
}


/* پایین‌تر از دلار بازار */

.chart-bar.cheaper {

    background: #16c55b;
}


/* دلار بازار */

.chart-bar.market {

    background: #000000;
}


/* بالاتر از دلار بازار */

.chart-bar.expensive {

    background: #f2383f;
}


/* اسم دارایی */

.chart-label {

    width: 100%;

    text-align: center;

    direction: rtl;

    font-size: 15px;

    font-weight: 700;

    color: #111827;

    margin-top: 12px;

    white-space: nowrap;
}


/* کمی تأکید بیشتر روی دلار بازار */

.market-item {

    transform: scaleX(1.02);
}

.market-item .chart-value {

    font-weight: 800;
}


/* فوتر */

.chart-footer {

    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-top: 28px;

    padding: 0 20px;

    font-size: 13px;

    color: #64748b;

    direction: rtl;
}


/* موبایل */

@media (max-width: 900px) {

    .chart-container {
        padding: 25px 12px 20px;
    }

    .bars-container {

        gap: 10px;

        padding: 0 5px;

        overflow-x: auto;

        justify-content: flex-start;
    }

    .chart-item {

        min-width: 90px;

        max-width: 110px;
    }

    .chart-value {

        font-size: 12px;
    }

    .chart-label {

        font-size: 12px;
    }

    .chart-bar-area {

        height: 260px;
    }

}


@media (max-width: 600px) {

    .chart-title h2 {
        font-size: 19px;
    }

    .chart-title p {
        font-size: 13px;
    }

    .bars-container {
        justify-content: flex-start;
    }

    .chart-footer {
        display: none;
    }

}

/* =====================================================
   نمودار دلار ضمنی
   ===================================================== */

.chart-bar-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}


.chart-bar-wrapper .chart-bar {
    width: 100%;
    height: 100%;
    border-radius: 5px 5px 0 0;
}


.chart-value {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);

    white-space: nowrap;

    font-size: 14px;
    font-weight: 700;

    color: #111;

    z-index: 5;
}


/* =====================================================
   Tooltip
   ===================================================== */

.chart-tooltip {
    position: absolute;

    left: 50%;
    bottom: calc(100% + 42px);

    transform:
        translateX(-50%)
        translateY(8px);

    width: max-content;
    min-width: 190px;

    padding: 14px 18px;

    background: #ffffff;

    border-radius: 10px;

    box-shadow:
        0 8px 25px rgba(0, 0, 0, 0.18);

    color: #222;

    text-align: center;

    opacity: 0;
    visibility: hidden;

    pointer-events: none;

    transition:
        opacity 0.2s ease,
        transform 0.2s ease;

    z-index: 100;
}


.chart-tooltip strong {
    display: block;

    margin-bottom: 8px;

    font-size: 16px;
}


.chart-tooltip div {
    margin-top: 5px;

    font-size: 13px;
}


.chart-tooltip span {
    font-weight: 700;
}

.tooltip-cheaper {
    color: #16a34a;
}

.tooltip-expensive {
    color: #ef3340;
}

.tooltip-equal {
    color: #111111;
}

/* نمایش Tooltip هنگام Hover */

.chart-bar-wrapper:hover .chart-tooltip {
    opacity: 1;

    visibility: visible;

    transform:
        translateX(-50%)
        translateY(0);
}

/* =========================================
   لوگوی فراسبز روی نمودار
   ========================================= */

.chart-container {
    position: relative;
}

.chart-watermark {
    position: absolute;

    width: 110%;
    height: auto;

    left: 50%;
    top: 45%;

    transform: translate(-50%, -50%);

    opacity: 0.1;

    z-index: 9999;

    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}