.arzpaya-date-profit-widget{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:12px;
    padding:20px;
    font-family:IRANSansWeb,sans-serif;
    direction:rtl;
    max-width:420px;
    margin:0;
    box-shadow:none;
}

.arzpaya-date-profit-widget .trade-form{
    display:flex;
    flex-direction:column;
    gap:12px;
    margin-bottom:20px;
}

.arzpaya-date-profit-widget #fiat-input-section{
    overflow:visible;
}

.arzpaya-date-profit-widget #fiat-input-section .currency-selector.open{
    z-index:1001;
}

/* Destination coin selector (matches the amount input box dimensions) */
.arzpaya-date-profit-widget .dp-coin-input-section{
    cursor:pointer;
    overflow:visible;
}

.arzpaya-date-profit-widget .dp-coin-select{
    flex:1;
    min-width:0;
    position:relative;
}

.arzpaya-date-profit-widget .dp-coin-display{
    position:relative;
    display:flex;
    align-items:center;
    width:100%;
    box-sizing:border-box;
    padding:5px 16px 5px 4px;
    outline:none;
    cursor:pointer;
}

.arzpaya-date-profit-widget .dp-coin-content{
    flex:1;
    min-width:0;
    display:flex;
    align-items:center;
    gap:8px;
}

.arzpaya-date-profit-widget .dp-coin-icon{
    width:22px;
    height:22px;
    border-radius:50%;
    object-fit:cover;
    background:#f3f4f6;
    flex-shrink:0;
}

.arzpaya-date-profit-widget .dp-coin-name{
    font-size:14px;
    font-weight:500;
    color:#374151;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
}

.arzpaya-date-profit-widget .dp-coin-arrow{
    flex-shrink:0;
    color:#6b7280;
    font-size:10px;
    line-height:1;
    pointer-events:none;
    transition:transform 0.3s ease;
}

.arzpaya-date-profit-widget .dp-coin-select.open .dp-coin-arrow{
    transform:rotate(180deg);
}

.arzpaya-date-profit-widget .dp-coin-options{
    position:absolute;
    top:calc(100% + 8px);
    right:0;
    left:0;
    z-index:1100;
    list-style:none;
    margin:0;
    padding:4px;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:8px;
    box-shadow:0 8px 24px rgba(15, 23, 42, 0.12);
    max-height:260px;
    overflow-y:auto;
}

.arzpaya-date-profit-widget .dp-coin-options[hidden]{
    display:none;
}

.arzpaya-date-profit-widget .dp-coin-option{
    display:flex;
    align-items:center;
    gap:8px;
    padding:8px 10px;
    border-radius:6px;
    cursor:pointer;
    transition:background-color 0.2s ease;
}

.arzpaya-date-profit-widget .dp-coin-option:hover,
.arzpaya-date-profit-widget .dp-coin-option.is-active{
    background:#eff6ff;
}

.arzpaya-date-profit-widget .dp-coin-option img{
    width:20px;
    height:20px;
    border-radius:50%;
    object-fit:cover;
    background:#f3f4f6;
    flex-shrink:0;
}

.arzpaya-date-profit-widget .dp-coin-option span{
    font-size:14px;
    color:#374151;
}

.arzpaya-date-profit-widget .dp-widget-header{
    margin-bottom:0;
}

.arzpaya-date-profit-widget .dp-title-row{
    display:flex;
    align-items:center;
    gap:8px;
    margin-bottom:16px;
}

.arzpaya-date-profit-widget .dp-title-icon{
    flex-shrink:0;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width:1.4em;
    height:1.4em;
    font-size:18px;
}

.arzpaya-date-profit-widget .dp-title-icon img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}

.arzpaya-date-profit-widget .dp-title{
    margin:0;
    font-size:18px;
    color:#3D72FE;
    font-weight:700;
    line-height:1.2;
    text-align:right;
}

.arzpaya-date-profit-widget .dp-desc{
    margin:0;
    color:#6b7280;
    font-size:14px;
    line-height:1.6;
    font-weight:500;
    text-align:justify;
}

.arzpaya-date-profit-widget .dp-widget-form{
    margin-top:20px;
    margin-bottom:20px;
}

/* Jalali date picker */
.arzpaya-date-profit-widget .dp-date-section{
    position:relative;
    display:flex;
    flex-direction:column;
    gap:6px;
}

