/* assets/css/public.css - رابط کاربری متریال، گرم و فوق‌سبک صفحه رهگیری بار */

:root {
    --bg: #f3f5f9;
    --surface-tint: #eef2f8;
    --card: #ffffff;
    --input-bg: #f8fafd;
    --border: #e3e8f0;
    --text: #18212f;
    --text-muted: #5c6b80;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --primary-soft: rgba(37, 99, 235, 0.10);
    --primary-tonal: #e8f0fe;
    --teal: #0d9488;
    --teal-soft: rgba(13, 148, 136, 0.12);
    --success: #15803d;
    --success-soft: rgba(21, 128, 61, 0.12);
    --warning: #b45309;
    --warning-soft: rgba(217, 119, 6, 0.14);
    --danger: #dc2626;
    --danger-soft: rgba(220, 38, 38, 0.12);
    --elev-1: 0 2px 12px rgba(15, 23, 42, 0.06);
}

html.dark, body.dark {
    --bg: #0c0e14;
    --surface-tint: #131722;
    --card: #151923;
    --input-bg: #1d2230;
    --border: #283042;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --primary: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-soft: rgba(96, 165, 250, 0.15);
    --primary-tonal: rgba(96, 165, 250, 0.18);
    --teal: #2dd4bf;
    --teal-soft: rgba(45, 212, 191, 0.14);
    --success: #4ade80;
    --success-soft: rgba(74, 222, 128, 0.14);
    --warning: #fbbf24;
    --warning-soft: rgba(251, 191, 36, 0.15);
    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.15);
    --elev-1: 0 4px 18px rgba(0, 0, 0, 0.35);
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    direction: rtl;
    font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
    font-size: 14px;
    line-height: 1.65;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

button, input { font-family: inherit; font-size: inherit; }

.pub-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 12px 18px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.pub-header-inner {
    max-width: 780px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.pub-brand {
    font-size: 15.5px;
    font-weight: 800;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 9px;
}

.pub-brand svg { color: var(--primary); }

.pub-actions { display: flex; align-items: center; gap: 10px; }

.pub-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s;
}
.pub-btn-icon:hover { border-color: var(--primary); color: var(--primary); }

.pub-main {
    flex: 1;
    width: 100%;
    max-width: 780px;
    margin: 26px auto;
    padding: 0 16px;
}

.pub-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 22px;
    box-shadow: var(--elev-1);
    margin-bottom: 16px;
}

.pub-input {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 11px;
    border: 1px solid var(--border);
    background: var(--input-bg);
    color: var(--text);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.pub-input:focus {
    background: var(--card);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.pub-btn {
    height: 46px;
    padding: 0 22px;
    border-radius: 11px;
    border: none;
    background: var(--primary);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    transition: all 0.15s;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
}
.pub-btn:hover { background: var(--primary-hover); }

/* ---------------- Tracking Timeline Stepper ---------------- */
.track-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--elev-1);
    margin-bottom: 14px;
}

.track-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding-bottom: 14px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.track-stepper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 16px 0 18px;
    position: relative;
}

.track-step {
    text-align: center;
    padding: 12px 8px;
    border-radius: 12px;
    background: var(--surface-tint);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
}

.track-step.done {
    background: var(--success-soft);
    border-color: rgba(21, 128, 61, 0.25);
    color: var(--success);
}

.track-step.current {
    background: var(--primary-tonal);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 800;
}

.track-step-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin: 0 auto 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
}

.track-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.track-kv {
    background: var(--surface-tint);
    border-radius: 10px;
    padding: 9px 12px;
}

.track-kv-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.track-kv-val {
    font-size: 13.5px;
    font-weight: 700;
}

.track-agency-bar {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--primary-tonal);
    border: 1px solid rgba(37, 99, 235, 0.2);
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
}

.pub-footer {
    text-align: center;
    padding: 16px;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--card);
}

.num { direction: ltr; display: inline-block; font-variant-numeric: tabular-nums; }

/* ---------------- Persian RTL News Ticker Bar (نوار اخبار متحرک فارسی) ---------------- */
.nb-ticker {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 7px 10px 7px 14px;
    margin-bottom: 14px;
    box-shadow: var(--elev-1);
    overflow: hidden;
}

.nb-ticker-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 11px;
    border-radius: 99px;
    background: var(--warning-soft);
    color: var(--warning);
    font-size: 11.5px;
    font-weight: 800;
    flex-shrink: 0;
    white-space: nowrap;
}

.nb-ticker-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--warning);
    animation: nbTickerPulse 1.6s ease-in-out infinite;
}

@keyframes nbTickerPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.4; transform: scale(0.75); }
}

.nb-ticker-viewport {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
    height: 26px;
    line-height: 26px;
    direction: ltr;
    mask-image: linear-gradient(to right, transparent 0%, #000 4%, #000 96%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 4%, #000 96%, transparent 100%);
}

/* در متن فارسی، شروع جمله سمت راست است؛ پس حرکت از چپ به راست باعث می‌شود اول جمله ابتدا وارد کادر شود (دقیقاً مشابه زیرنویس شبکه خبر) */
.nb-ticker-text {
    position: absolute;
    top: 0;
    left: 0;
    display: inline-block;
    white-space: nowrap;
    direction: rtl;
    unicode-bidi: plaintext;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    will-change: left, transform;
    animation: nbTickerRtl var(--ticker-duration, 22s) linear infinite;
}

.nb-ticker:hover .nb-ticker-text {
    animation-play-state: paused;
}

@keyframes nbTickerRtl {
    0% {
        left: 0%;
        transform: translateX(-100%);
    }
    100% {
        left: 100%;
        transform: translateX(0%);
    }
}

/* ---------------- TimeElixir Team Signature ---------------- */
.te-sig {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    margin-top: 8px;
}
.te-sig:hover { color: var(--primary); }
.te-logo-box { display: inline-flex; align-items: center; height: 20px; }
.te-logo { height: 20px; width: auto; max-width: 72px; object-fit: contain; display: block; border-radius: 4px; }
.te-logo-for-dark { display: none; }
html.dark .te-logo-for-light, body.dark .te-logo-for-light { display: none; }
html.dark .te-logo-for-dark, body.dark .te-logo-for-dark { display: block; }
.te-sig-prefix { opacity: 0.78; }
