﻿/* =====================================================================
   investment-details.css
   ---------------------------------------------------------------------
   استایل‌های صفحه جزئیات گزارش سرمایه‌گذاری
   ===================================================================== */
/* ===============================
   تنظیمات پایه
================================ */
.section {
    margin-top: -70px !important;
    margin-bottom: -70px !important;
}
.inv-detail-container {
    direction: rtl;
    font-family: iranyekan, IRANYekan, Tahoma, sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
    color: #1c1c1c;
}

/* ===== Breadcrumb ===== */
.inv-breadcrumb {
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

    .inv-breadcrumb ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0.3rem;
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .inv-breadcrumb li + li::before {
        content: "/";
        color: #6b6b6b;
        margin: 0 0.4rem;
    }

    .inv-breadcrumb a {
        color: #1f4e8c;
        text-decoration: none;
    }

        .inv-breadcrumb a:hover {
            text-decoration: underline;
        }

    .inv-breadcrumb .is-active a {
        color: #1c1c1c;
        font-weight: 600;
        pointer-events: none;
    }

/* ===== هدر ===== */
.inv-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e7e7e7;
    margin-bottom: 2rem;
}

.inv-detail-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #124E78;
    margin: 0 0 0.5rem;
}

.inv-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
}

.inv-detail-meta-item {
    font-size: 0.85rem;
    color: #6b6b6b;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

    .inv-detail-meta-item i {
        color: #1f4e8c;
    }

.inv-detail-header-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

/* ===== دکمه‌ها ===== */
.inv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    border: 1px solid #e7e7e7;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    background: #fff;
    color: #1c1c1c;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
    height: 38px;
}

    .inv-btn:hover {
        background: #f5f6f8;
        border-color: #ccc;
    }

    .inv-btn.is-light {
        background: #f5f6f8;
        border-color: #e7e7e7;
    }

        .inv-btn.is-light:hover {
            background: #e8e8e8;
        }

    .inv-btn.is-outline {
        background: transparent;
        border-color: #124E78;
        color: #124E78;
    }

        .inv-btn.is-outline:hover {
            background: #124E78;
            color: #fff;
        }

/* ===== خلاصه هوشمند ===== */
.inv-smart-summary {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: #f0f7ff;
    border: 1px solid #d4e4f7;
    border-radius: 12px;
    margin-bottom: 2rem;
    align-items: flex-start;
}

.inv-smart-summary-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.inv-smart-summary-text {
    font-size: 0.95rem;
    line-height: 1.8;
    color: #1c1c1c;
}

/* ===== بخش‌ها ===== */
.inv-section {
    margin-bottom: 2.5rem;
}

.inv-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.inv-section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #124E78;
    margin: 0;
}

.inv-section-subtitle {
    font-size: 0.85rem;
    color: #6b6b6b;
}

/* ===== KPI Grid ===== */
.inv-kpi-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    border: 1px solid #e7e7e7;
}

.inv-kpi-item {
    padding: 1rem 0.9rem;
    border-inline-start: 1px solid #e7e7e7;
    background: #fff;
    text-align: center;
}

    .inv-kpi-item:first-child {
        border-inline-start: none;
    }

.inv-kpi-label {
    font-size: 0.74rem;
    color: #6b6b6b;
    margin-bottom: 0.4rem;
}

.inv-kpi-value {
    font-size: 1.3rem;
    font-weight: 800;
    color: #124E78;
    line-height: 1.2;
}

    .inv-kpi-value.is-positive {
        color: #12864a;
    }

    .inv-kpi-value.is-negative {
        color: #c62f2f;
    }

.inv-kpi-unit {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b6b6b;
}

.inv-kpi-badge {
    display: inline-block;
    margin-top: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

@media (max-width: 900px) {
    .inv-kpi-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .inv-kpi-item:nth-child(4) {
        border-inline-start: none;
    }
}

@media (max-width: 560px) {
    .inv-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .inv-kpi-item:nth-child(3) {
        border-inline-start: none;
    }
}

/* ===== وضعیت‌ها ===== */
.inv-good {
    color: #12864a;
    background: #eafaf1;
}

.inv-ok {
    color: #1f4e8c;
    background: #eaf1fb;
}

.inv-mid {
    color: #b3791d;
    background: #fdf3e3;
}

.inv-bad {
    color: #c62f2f;
    background: #fdecec;
}

.inv-flat {
    color: #6b6b6b;
    background: #f5f6f8;
}

/* ===== نمودارها ===== */
.inv-chart-box {
    position: relative;
    height: 340px;
}

    .inv-chart-box.short {
        height: 280px;
    }

.inv-chart-note {
    font-size: 0.75rem;
    color: #6b6b6b;
    margin-top: 0.6rem;
}

/* ===== جداول ===== */
.inv-table-responsive {
    overflow-x: auto;
}

.inv-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
}

    .inv-table th,
    .inv-table td {
        padding: 0.65rem 0.7rem;
        text-align: center;
        border-bottom: 1px solid #e7e7e7;
    }

    .inv-table th {
        color: #6b6b6b;
        font-weight: 600;
        font-size: 0.76rem;
        background: #f5f6f8;
    }

        .inv-table td:first-child,
        .inv-table th:first-child {
            text-align: right;
            font-weight: 600;
        }

    .inv-table .inv-highlight-row {
        background: #f5f6f8;
    }

    .inv-table .is-positive {
        color: #12864a;
        font-weight: 700;
    }

    .inv-table .is-negative {
        color: #c62f2f;
        font-weight: 700;
    }