.arzpaya-date-profit-widget .dp-date-input-section{
    direction:ltr;
    display:flex;
    flex-direction:row;
    align-items:stretch;
    gap:8px;
    padding:8px;
    cursor:pointer;
}

.arzpaya-date-profit-widget .dp-date-icon-btn{
    flex-shrink:0;
    align-self:stretch;
    display:flex;
    align-items:center;
    justify-content:center;
    width:auto;
    min-width:28px;
    height:auto;
    padding:4px 12px 4px 4px;
    margin:0;
    border:none;
    border-right:1px solid #d1d5db;
    background:transparent;
    color:#6b7280;
    cursor:pointer;
    border-radius:0;
    transition:color 0.2s ease, background-color 0.2s ease;
}

.arzpaya-date-profit-widget .dp-date-icon-btn:hover{
    color:#3D72FE;
    background-color:#eff6ff;
}

.arzpaya-date-profit-widget .dp-date-icon{
    display:block;
    width:20px;
    height:20px;
}

.arzpaya-date-profit-widget .dp-date-field{
    flex:1;
    min-width:0;
    display:flex;
    align-items:stretch;
}

.arzpaya-date-profit-widget .dp-date-display-text{
    display:block;
    user-select:none;
    cursor:inherit;
}

.arzpaya-date-profit-widget .dp-date-display-text.is-placeholder{
    color:#9ca3af;
    font-size:12px;
}

.arzpaya-date-profit-widget .amount-input.dp-date-display-text:not(.is-placeholder){
    font-size:14px;
    font-weight:400;
    line-height:normal;
}

.dp-jalali-backdrop{
    position:fixed;
    inset:0;
    z-index:100000;
    background:rgba(15, 23, 42, 0.5);
    animation:dpJalaliBackdropFade 0.18s ease;
}

.dp-jalali-backdrop[hidden]{
    display:none;
}

body.dp-jalali-modal-open{
    overflow:hidden;
}

.arzpaya-date-profit-widget .dp-jalali-popup{
    position:fixed;
    top:50%;
    left:50%;
    right:auto;
    bottom:auto;
    z-index:100001;
    width:min(360px, calc(100vw - 32px));
    max-height:calc(100vh - 32px);
    overflow-y:auto;
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:14px;
    box-shadow:0 24px 60px rgba(15, 23, 42, 0.28);
    padding:16px;
    transform:translate(-50%, -50%);
    animation:dpJalaliModalIn 0.2s ease;
}

@keyframes dpJalaliBackdropFade{
    from{
        opacity:0;
    }
    to{
        opacity:1;
    }
}

@keyframes dpJalaliModalIn{
    from{
        opacity:0;
        transform:translate(-50%, calc(-50% + 10px));
    }
    to{
        opacity:1;
        transform:translate(-50%, -50%);
    }
}

@media (max-width:767px){
    .arzpaya-date-profit-widget .dp-jalali-popup{
        top:auto;
        bottom:0;
        left:0;
        right:0;
        width:100%;
        max-width:100%;
        max-height:85vh;
        border-radius:18px 18px 0 0;
        padding:16px 16px calc(16px + env(safe-area-inset-bottom, 0px)) 16px;
        transform:none;
        animation:dpJalaliSheetIn 0.24s ease;
    }
}

@keyframes dpJalaliSheetIn{
    from{
        opacity:0;
        transform:translateY(100%);
    }
    to{
        opacity:1;
        transform:translateY(0);
    }
}

.arzpaya-date-profit-widget .dp-jalali-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:6px;
    margin-bottom:12px;
}

.arzpaya-date-profit-widget .dp-jalali-title{
    flex:1;
    text-align:center;
    font-size:14px;
    font-weight:700;
    color:#1f2937;
    white-space:nowrap;
}

.arzpaya-date-profit-widget .dp-jalali-nav{
    width:30px;
    height:30px;
    border:none;
    border-radius:8px;
    background:#f3f4f6;
    color:#4b5563;
    font-size:16px;
    line-height:1;
    cursor:pointer;
    transition:background-color 0.2s ease, color 0.2s ease;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
}

.arzpaya-date-profit-widget .dp-jalali-nav:hover{
    background:#eff6ff;
    color:#3D72FE;
}

.arzpaya-date-profit-widget .dp-jalali-weekdays{
    display:grid;
    grid-template-columns:repeat(7, 1fr);
    gap:4px;
    margin-bottom:6px;
}

