/* =============================================
   Price Chart Modal
   ============================================= */

/* Overlay */
.price-chart-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99999;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: none;
}

.price-chart-modal.show {
    opacity: 1 !important;
}

body.modal-open {
    overflow: hidden;
}

/* Modal Box */
.price-chart-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 20px;
    max-width: 860px;
    width: 92%;
    padding: 28px 28px 24px;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow:
        0 4px 6px rgba(0, 0, 0, 0.05),
        0 20px 60px rgba(0, 0, 0, 0.25);
    font-family: inherit;
    scrollbar-width: thin;
    scrollbar-color: #ddd transparent;
}

.price-chart-modal-content::-webkit-scrollbar {
    width: 5px;
}

.price-chart-modal-content::-webkit-scrollbar-track {
    background: transparent;
}

.price-chart-modal-content::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

/* دکمه بستن */
button.price-chart-modal-close {
    height: 36px !important;
    width: 36px !important;
    color: #111 !important;
    padding: 10px !important;
}
.price-chart-modal-close {
    float: left;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #f2f2f2 !important;
    border: none;
    border-radius: 10px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    position: relative;
    z-index: 10;
}

.price-chart-modal-close:hover,
.price-chart-modal-close:focus {
    background: #e0e0e0 !important;
    transform: scale(1.08);
    outline: none;
}

/* Modal Body */
.price-chart-modal-body {
    clear: both;
    padding-top: 8px;
}

/* هدر مودال */
.modal-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 24px;
    padding-bottom: 18px;
    border-bottom: 2px solid #f0f0f0;
}

.modal-header h2 {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1c1c1c !important;
    font-family: inherit !important;
    line-height: 1.4 !important;
}

.modal-header h3 {
    margin: 0 !important;
    font-size: 15px !important;
    color: #888 !important;
    font-weight: 400 !important;
    font-family: inherit !important;
    line-height: 1.5 !important;
}

/* =============================================
   Loader
   ============================================= */
.modal-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 60px 20px;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #efefef;
    border-top-color: var(--e-global-color-primary, #EF394F);
    border-radius: 50%;
    animation: wcSpinnerSpin 0.85s linear infinite;
}

@keyframes wcSpinnerSpin {
    to { transform: rotate(360deg); }
}

.loader-text {
    margin: 0;
    font-size: 14px;
    color: #999;
    font-family: inherit;
}

/* =============================================
   Chart Container
   ============================================= */
.chart-container {
    position: relative;
    height: 340px;
    margin: 16px 0 20px;
    background: #fafbfc;
    border: 1px solid #efefef;
    border-radius: 14px;
    padding: 16px 12px 12px;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease;
}

.chart-container:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

.chart-container canvas {
    font-family: inherit !important;
}

/* =============================================
   Tabs
   ============================================= */
.tabs-header {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.tab-button {
    padding: 7px 18px;
    background: #f4f4f4;
    border: 1.5px solid #e0e0e0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    font-family: inherit !important;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    line-height: 1.5;
}

.tab-button:hover {
    background: #eaeaea;
    border-color: #ccc;
    color: #1c1c1c;
}

.tab-button.active {
    background: var(--e-global-color-primary, #EF394F);
    color: #fff;
    border-color: var(--e-global-color-primary, #EF394F);
    box-shadow: 0 3px 12px rgba(239, 57, 79, 0.3);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: wcTabFadeIn 0.25s ease;
}

@keyframes wcTabFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   No Data Message
   ============================================= */
.no-data-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 48px 24px;
    background: #fafbfc;
    border: 1px dashed #e0e0e0;
    border-radius: 14px;
    color: #777;
    font-family: inherit !important;
    margin: 16px 0;
}

.no-data-icon {
    font-size: 36px;
    line-height: 1;
    margin-bottom: 4px;
}

.no-data-message p {
    margin: 0 !important;
    font-size: 15px;
    color: #555;
}

.no-data-hint {
    font-size: 13px !important;
    color: #999 !important;
    background: #f0f0f0;
    padding: 6px 14px;
    border-radius: 8px;
}

.no-data-current-price {
    font-size: 14px !important;
    color: #444 !important;
    margin-top: 4px !important;
}

.no-data-current-price strong {
    color: var(--e-global-color-primary, #EF394F);
}

/* =============================================
   Latest Change Date
   ============================================= */
.latest-change-date {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
    padding: 10px 16px;
    background: #f6f7f9;
    border-radius: 10px;
    color: #777;
    font-size: 13px;
    font-family: inherit !important;
    border: 1px solid #efefef;
}

.date-label {
    font-weight: 600;
    color: #555;
}

/* =============================================
   Icon Button
   ============================================= */
.price-chart-icon-container {
    display: inline-flex;
    align-items: center;
}

.price-chart-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    color: inherit;
    transition: color 0.25s ease, transform 0.25s ease, background 0.25s ease;
}

.price-chart-icon-button:hover {
    color: var(--e-global-color-primary, #EF394F);
    transform: scale(1.12);
    background: rgba(239, 57, 79, 0.07);
}

.price-chart-icon-button:focus {
    outline: 2px solid var(--e-global-color-primary, #EF394F);
    outline-offset: 2px;
}

.price-chart-icon-button svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
    .price-chart-modal-content {
        width: 96%;
        max-height: 92vh;
        padding: 18px 16px;
        border-radius: 16px;
    }

    .chart-container {
        height: 280px;
        padding: 10px 8px;
    }

    .tabs-header {
        justify-content: center;
    }

    .tab-button {
        font-size: 12px;
        padding: 6px 14px;
    }

    .modal-header h2 {
        font-size: 17px !important;
    }

    .modal-header h3 {
        font-size: 13px !important;
    }
}

@media (max-width: 480px) {
    .price-chart-modal-content {
        width: 100%;
        max-height: 95vh;
        padding: 14px 12px;
        border-radius: 14px 14px 0 0;
        top: auto;
        bottom: 0;
        left: 0;
        transform: translateX(0);
        position: fixed;
    }

    .chart-container {
        height: 240px;
    }

    .tabs-header {
        flex-direction: column;
        align-items: stretch;
    }

    .tab-button {
        width: 100%;
        text-align: center;
    }

    .no-data-message {
        padding: 32px 16px;
    }
}