.inv-table-description {
    font-size: 0.78rem;
    color: #6b6b6b;
    text-align: right;
}

.inv-table-note {
    font-size: 0.82rem;
    color: #6b6b6b;
    text-align: center;
}

.inv-pill {
    display: inline-block;
    padding: 0.12rem 0.55rem;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
}

.inv-stars {
    color: #d9a300;
    letter-spacing: 1px;
}

/* ===== رادار ===== */
.inv-radar-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: center;
}

@media (max-width: 760px) {
    .inv-radar-wrap {
        grid-template-columns: 1fr;
    }
}

.inv-radar-legend {
    font-size: 0.84rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

    .inv-radar-legend li {
        display: flex;
        justify-content: space-between;
        padding: 0.45rem 0;
        border-bottom: 1px dashed #e7e7e7;
    }

        .inv-radar-legend li:last-child {
            border-bottom: none;
        }

    .inv-radar-legend .is-positive {
        color: #12864a;
    }

    .inv-radar-legend .is-negative {
        color: #c62f2f;
    }

/* ===== همبستگی ===== */
.inv-corr-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.4rem;
}

@media (max-width: 760px) {
    .inv-corr-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.inv-corr-card {
    border: 1px solid #e7e7e7;
    padding: 0.9rem;
    border-radius: 4px;
    text-align: center;
}

.inv-corr-label {
    font-size: 0.76rem;
    color: #6b6b6b;
    margin-bottom: 0.35rem;
}

.inv-corr-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: #124E78;
}

.inv-corr-bar {
    height: 5px;
    border-radius: 3px;
    background: #e7e7e7;
    margin-top: 0.5rem;
    overflow: hidden;
}

    .inv-corr-bar > span {
        display: block;
        height: 100%;
        background: #1f4e8c;
    }

.inv-corr-strength {
    font-size: 0.7rem;
    color: #6b6b6b;
    margin-top: 0.3rem;
}

/* ===== تایم‌لاین ===== */
.inv-timeline {
    display: flex;
    border: 1px solid #e7e7e7;
    border-radius: 4px;
    overflow: hidden;
}

.inv-timeline-item {
    flex: 1;
    text-align: center;
    padding: 0.9rem 0.4rem;
    border-inline-start: 1px solid #e7e7e7;
}

    .inv-timeline-item:first-child {
        border-inline-start: none;
    }

.inv-timeline-year {
    font-size: 0.78rem;
    color: #6b6b6b;
    margin-bottom: 0.4rem;
}

.inv-timeline-val {
    font-weight: 800;
    font-size: 1.02rem;
}

    .inv-timeline-val.is-positive {
        color: #12864a;
    }

    .inv-timeline-val.is-negative {
        color: #c62f2f;
    }

/* ===== جمع‌بندی ===== */
.inv-conclusion-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .inv-conclusion-grid {
        grid-template-columns: 1fr;
    }
}

.inv-conclusion-item {
    background: #fff;
    border: 1px solid #e7e7e7;
    border-radius: 12px;
    padding: 1.2rem;
}

.inv-conclusion-icon {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.inv-conclusion-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: #124E78;
    margin: 0 0 0.5rem;
}

.inv-conclusion-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .inv-conclusion-content ul li {
        padding: 0.3rem 0;
        font-size: 0.85rem;
        line-height: 1.6;
        padding-right: 1.2rem;
        position: relative;
    }

        .inv-conclusion-content ul li::before {
            content: "•";
            position: absolute;
            right: 0;
            color: #1f4e8c;
        }