.arzpaya-date-profit-widget .dp-jalali-weekdays span{
    text-align:center;
    font-size:11px;
    font-weight:600;
    color:#9ca3af;
    padding:4px 0;
}

.arzpaya-date-profit-widget .dp-jalali-days{
    display:grid;
    grid-template-columns:repeat(7, 1fr);
    gap:4px;
}

.arzpaya-date-profit-widget .dp-jalali-day{
    width:100%;
    aspect-ratio:1;
    min-height:34px;
    border:none;
    border-radius:10px;
    background:transparent;
    color:#374151;
    font-size:13px;
    font-weight:500;
    font-family:IRANSansWeb,sans-serif;
    cursor:pointer;
    transition:background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
}

.arzpaya-date-profit-widget .dp-jalali-day:not(.is-disabled):not(.is-empty):hover{
    background:#eff6ff;
    color:#3D72FE;
}

.arzpaya-date-profit-widget .dp-jalali-day.is-today:not(.is-selected){
    box-shadow:inset 0 0 0 1.5px #93c5fd;
    color:#3D72FE;
    font-weight:700;
}

.arzpaya-date-profit-widget .dp-jalali-day.is-selected{
    background:#3D72FE;
    color:#fff;
    font-weight:700;
    box-shadow:0 4px 12px rgba(61, 114, 254, 0.35);
}

.arzpaya-date-profit-widget .dp-jalali-day.is-disabled{
    color:#d1d5db;
    cursor:not-allowed;
}

.arzpaya-date-profit-widget .dp-jalali-day.is-empty{
    pointer-events:none;
}

.arzpaya-date-profit-widget .dp-summary-list{
    list-style:none;
    margin:0;
    padding:0;
    display:flex;
    flex-direction:column;
    gap:14px;
}

/*
 * Desktop: when the widget sits next to the price chart (cpv2 template grid),
 * the parent cell is stretched to the chart's height. Make the widget a
 * full-height column and let the summary rows absorb the leftover space so the
 * total of the gaps fills down to match the chart's height.
 * In standalone/auto-height contexts there is no extra space, so nothing moves.
 */
@media (min-width:1025px){
    .arzpaya-date-profit-widget{
        display:flex;
        flex-direction:column;
        height:100%;
        box-sizing:border-box;
    }

    .arzpaya-date-profit-widget .dp-summary-list{
        flex:1 1 auto;
        justify-content:space-between;
    }
}

.arzpaya-date-profit-widget .dp-summary-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}

.arzpaya-date-profit-widget .dp-summary-label{
    flex:1;
    min-width:0;
    font-size:14px;
    font-weight:500;
    color:#374151;
    line-height:1.6;
    text-align:right;
}

.arzpaya-date-profit-widget .dp-summary-date-wrap.is-placeholder{
    font-size:12px;
    font-weight:400;
    color:#9ca3af;
}

.arzpaya-date-profit-widget .dp-summary-date-wrap:not(.is-placeholder) .dp-summary-date-paren{
    display:none;
}

.arzpaya-date-profit-widget .dp-summary-date-text.is-placeholder{
    font-size:inherit;
    font-weight:inherit;
    color:inherit;
}

.arzpaya-date-profit-widget .dp-summary-value-wrap{
    display:inline-flex;
    align-items:baseline;
    gap:6px;
    flex-shrink:0;
    flex-direction:row-reverse;
    direction:rtl;
    unicode-bidi:isolate;
}

.arzpaya-date-profit-widget .dp-summary-value{
    flex-shrink:0;
    font-size:14px;
    font-weight:600;
    color:#374151;
    line-height:1.6;
}

.arzpaya-date-profit-widget .dp-summary-unit{
    font-size:11px;
    font-weight:400;
    color:#9ca3af;
    line-height:1.6;
    white-space:nowrap;
}

.arzpaya-date-profit-widget.loading .dp-summary-value{
    color:#9ca3af;
}

.arzpaya-date-profit-widget .dp-summary-badge{
    display:inline-flex;
    align-items:center;
    gap:2px;
    font-size:11px;
    font-weight:700;
    line-height:1.4;
    padding:2px 6px;
    border-radius:6px;
    white-space:nowrap;
    unicode-bidi:isolate;
}

.arzpaya-date-profit-widget .dp-summary-badge[hidden]{
    display:none;
}

.arzpaya-date-profit-widget .dp-summary-badge.is-up{
    background:#dcfce7;
    color:#16a34a;
}

