/* ═══════════════════════════════════════════════════════════════════
   IT Bulks — Global Stylesheet
   Shared across: index.html, analytics.html, and all other pages.
   ═══════════════════════════════════════════════════════════════════ */

/* ── Brand Tokens ── */
.text-itbulks  { color: #FF6600; }
.bg-itbulks    { background-color: #FF6600; }

/* ── Premium Scrollbar ── */
::-webkit-scrollbar       { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #cbd5e1; }

/* Dark-theme scrollbar (analytics page) */
.dark-scroll::-webkit-scrollbar-thumb { background: #1e293b; }
.dark-scroll::-webkit-scrollbar-thumb:hover { background: #334155; }

/* ── Global Focus Ring ── */
input:focus, select:focus, textarea:focus {
    outline: none !important;
    border-color: #FF6600 !important;
    box-shadow: 0 0 0 3px rgba(255,102,0,0.12) !important;
}

/* ── Checkbox Accent ── */
input[type="checkbox"] { accent-color: #FF6600; }

/* ══════════════════════════════════════════════════════════════════
   MARKET TICKER  (index.html — V2 Feature B6)
   ══════════════════════════════════════════════════════════════════ */

#marketTicker {
    background-color: #0f172a !important;
    background:       #0f172a !important;
    border-bottom:    2px solid #1e293b !important;
    height:           45px !important;
    min-height:       45px !important;
    overflow:         hidden;
    position:         relative;
    display:          flex !important;
    align-items:      center;
    box-shadow:       0 2px 10px rgba(0,0,0,0.5);
}

/* Left & right fade masks */
#marketTicker::before,
#marketTicker::after {
    content: '';
    position: absolute;
    top: 0; bottom: 0;
    width: 90px;
    z-index: 10;
    pointer-events: none;
}
#marketTicker::before {
    left: 0;
    background: linear-gradient(to right, #0f172a 0%, transparent 100%);
}
#marketTicker::after {
    right: 0;
    background: linear-gradient(to left, #0f172a 0%, transparent 100%);
}

/* Scrolling track */
.ticker-track {
    display: flex;
    align-items: center;
    white-space: nowrap;
    animation: ticker-scroll 60s linear infinite;
    will-change: transform;
}
.ticker-track:hover { animation-play-state: paused; }

@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Individual ticker item */
.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 22px;
    font-size: 11.5px;
    font-weight: 700;
    border-right: 1px solid #1e293b;
    height: 45px;
    cursor: default;
    transition: background 0.15s ease;
}
.ticker-item:hover { background: rgba(255,255,255,0.03); }

/* Label — default dim white; semantic color classes override this */
.ticker-item .ticker-label {
    color: rgba(255,255,255,0.45) !important;
    font-weight: 800 !important;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ── Analytics-Matched Semantic Palette — applied to LABELS only ── */
/* Matches the exact colors used in the Market Intelligence Terminal (analytics.html) */

/* Total Market Cap → green-400 (#4ade80) — matches KPI card */
.ticker-item .ticker-label.ticker-market  { color: #4ade80 !important; }

/* WTS → red-500 (#ef4444) — matches WTS slice in Supply vs Demand doughnut */
.ticker-item .ticker-label.ticker-wts     { color: #ef4444 !important; }

/* WTB → blue-500 (#3b82f6) — matches WTB slice in Supply vs Demand doughnut */
.ticker-item .ticker-label.ticker-wtb     { color: #3b82f6 !important; }

/* RFQ → purple-400 (#c084fc) — matches RFQ slice */
.ticker-item .ticker-label.ticker-rfq     { color: #c084fc !important; }

/* Brands (odd) → orange-400 (#fb923c) — matches Top Category KPI card */
.ticker-item .ticker-label.ticker-brand-a { color: #fb923c !important; }

/* Brands (even) → purple-400 (#c084fc) — matches Top Brand KPI card */
.ticker-item .ticker-label.ticker-brand-b { color: #c084fc !important; }

/* Models → blue-400 (#60a5fa) — matches Active Listings KPI card */
.ticker-item .ticker-label.ticker-model   { color: #60a5fa !important; }

/* Components (RAM/SSD) → yellow-400 (#facc15) — warm component color */
.ticker-item .ticker-label.ticker-component { color: #facc15 !important; }

/* Top Category → orange-400 (#fb923c) */
.ticker-item .ticker-label.ticker-category { color: #fb923c !important; }

/* Legacy neon aliases on labels — kept for backward compat */
.ticker-item .ticker-label.neon-green      { color: #4ade80 !important; }
.ticker-item .ticker-label.electric-cyan   { color: #60a5fa !important; }
.ticker-item .ticker-label.vibrant-orange  { color: #fb923c !important; }
.ticker-item .ticker-label.phosphor-yellow { color: #facc15 !important; }

/* Value — ALWAYS white, no exceptions */
.ticker-item .ticker-value {
    color: #ffffff !important;
    font-weight: 900 !important;
    font-size: 12px;
}

/* FontAwesome icons inside ticker */
#marketTicker .fa-solid { color: rgba(255,255,255,0.35) !important; }

/* Separator dot */
.ticker-sep {
    display: inline-block;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: #334155;
    margin: 0 4px;
    vertical-align: middle;
}

/* ══════════════════════════════════════════════════════════════════
   TRUST SCORE GAUGE  (index.html — V2 Feature B2)
   ══════════════════════════════════════════════════════════════════
   RULE: .gauge-wrap is ALWAYS in normal document flow.
         NO absolute, NO relative with offsets, NO negative margins.
   ══════════════════════════════════════════════════════════════════ */

.gauge-wrap {
    display: inline-flex;
    align-items: center;
    position: static;   /* NEVER change this to relative/absolute */
    margin: 0;
    padding: 0;
}

/* Tooltip — uses fixed positioning so it escapes overflow:hidden parents */
.gauge-tooltip {
    display: none;
    position: fixed;
    width: 192px;
    background: #111827;
    color: #fff;
    font-size: 10px;
    line-height: 1.55;
    border-radius: 10px;
    padding: 9px 12px;
    z-index: 9999;
    box-shadow: 0 14px 30px rgba(0,0,0,0.25);
    pointer-events: none;
    white-space: normal;
    transform: translateX(-50%);
}
.gauge-wrap:hover .gauge-tooltip { display: block; }
.gauge-tooltip .ts-arrow {
    position: absolute;
    top: 100%; left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #111827;
}

/* ── Company Column (broadcast cards) ── */
.company-col {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    min-width: 0;
    padding-bottom: 12px;   /* physical buffer — prevents gauge overlapping description */
}
.company-col .company-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}
.company-col .gauge-row {
    display: block;          /* block so it takes its own line */
    position: static;        /* NEVER absolute */
    margin-top: 2px;
}

/* ══════════════════════════════════════════════════════════════════
   TRADING ROW  (index.html — Market Feed)
   ══════════════════════════════════════════════════════════════════ */

.trading-row {
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 3px solid transparent;
    cursor: pointer;
    background-color: #ffffff;
}
.trading-row:hover {
    background-color: #fafafa;
    border-left: 3px solid #FF6600;
    box-shadow: 0 4px 20px -4px rgba(0,0,0,0.08), inset 0 0 0 1px rgba(255,102,0,0.05);
    z-index: 10;
}

/* Intent Badge */
.intent-WTS, .row-WTS .intent-badge { background-color: #fef2f2 !important; border-color: #fecaca !important; color: #b91c1c !important; border: 1px solid; }
.intent-WTB, .row-WTB .intent-badge { background-color: #eff6ff !important; border-color: #bfdbfe !important; color: #1d4ed8 !important; border: 1px solid; }
.intent-RFQ, .row-RFQ .intent-badge { background-color: #f8fafc !important; border-color: #e2e8f0 !important; color: #475569 !important; border: 1px solid; }

.intent-badge {
    border-radius: 8px !important;
    font-size: 10px;
    letter-spacing: 0.07em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

/* New-item fade-in */
@keyframes fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.new-item { animation: fade-in 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }

/* Skeleton pulse */
@keyframes pulse-fast {
    0%, 100% { opacity: 1; }
    50%       { opacity: .4; }
}
.skeleton-animate { animation: pulse-fast 1.5s cubic-bezier(0.4, 0, 0.6, 1) infinite; }

/* Image thumbnails */
#marketFeed img.h-16 {
    border-radius: 8px;
    border-color: #f3f4f6;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
#marketFeed .trading-row:hover img.h-16 {
    transform: scale(1.04);
    box-shadow: 0 4px 14px rgba(0,0,0,0.10);
}

/* Icon box hover */
#marketFeed .w-12.h-12.bg-gray-50 {
    border-radius: 10px;
    transition: background-color 0.15s, border-color 0.15s;
}
#marketFeed .trading-row:hover .w-12.h-12.bg-gray-50 {
    background-color: #fff7ed;
    border-color: #fdba74;
}

/* Hover action button */
#marketFeed .absolute.right-6 button {
    border-radius: 10px !important;
    padding: 8px 18px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em;
}

/* ══════════════════════════════════════════════════════════════════
   DEAL SNIPER MODAL  (index.html — V2 Feature B4)
   ══════════════════════════════════════════════════════════════════ */

#sniperModal          { display: none; }
#sniperModal.active   { display: flex; }
#sniperModal input[type="text"],
#sniperModal input[type="number"] {
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* ══════════════════════════════════════════════════════════════════
   ANALYTICS PAGE  (analytics.html — Market Intelligence Terminal)
   ══════════════════════════════════════════════════════════════════ */

/* Terminal Panel */
.terminal-panel {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.terminal-panel:hover {
    border-color: #334155;
    box-shadow: 0 0 0 1px rgba(255,102,0,0.06), 0 20px 40px -12px rgba(0,0,0,0.4);
}

/* Panel Header */
.panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid #1e293b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-title {
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-title .dot {
    width: 6px; height: 6px;
    border-radius: 50%;
    background: #FF6600;
    box-shadow: 0 0 6px rgba(255,102,0,0.6);
}

/* KPI Cards */
.kpi-card {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent, #FF6600), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}
.kpi-card:hover::before { opacity: 1; }
.kpi-card:hover {
    border-color: #334155;
    transform: translateY(-2px);
    box-shadow: 0 16px 40px -12px rgba(0,0,0,0.5);
}
.kpi-value {
    font-size: 2.25rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
}
.kpi-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    margin-bottom: 8px;
}
.kpi-sub {
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    margin-top: 6px;
}

/* Intent Badges (analytics dark theme) */
.badge-WTS { background: rgba(185,28,28,0.15); color: #fca5a5; border: 1px solid rgba(185,28,28,0.3); }
.badge-WTB { background: rgba(29,78,216,0.15);  color: #93c5fd; border: 1px solid rgba(29,78,216,0.3); }
.badge-RFQ { background: rgba(71,85,105,0.15);  color: #94a3b8; border: 1px solid rgba(71,85,105,0.3); }

/* Model Pricing Table */
.model-table tr { border-bottom: 1px solid #1e293b; transition: background 0.12s ease; }
.model-table tr:hover { background: #1e293b; }
.model-table td, .model-table th { padding: 10px 16px; font-size: 12px; }
.model-table th {
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
}

/* Price Bar */
.price-bar-track {
    height: 4px;
    background: #1e293b;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 4px;
}
.price-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, #FF6600, #ff8c42);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* PRO Paywall */
.paywall-container { position: relative; border-radius: 12px; overflow: hidden; }
.paywall-blur      { filter: blur(5px); pointer-events: none; user-select: none; }
.paywall-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10,15,26,0.75);
    backdrop-filter: blur(2px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 12px;
    border: 1px solid rgba(255,102,0,0.2);
}
.paywall-lock {
    width: 56px; height: 56px;
    background: rgba(255,102,0,0.12);
    border: 1px solid rgba(255,102,0,0.3);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    box-shadow: 0 0 24px rgba(255,102,0,0.2);
}
.paywall-btn {
    background: linear-gradient(135deg, #FF6600, #ff8c42);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    margin-top: 14px;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 20px rgba(255,102,0,0.35);
    transition: all 0.15s ease;
}
.paywall-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(255,102,0,0.45); }

/* Skeleton (analytics dark) */
@keyframes skeleton-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.35; }
}
.skeleton {
    background: #1e293b;
    border-radius: 8px;
    animation: skeleton-pulse 1.6s ease-in-out infinite;
}

/* Scan line animation */
@keyframes scan {
    0%   { transform: translateY(-100%); }
    100% { transform: translateY(400%); }
}
.scan-line {
    position: absolute;
    left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,102,0,0.3), transparent);
    animation: scan 4s linear infinite;
    pointer-events: none;
}

/* Refresh button spin */
@keyframes spin-once {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
.spin-once { animation: spin-once 0.5s ease-in-out; }

/* Live badge */
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 700;
    color: #4ade80;
    background: rgba(74,222,128,0.08);
    border: 1px solid rgba(74,222,128,0.2);
    padding: 3px 10px;
    border-radius: 20px;
}
.live-badge .pulse-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 6px rgba(74,222,128,0.7);
    animation: pulse-dot 2s ease-in-out infinite;
}
@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(0.7); }
}
/* ══════════════════════════════════════════════════════════════════
   MAC OS SEGMENTED CONTROL (View Switcher Slider)
   ══════════════════════════════════════════════════════════════════ */
.sliding-pill {
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
}

/* ══════════════════════════════════════════════════════════════════
   🚀 THE GLOBAL JUMP ENGINE (V4 - Deep DOM Scanner)
   يستخدم خاصية :has() لاختراق تعقيدات الـ HTML وصيد الكروت التفاعلية ذكياً
   ══════════════════════════════════════════════════════════════════ */

/* ── 1. تحديد الكروت بذكاء (حتى لو كانت البيانات محملة من السيرفر لاحقاً) ── */

/* أ. كروت الماركت الرئيسية */
div[onclick*="openBroadcastDetails"],

/* ب. كروت المرفقات: أي حاوية (رابط أو ديف) تملك حدود وبداخلها أيقونة ملف */
:is(a, div)[class*="border"]:has(.fa-file-pdf, .fa-file-excel, .fa-file-word, .fa-file-lines, .fa-download),

/* ج. صور الجاليري: أي زر أو حاوية تفاعلية بداخلها صورة، أو الصورة نفسها */
button:has(> img),
:is(a, div)[class*="cursor-pointer"]:has(> img),
img[onclick],

/* د. كلاس الجوكر (تضعه يدوياً لأي كارت جديد مستقبلاً) */
.interactive-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform, box-shadow;
}

/* ── 2. تفعيل القفزة والتوهج البرتقالي عند اللمس ── */
div[onclick*="openBroadcastDetails"]:hover,
:is(a, div)[class*="border"]:has(.fa-file-pdf, .fa-file-excel, .fa-file-word, .fa-file-lines, .fa-download):hover,
button:has(> img):hover,
:is(a, div)[class*="cursor-pointer"]:has(> img):hover,
img[onclick]:hover,
.interactive-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 14px 28px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(255, 102, 0, 0.2) !important;
    border-color: #fed7aa !important; /* إضاءة حواف برتقالية */
    z-index: 10;
}

/* ── 3. تأثير إضافي للأزرار الداخلية ── */
div[onclick*="openBroadcastDetails"]:hover button {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* 🌙 Centralized Dark Mode Engine */
html.dark body { background-color: #0f172a !important; color: #f1f5f9 !important; }
html.dark .bg-white { background-color: #1e293b !important; border-color: #334155 !important; }
html.dark .bg-gray-50, html.dark .bg-gray-100 { background-color: #0f172a !important; }
html.dark .text-gray-900, html.dark .text-gray-800, html.dark .text-gray-700 { color: #f8fafc !important; }
html.dark .text-gray-600, html.dark .text-gray-500 { color: #94a3b8 !important; }
html.dark .border-gray-100, html.dark .border-gray-200 { border-color: #334155 !important; }
html.dark input, html.dark textarea, html.dark select { 
    background-color: #0f172a !important; 
    color: #f8fafc !important; 
    border-color: #334155 !important; 
}
html.dark .shadow-sm, html.dark .shadow-md, html.dark .shadow-lg { 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.5) !important; 
}
/* حماية العناصر البرتقالية الخاصة بالمنصة */
html.dark .bg-itbulks, html.dark .text-itbulks { opacity: 0.95; }