/* ==========================================================================
   طراحی اختصاصی تلویزیون اقتصادی موج بازار (MojBazar TV Monitor)
   FILE: assets/css/tv-style.css
   ========================================================================== */

:root {
    --tv-bg: #0b0f19;
    --tv-card-bg: #151c2c;
    --tv-card-border: #232d42;
    --tv-text-bright: #ffffff;
    --tv-text-muted: #94a3b8;
    --tv-accent-cyan: #00f2fe;
    --tv-green: #10b981;
    --tv-red: #ef4444;
    --tv-gold: #fbbf24;
}

html, body.mojbazar-tv-body {
    margin: 0;
    padding: 0;
    width: 100vw;
    height: 100vh;
    background-color: var(--tv-bg);
    color: var(--tv-text-bright);
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif !important;
    overflow: hidden;
    direction: rtl;
}

.tv-dashboard-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    padding: 15px 20px;
    box-sizing: border-box;
    justify-content: space-between;
}

/* --------------------------------------------------------------------------
   ۱. هدر تلویزیون و ساعت فارسی
   -------------------------------------------------------------------------- */
.tv-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: var(--tv-card-bg);
    border: 1px solid var(--tv-card-border);
    padding: 12px 25px;
    border-radius: 12px;
    height: 75px;
}

.tv-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.tv-logo {
    height: 48px;
    width: auto;
    object-fit: contain;
}

.tv-live-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #f87171;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: var(--tv-red);
    border-radius: 50%;
    animation: tvPulse 1.5s infinite;
}

@keyframes tvPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.tv-clock-box {
    text-align: center;
}

/* اصلاح فونت ساعت به وزیرمتن کاملاً فارسی */
.tv-time {
    font-size: 2.2rem;
    font-weight: 900;
    color: var(--tv-accent-cyan);
    line-height: 1;
    font-family: 'Vazirmatn', sans-serif !important;
    direction: ltr;
    display: inline-block;
    letter-spacing: 1px;
}

.tv-date {
    font-size: 0.85rem;
    color: var(--tv-text-muted);
    margin-top: 4px;
    font-family: 'Vazirmatn', sans-serif;
}

.btn-fullscreen {
    background: #1e293b;
    border: 1px solid var(--tv-card-border);
    color: #ffffff;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s;
}

.btn-fullscreen:hover {
    background: #334155;
}

/* --------------------------------------------------------------------------
   ۲. چیدمان شبکه اصلی (Grid)
   -------------------------------------------------------------------------- */
.tv-main-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
    flex: 1;
    margin: 15px 0;
    min-height: 0;
}

.tv-news-column, .tv-prices-column {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.tv-card-header {
    margin-bottom: 12px;
}

.tv-card-header h2 {
    font-size: 1.1rem;
    color: var(--tv-text-bright);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
}

.tv-card-header h2 i {
    color: var(--tv-accent-cyan);
}

/* --------------------------------------------------------------------------
   ۳. اسلایدر اخبار
   -------------------------------------------------------------------------- */
.tv-slider-container {
    position: relative;
    flex: 1;
    background-color: var(--tv-card-bg);
    border: 1px solid var(--tv-card-border);
    border-radius: 12px;
    overflow: hidden;
}

.tv-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease-in-out, visibility 0.8s;
    display: flex;
    flex-direction: column;
}

.tv-slide.active {
    opacity: 1;
    visibility: visible;
}

.tv-slide-image {
    position: relative;
    width: 100%;
    height: 100%;
}

.tv-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tv-slide-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(11, 15, 25, 0.95) 0%, rgba(11, 15, 25, 0.3) 60%, transparent 100%);
}

.tv-slide-caption {
    position: absolute;
    bottom: 0;
    right: 0;
    left: 0;
    padding: 30px;
    z-index: 2;
}

.tv-slide-cat a {
    background-color: #a00501;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-decoration: none;
}

.tv-slide-title {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffffff;
    margin: 12px 0 8px 0;
    line-height: 1.4;
}

.tv-slide-excerpt {
    font-size: 0.95rem;
    color: #cbd5e1;
    margin: 0;
    line-height: 1.6;
}

.tv-slider-dots {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.tv-slider-dots .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
    cursor: pointer;
}

.tv-slider-dots .dot.active {
    background-color: var(--tv-accent-cyan);
    transform: scale(1.3);
}

/* --------------------------------------------------------------------------
   ۴. کارت‌های قیمت زنده و انیمیشن ایجکس
   -------------------------------------------------------------------------- */
