/* ====================================================================
   📊 CSS الرسم البياني المدمج (داخل details modal)
   ملف منفصل لتجنب التداخل مع style.css الأساسي
==================================================================== */

.details-chart-section {
    margin: 20px 0 24px;
    padding: 16px;
    background: #fafafa;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

/* ===== سطر السعر + التغيّر في الهيدر ===== */
.dph-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 6px;
}

.dph-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
}

.dph-change {
    font-size: 0.92rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 7px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dph-change.positive { background: #d1fae5; color: #047857; }
.dph-change.negative { background: #fee2e2; color: #b91c1c; }
.dph-change.neutral  { background: #f3f4f6; color: #9ca3af; }

.dph-change .dph-pct {
    font-size: 0.85rem;
    opacity: 0.85;
}

.dph-change .riyal-symbol,
.dph-change .cur-symbol {
    color: currentColor;
    width: 0.85em;
    height: 0.85em;
}

/* ===== الملخص الهادئ تحت الرسم ===== */
.details-summary-quiet {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin: 0 0 20px;
    padding: 10px 8px;
    background: transparent;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.dsq-item {
    text-align: center;
    padding: 4px 8px;
    border-inline-end: 1px solid #f3f4f6;
}
.dsq-item:last-child { border-inline-end: 0; }

.dsq-item span {
    display: block;
    font-size: 0.72rem;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 500;
}

.dsq-item strong {
    font-size: 0.95rem;
    color: #1f2937;
    font-weight: 700;
    display: block;
}

/* ===== رمز العملة بجانب الرقم + كل الأرقام أسود وعريض ===== */
#stockDetailsModal .cur-amount {
    display: inline-flex !important;
    flex-direction: row !important;
    align-items: baseline;
    justify-content: center;
    gap: 3px;
}

#stockDetailsModal .riyal-symbol,
#stockDetailsModal .cur-symbol {
    width: 0.85em;
    height: 0.85em;
    display: inline-block;
}

#stockDetailsModal .dsq-item strong,
#stockDetailsModal .dcs-item strong,
#stockDetailsModal .cur-amount,
#stockDetailsModal .cur-num {
    color: #1f2937 !important;
    font-weight: 700 !important;
}

/* ===== التبويبات ===== */
.dc-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 14px;
    background: #fff;
    padding: 4px;
    border-radius: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}
.dc-tabs::-webkit-scrollbar { display: none; }

.dc-tabs button {
    flex: 1;
    min-width: 60px;
    background: transparent;
    border: 0;
    padding: 9px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #6b7280;
    border-radius: 7px;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.dc-tabs button.active {
    background: linear-gradient(135deg, #7c3aed, #ec4899);
    color: #fff;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

.dc-tabs button:hover:not(.active) {
    background: #f3f4f6;
    color: #374151;
}

/* ===== Canvas ===== */
.dc-canvas-wrap {
    position: relative;
    height: 320px;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
}

.dc-loading,
.dc-empty,
.dc-error {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 0.92rem;
    background: rgba(255,255,255,0.95);
    border-radius: 10px;
}

.dc-error { color: #b91c1c; }

/* ===== إحصائيات يومية ===== */
.dc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: #fff;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
}

.dcs-item { text-align: center; }

.dcs-item span {
    display: block;
    font-size: 0.72rem;
    color: #6b7280;
    margin-bottom: 4px;
    font-weight: 500;
}

.dcs-item strong {
    font-size: 0.92rem;
    color: #1f2937;
    font-weight: 700;
}

/* ===== تنويه التأخير ===== */
.dc-delay {
    text-align: center;
    font-size: 0.72rem;
    color: #9a3412;
    margin-bottom: 10px;
    background: #fff7ed;
    padding: 6px 12px;
    border-radius: 8px;
    border: 1px solid #fed7aa;
}

/* ====================================================================
   📱 الجوال
==================================================================== */
@media (max-width: 700px) {
    .details-chart-section { 
        padding: 10px; 
        margin: 12px 0 16px;
        border-radius: 10px;
    }
    .dc-delay { font-size: 0.68rem; padding: 5px 10px; }
    .dc-tabs button { font-size: 0.74rem; padding: 6px 4px; min-width: 44px; }
    .dc-canvas-wrap { height: 220px; padding: 6px; }
    
    .dc-stats { gap: 4px; padding: 8px; }
    .dcs-item span { font-size: 0.64rem; }
    .dcs-item strong { font-size: 0.78rem; }
    
    .dph-row { gap: 8px; margin-top: 4px; }
    .dph-price { font-size: 1.2rem; }
    .dph-change { font-size: 0.78rem; padding: 3px 8px; }
    .dph-change .dph-pct { font-size: 0.72rem; }
    
    .details-summary-quiet { padding: 8px 4px; margin: 0 0 14px; }
    .dsq-item { padding: 2px 4px; }
    .dsq-item span { font-size: 0.62rem; }
    .dsq-item strong { font-size: 0.78rem; }
}

/* ====================================================================
   ✨ Live Update — وميض خفيف عند تحديث الأسعار
==================================================================== */
.row-flash {
    animation: rowFlashAnim 1.5s ease-out;
}
@keyframes rowFlashAnim {
    0%   { background: rgba(124, 58, 237, 0.18); }
    100% { background: transparent; }
}

/* ====================================================================
   نسبة الربح بجانب المبلغ في بطاقة الربح/الخسارة
==================================================================== */
.dl-card-pct {
    font-size: 0.7em;
    font-weight: 600;
    opacity: 0.85;
    margin-inline-start: 4px;
}