.arzpaya-date-profit-widget .dp-summary-badge.is-down{
    background:#fee2e2;
    color:#dc2626;
}

.arzpaya-date-profit-widget .dp-summary-badge.is-neutral{
    background:#f3f4f6;
    color:#6b7280;
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-summary-badge.is-up{
    background:rgba(74, 222, 128, 0.16);
    color:#4ade80;
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-summary-badge.is-down{
    background:rgba(248, 113, 113, 0.16);
    color:#f87171;
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-summary-badge.is-neutral{
    background:rgba(255, 255, 255, 0.08);
    color:#9ca3af;
}

.arzpaya-date-profit-widget .dp-summary-value.is-positive{
    color:#16a34a;
}

.arzpaya-date-profit-widget .dp-summary-value.is-negative{
    color:#dc2626;
}

.arzpaya-date-profit-widget .dp-message{
    margin:10px 0 0 0;
    padding:8px 10px;
    border-radius:8px;
    font-size:13px;
    font-weight:500;
    line-height:1.6;
    text-align:right;
}

.arzpaya-date-profit-widget .dp-message[hidden]{
    display:none;
}

.arzpaya-date-profit-widget .dp-message.is-error{
    background:#fef2f2;
    color:#dc2626;
}

.arzpaya-date-profit-widget .dp-message.is-info{
    background:#eff6ff;
    color:#3D72FE;
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-summary-value.is-positive{
    color:#4ade80;
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-summary-value.is-negative{
    color:#f87171;
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-message.is-error{
    background:rgba(248, 113, 113, 0.12);
    color:#f87171;
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-message.is-info{
    background:rgba(61, 114, 254, 0.12);
    color:var(--accent-primary);
}

[data-theme="dark"] .arzpaya-date-profit-widget{
    background:var(--card-bg);
    border:1px solid var(--border-color);
    color:var(--text-body);
    box-shadow:var(--shadow-card);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-title{
    color:var(--accent-primary);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-desc{
    color:var(--text-secondary);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-coin-name,
[data-theme="dark"] .arzpaya-date-profit-widget .dp-coin-option span{
    color:var(--text-body);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-coin-arrow{
    color:var(--text-secondary);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-coin-icon,
[data-theme="dark"] .arzpaya-date-profit-widget .dp-coin-option img{
    background:var(--border-color);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-coin-options{
    background:var(--card-bg);
    border-color:var(--border-color);
    box-shadow:var(--shadow-card);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-coin-option:hover,
[data-theme="dark"] .arzpaya-date-profit-widget .dp-coin-option.is-active{
    background:rgba(61, 114, 254, 0.12);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-summary-label,
[data-theme="dark"] .arzpaya-date-profit-widget .dp-summary-value{
    color:var(--text-body);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-summary-unit,
:root:not([data-theme="light"]) .arzpaya-date-profit-widget .dp-summary-unit{
    color:#9ca3af;
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-summary-date-wrap.is-placeholder,
:root:not([data-theme="light"]) .arzpaya-date-profit-widget .dp-summary-date-wrap.is-placeholder{
    color:#9ca3af;
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-date-icon-btn{
    color:var(--text-secondary);
    border-right-color:var(--border-color);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-date-icon-btn:hover{
    color:var(--accent-primary);
    background-color:rgba(61, 114, 254, 0.12);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-date-display-text.is-placeholder{
    color:var(--text-secondary);
    font-size:12px;
}

[data-theme="dark"] .arzpaya-date-profit-widget .amount-input.dp-date-display-text:not(.is-placeholder){
    font-size:14px;
    color:var(--text-body);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-jalali-popup{
    background:var(--card-bg);
    border-color:var(--border-color);
    box-shadow:0 12px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-jalali-title{
    color:var(--text-body);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-jalali-nav{
    background:rgba(255, 255, 255, 0.06);
    color:var(--text-secondary);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-jalali-nav:hover{
    background:rgba(61, 114, 254, 0.15);
    color:var(--accent-primary);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-jalali-day{
    color:var(--text-body);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-jalali-day:not(.is-disabled):not(.is-empty):hover{
    background:rgba(61, 114, 254, 0.15);
    color:var(--accent-primary);
}

[data-theme="dark"] .arzpaya-date-profit-widget .dp-jalali-day.is-selected{
    background:var(--accent-primary);
    color:#fff;
}