.tv-prices-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    justify-content: space-between;
}

.tv-price-card {
    background-color: var(--tv-card-bg);
    border: 1px solid var(--tv-card-border);
    border-radius: 12px;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.2s, border-color 0.2s, background-color 0.4s;
}

/* انیمیشن ایجکس هنگام تغییر قیمت */
.tv-price-card.price-flash {
    background-color: rgba(0, 242, 254, 0.2) !important;
    border-color: var(--tv-accent-cyan) !important;
}

.tv-price-card:hover {
    border-color: #3b82f6;
    transform: translateX(-4px);
}

.tv-price-card .card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.tv-price-card .icon {
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tv-price-card.gold .icon { background: rgba(251, 191, 36, 0.15); color: var(--tv-gold); }
.tv-price-card.coin .icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tv-price-card.usd .icon  { background: rgba(16, 185, 129, 0.15); color: var(--tv-green); }
.tv-price-card.usdt .icon { background: rgba(6, 182, 212, 0.15); color: #06b6d4; }
.tv-price-card.btc .icon  { background: rgba(249, 115, 22, 0.15); color: #f97316; }

.tv-price-card .title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--tv-text-bright);
}

.tv-price-card .badge {
    font-size: 0.8rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    direction: ltr;
}

.tv-price-card .badge.up { background: rgba(16, 185, 129, 0.2); color: #34d399; }
.tv-price-card .badge.down { background: rgba(239, 68, 68, 0.2); color: #f87171; }

.tv-price-card .card-body {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.tv-price-card .amount {
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffffff;
    font-family: 'Vazirmatn', sans-serif !important;
}

.tv-price-card .unit {
    font-size: 0.85rem;
    color: var(--tv-text-muted);
}

/* --------------------------------------------------------------------------
   ۵. زیرنویس متحرک (Ticker)
   -------------------------------------------------------------------------- */
.tv-footer-ticker {
    display: flex;
    align-items: center;
    background-color: #1e293b;
    border: 1px solid var(--tv-card-border);
    border-radius: 10px;
    height: 50px;
    overflow: hidden;
}

.ticker-label {
    background-color: #a00501;
    color: #ffffff;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 900;
    font-size: 0.95rem;
    flex-shrink: 0;
    z-index: 2;
}

.ticker-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    white-space: nowrap;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: tvTicker 35s linear infinite;
}

.ticker-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 40px;
    font-size: 0.95rem;
    color: #e2e8f0;
}

.ticker-item i {
    color: var(--tv-accent-cyan);
    font-size: 0.7rem;
}

.ticker-item a {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}

@keyframes tvTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(100%); }
}

/* --------------------------------------------------------------------------
   ۶. اسکرین‌سیور هوشمند (Ambient Screensaver)
   -------------------------------------------------------------------------- */
.tv-screensaver {
    position: fixed;
    inset: 0;
    background-color: #05070d;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.8s ease, visibility 0.8s;
}

.tv-screensaver.active {
    opacity: 1;
    visibility: visible;
}

.screensaver-content {
    text-align: center;
    animation: floatAmbient 12s ease-in-out infinite alternate;
}

@keyframes floatAmbient {
    0% { transform: translate(0, 0); }
    50% { transform: translate(-15px, 15px); }
    100% { transform: translate(15px, -10px); }
}

.screensaver-logo {
    height: 70px;
    width: auto;
    margin-bottom: 25px;
    filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.3));
}

.screensaver-clock {
    font-size: 5rem;
    font-weight: 900;
    color: var(--tv-accent-cyan);
    font-family: 'Vazirmatn', sans-serif !important;
    text-shadow: 0 0 30px rgba(0, 242, 254, 0.4);
    line-height: 1;
    margin-bottom: 10px;
    direction: ltr;
}

.screensaver-date {
    font-size: 1.4rem;
    color: #cbd5e1;
    margin-bottom: 30px;
}

.screensaver-status {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.95rem;
    color: var(--tv-text-muted);
}

.screensaver-hint {
    margin-top: 40px;
    font-size: 0.8rem;
    color: #475569;
}

/* --------------------------------------------------------------------------
   ۷. ریسپانسو مانیتورها
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .tv-main-grid { grid-template-columns: 1fr; }
    body.mojbazar-tv-body { overflow: auto; }
    .tv-dashboard-wrapper { height: auto; }
    .tv-slide-title { font-size: 1.2rem; }
}