/* ===== ریسپانسیو ===== */
@media (max-width: 768px) {
    .inv-detail-title {
        font-size: 1.3rem;
    }

    .inv-detail-header {
        flex-direction: column;
        align-items: stretch;
    }

    .inv-detail-header-actions {
        justify-content: flex-start;
    }

    .inv-detail-meta {
        flex-direction: column;
        gap: 0.3rem;
    }

    .inv-smart-summary {
        flex-direction: column;
        padding: 1rem;
    }

    .inv-chart-box {
        height: 260px;
    }

        .inv-chart-box.short {
            height: 220px;
        }
    /* ===== بازده اجاره ماهانه در کارت ===== */
    .inv-card-rental-yield {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px dashed var(--inv-border);
    }

    .inv-yield-header {
        margin-bottom: 0.3rem;
    }

    .inv-yield-title {
        font-size: 0.75rem;
        font-weight: 600;
        color: var(--inv-text-soft);
    }

    .inv-yield-stats {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 0.3rem;
    }

    .inv-yield-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 0.2rem 0.1rem;
        background: var(--inv-bg-soft);
        border-radius: 4px;
    }

    .inv-yield-label {
        font-size: 0.6rem;
        color: var(--inv-text-soft);
    }

    .inv-yield-value {
        font-size: 0.75rem;
        font-weight: 700;
        color: var(--inv-text);
    }

        .inv-yield-value.is-positive {
            color: var(--inv-success);
        }

        .inv-yield-value.is-negative {
            color: var(--inv-danger);
        }

    /* ===== خلاصه بازده اجاره در صفحه جزئیات ===== */
    .inv-yield-summary {
        display: flex;
        flex-wrap: wrap;
        gap: 1.5rem;
        margin-top: 1rem;
        padding: 1rem;
        background: var(--inv-bg-soft);
        border-radius: 8px;
        border: 1px solid var(--inv-border);
    }

    .inv-yield-summary-item {
        display: flex;
        flex-direction: column;
        gap: 0.2rem;
    }

    .inv-yield-summary-label {
        font-size: 0.75rem;
        color: var(--inv-text-soft);
    }

    .inv-yield-summary-value {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--inv-text);
    }

        .inv-yield-summary-value.is-positive {
            color: var(--inv-success);
        }

        .inv-yield-summary-value.is-negative {
            color: var(--inv-danger);
        }

    /* ===== ریسپانسیو ===== */
    @media (max-width: 600px) {
        .inv-yield-stats {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    /* ===== جدول داده‌های سری زمانی ===== */
    .inv-section .table-container {
        border: 1px solid #e7e7e7;
        border-radius: 8px;
        overflow: hidden;
    }

        .inv-section .table-container table {
            margin-bottom: 0;
        }

        .inv-section .table-container thead th {
            background: #f5f6f8;
            border-bottom: 2px solid #e0e0e0;
            font-weight: 600;
            font-size: 0.78rem;
            color: #1c1c1c;
            position: sticky;
            top: 0;
            z-index: 10;
        }

        .inv-section .table-container tbody tr:hover {
            background: #f8f9fa;
        }

        .inv-section .table-container tbody tr:nth-child(even) {
            background: #fafafa;
        }

            .inv-section .table-container tbody tr:nth-child(even):hover {
                background: #f0f1f2;
            }

        .inv-section .table-container tfoot td {
            background: #f8f9fa;
            border-top: 2px solid #e0e0e0;
            font-size: 0.75rem;
            color: #888;
        }

}

/* ===== شبیه‌سازی سرمایه‌گذاری ===== */
.inv-sim-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e7e7e7;
    margin-bottom: 1.5rem;
    align-items: center;
}

.inv-sim-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.inv-sim-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.inv-sim-btn {
    padding: 0.3rem 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 0.75rem;
    font-family: iranyekan;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #1c1c1c;
}

    .inv-sim-btn:hover {
        background: #e8e8e8;
        border-color: #ccc;
    }

    .inv-sim-btn.is-active {
        background: #124E78;
        color: #fff;
        border-color: #124E78;
    }

.inv-sim-custom {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inv-sim-bank {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.3rem 0.8rem;
    background: #e8f5e9;
    border-radius: 4px;
    border: 1px solid #c8e6c9;
}

.inv-input {
    padding: 0.3rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: iranyekan;
    background: #fff;
    color: #1c1c1c;
}

    .inv-input:focus {
        border-color: #124E78;
        outline: none;
        box-shadow: 0 0 0 2px rgba(18,78,120,0.1);
    }

.inv-select {
    padding: 0.3rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: iranyekan;
    background: #fff;
    color: #1c1c1c;
}

.inv-label {
    font-size: 0.75rem;
    color: #6b6b6b;
    font-weight: 600;
}

@media (max-width: 768px) {
    .inv-sim-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .inv-sim-group,
    .inv-sim-custom,
    .inv-sim-bank {
        flex-wrap: wrap;
        justify-content: center;
    }

    .inv-sim-presets {
        justify-content: center;
    }
}

/* ===== تنظیمات نمودار شبیه‌سازی ===== */
#invCumulativeChart {
    width: 100%;
    height: 100%;
}

.inv-chart-box.short {
    height: 300px;
    overflow: visible !important;
    position: relative;
}

/* ✅ تنظیم فاصله برای جلوگیری از بریدگی برچسب‌ها */
.inv-chart-box canvas {
    max-width: 100%;
    max-height: 100%;
}

/* ✅ اطمینان از نمایش کامل لیبل‌ها */
#invCumulativeChart {
    display: block;
    margin: 0 auto;
}

/* ✅ بهبود نمایش در موبایل */
@media (max-width: 768px) {
    .inv-chart-box.short {
        height: 380px;
        overflow: visible !important;
    }

    #invCumulativeChart {
        height: 380px !important;
    }
}

@media (max-width: 480px) {
    .inv-chart-box.short {
        height: 440px;
        overflow: visible !important;
    }

    #invCumulativeChart {
        height: 440px !important;
    }
}