/* =============================================
   PASHA TV - PREMIUM UI (V10.10 Omega Professional)
   ARCHITECTURE: FULL PANEL + DUAL RESPONSIVE ENGINE
   ============================================= */

/* ۱. بارگذاری فونت اختصاصی از هاست (حیاتی برای اپلیکیشن تلویزیون) */
@font-face {
    font-family: "Vazir";
    src: url("fonts/Vazir-Bold.woff2") format("woff2"),
        url("fonts/Vazirmatn-Bold.ttf") format("truetype");
    font-weight: 900;
    font-style: normal;
}

@font-face {
    font-family: "Vazir";
    src: url("fonts/Vazirmatn-Regular.ttf") format("truetype");
    font-weight: 400;
    font-style: normal;
}

:root {
    /* اجبار مرورگر به استفاده فقط از تم روشن (حل باگ دارک مود) */
    color-scheme: light !important;

    --primary: #FF5A1F;
    --primary-gradient: linear-gradient(135deg, #FF5A1F 0%, #FF8A5C 100%);
    --secondary: #00A699;
    --bg: #F0F2F5;
    --card-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 16px;
    --shadow-premium: 0 20px 50px rgba(0, 0, 0, 0.05);
    --glass: rgba(255, 255, 255, 0.7);
}

/* حذف ترنزیشن برای سوئیچ آنی و اعمال فونت یکپارچه */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.15s ease !important; /* فعال‌سازی ترنزیشن بسیار سریع برای فیدبک کلیک */
    font-family: "Vazir", system-ui, Tahoma, sans-serif !important;
    /* جلوگیری از فیلترهای معکوس‌کننده رنگ سیستم‌عامل */
    forced-color-adjust: none !important;
}

body {
    margin: 0;
    font-family: "Vazir", system-ui;
    background-color: var(--bg) !important;
    color: var(--text-main) !important;
    direction: rtl;
    overflow-x: hidden;
    /* اصلاح شده: پدینگ کمتر چون نوار موسیقی دیگر شناور نیست */
    padding-bottom: 40px;
}

/* =============================================
   PREMIUM BUTTONS UI (اصلاح شده برای فیدبک ورود)
   ============================================= */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 24px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    border: none;
    font-family: inherit;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: relative;
}

/* فیدبک بصری هنگام کلیک: دکمه کوچک‌تر و کمی تیره‌تر می‌شود */
.btn:active {
    transform: scale(0.95);
    filter: brightness(0.85); /* پررنگ‌تر شدن رنگ در لحظه کلیک */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: var(--primary-gradient) !important;
    color: #fff !important;
    box-shadow: 0 8px 20px rgba(255, 90, 31, 0.25) !important;
}

.btn-primary:hover {
    transform: translateY(-3px);
    filter: brightness(1.05);
}

#logout-btn {
    background: #fff;
    border: 1.5px solid #fee2e2;
    color: #e11d48;
    padding: 8px 18px;
    font-size: 0.85rem;
}

#logout-btn:hover {
    background: #e11d48;
    color: #fff;
    border-color: #e11d48;
    box-shadow: 0 8px 20px rgba(225, 29, 72, 0.2);
}

#slideshow-toggle-btn {
    background: #1e293b;
    color: #fff;
    width: 90% !important;
    margin: 10px auto;
    font-size: 1.05rem;
    box-shadow: 0 10px 25px rgba(30, 41, 59, 0.2);
}

#slideshow-toggle-btn:hover {
    background: #0f172a;
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(30, 41, 59, 0.3);
}

.gallery-remove-btn {
    background: #fff1f2;
    color: #ef4444;
    border: 1px solid #fecaca;
    padding: 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.8rem;
    width: 100%;
}

.gallery-remove-btn:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* =============================================
   HEADER & LAYOUT
   ============================================= */
.header {
    padding: 15px 30px;
    background: var(--glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

/* لوگوی هدر پنل */
.logo {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    /* اصلاح باگ لوگو: استفاده از contain برای فیت شدن کامل */
    object-fit: contain !important;
    background: transparent;
}

/* لوگوی بزرگ صفحه ورود (حل باگ کشیدگی لوگوی لاگین) */
.login-logo {
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
    display: block;
    object-fit: contain !important;
    /* حفظ تناسب دقیق طول و عرض */
    background: transparent;
}

.header-title {
    font-size: 1.2rem;
    font-weight: 900;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.main-layout {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 25px;
    padding: 20px;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--card-bg) !important;
    border-radius: var(--radius-lg);
    padding: 25px;
    box-shadow: var(--shadow-premium);
    border: 1px solid rgba(255, 255, 255, 1);
}

/* =============================================
   SLIDESHOW SCREEN (ANTI-FLICKER & SMART CONTAINER)
   ============================================= */
.slideshow-screen {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000 !important;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    /* حیاتی: تعریف کادر به عنوان کانتینر برای ریسپانسیو شدن فونت‌ها در پنل مدیریت */
    container-type: inline-size;
}

.card-slideshow .slideshow-screen {
    background-image: none !important;
    border: 1px solid #e2e8f0;
}

.slideshow-screen img,
.slideshow-screen video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
    z-index: 50;
}

.slideshow-footer-controls {
    display: flex;
    justify-content: center;
    padding: 15px 0;
    background: #f8fafc;
    border-bottom-left-radius: var(--radius-md);
    border-bottom-right-radius: var(--radius-md);
    border: 1px solid #e2e8f0;
    border-top: none;
    margin-top: -2px;
}

/* =============================================
   SILVER OVERLAY (DYNAMIC LAYER) - V9.9 DUAL ENGINE
   ============================================= */
.silver-slide {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: none;
    pointer-events: none;
    background-image: url("silver-tpl.png") !important;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.silver-slide:not(.hidden) {
    display: flex;
}

.silver-slide.hidden {
    display: none !important;
}

.silver-layer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.silver-val {
    position: absolute;
    font-weight: 900;
    color: #111 !important;
    text-align: center;
    /* پیش‌فرض پنل مدیریت: واحد cqi باعث می‌شود قیمت‌ها در کادر کوچک موبایل متناسب شوند */
    font-size: clamp(10px, 5cqi, 200px);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    direction: ltr !important;
    white-space: nowrap;
    width: 35%;
}

/* اصلاح جداکننده (Separator): هماهنگ برای تمام قیمت‌ها و انس */
.big-sep {
    font-family: 'Trebuchet MS', sans-serif !important;
    font-size: 4.5cqi;
    font-weight: bold;
    vertical-align: baseline;
    line-height: 1;
    margin: 0 1px;
    display: inline-block;
    color: #111 !important;
}

/* حل نهایی باگ تصویر ۱ و ۳: اصلاح ابعاد جداکننده در بخش تخفیف پنل (Price Hint) */
.calc-hint .big-sep {
    font-size: 1.1em !important;
    font-weight: 900 !important;
    margin: 0 !important;
    color: inherit !important;
    font-family: "Vazir", sans-serif !important;
    vertical-align: middle;
}

/* تنظیم موقعیت میلی‌متری قیمت‌ها روی بنر */
.silver-gram-sell {
    top: 43%;
    right: 24.5%;
}

.silver-gram-buy {
    top: 43%;
    left: 8%;
}

.silver-bar-sell {
    top: 59%;
    right: 24.5%;
}

.silver-bar-buy {
    top: 59%;
    left: 8.3%;
}

/* بخش انس جهانی اختصاصی */
.silver-ounce {
    top: 74%;
    right: 23.5%;
    width: 20%;
    font-size: clamp(8px, 3.7cqi, 160px);
    direction: ltr !important;
}

/* اصلاح علامت دلار: ظریف و نازک */
.dollar-sign {
    font-family: Arial, sans-serif !important;
    font-weight: 500 !important;
    /* دلار نازک طبق خواسته شما */
    margin-left: 2px;
    font-size: 0.75em;
    color: #111 !important;
}

/* ساعت و تاریخ */
.silver-time {
    position: absolute;
    top: 73.6%;
    right: 42.5%;
    width: 15%;
    text-align: center;
    font-weight: 900;
    color: #111 !important;
    font-size: clamp(8px, 4.1cqi, 110px);
    direction: ltr !important;
}

.silver-date {
    position: absolute;
    top: 73.6%;
    right: 61%;
    width: 26%;
    text-align: center;
    font-weight: 900;
    color: #111 !important;
    font-size: clamp(8px, 4cqi, 110px);
    letter-spacing: -1px;
    direction: ltr !important;
}

/* =============================================
   MUSIC BAR (ایستا در انتهای صفحه)
   ============================================= */
.music-bar {
    position: relative;
    /* از حالت fixed خارج شد */
    margin: 40px auto 20px;
    /* ایجاد فاصله از محتوای بالا و پایین */
    width: 95%;
    max-width: 1600px;
    background: rgba(30, 41, 59, 0.95) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 15px 25px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    gap: 15px;
    color: #fff !important;
}

.playlist-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.music-add-btn,
.btn-music-add {
    background: var(--primary-gradient) !important;
    color: white !important;
    padding: 10px 18px !important;
    border-radius: 12px !important;
    font-weight: 900 !important;
    font-size: 0.85rem !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    box-shadow: 0 4px 15px rgba(255, 90, 31, 0.3) !important;
    display: inline-flex !important;
    align-items: center !important;
    cursor: pointer !important;
    gap: 8px;
}

.music-playlist {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.music-chip {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    color: #e2e8f0 !important;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 10px;
}

.music-chip.current {
    background: rgba(255, 90, 31, 0.15) !important;
    border-color: var(--primary);
    color: white !important;
}

.music-chip button {
    background: #ef4444 !important;
    color: white !important;
    border: none !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: bold !important;
    line-height: 1 !important;
}

/* =============================================
   FORMS, INPUTS & GALLERY GRID
   ============================================= */
.form-row {
    margin-bottom: 15px;
}

.form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--text-main) !important;
}

.form-row input:not([type="checkbox"]),
.gallery-controls input[type="number"] {
    width: 100%;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    border: 2px solid #F1F5F9;
    background: #F8FAFC !important;
    color: var(--text-main) !important;
    font-size: 1.1rem;
    font-weight: 700;
    outline: none;
}

select {
    width: 100%;
    padding: 10px 15px;
    border-radius: 12px;
    border: 2px solid #F1F5F9;
    background: #F8FAFC !important;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main) !important;
    cursor: pointer;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23FF5A1F' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 10px center;
    background-size: 1em;
}

.calc-hint {
    font-size: 0.82rem;
    color: var(--primary);
    margin-top: 6px;
    display: block;
    font-weight: 700;
}

.status-btn {
    width: 100%;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    padding: 15px;
    border: 2px solid transparent;
    color: white;
    font-weight: 800;
}

.status-btn.active {
    background: #10b981;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.status-btn.inactive {
    background: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 450px;
    overflow-y: auto;
    padding: 12px;
    background: #f8fafc !important;
    border-radius: 18px;
    border: 1px solid #e2e8f0;
}

.gallery-item {
    background: #fff !important;
    border-radius: 15px;
    padding: 10px;
    border: 1px solid #E2E8F0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
}

.gallery-thumb {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 10px;
    object-fit: cover;
    background: #000;
    margin-bottom: 8px;
    overflow: hidden;
}

.gallery-thumb img,
.gallery-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
}

.gallery-controls label {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted) !important;
    margin-bottom: -3px;
}

.gallery-controls input[type="number"] {
    padding: 8px 12px;
    font-size: 0.95rem;
    border: 2px solid #FF5A1F;
    border-radius: 10px;
    color: var(--primary) !important;
    text-align: center;
    background: #fff !important;
    font-weight: 800;
}
/* =============================================
   TV VIEW OVERRIDES (PURE SLIDESHOW - VW BASED)
   ============================================= */
[data-view="tv"] body {
    padding: 0;
    background: #000 !important;
    overflow: hidden;
}

/* حذف تمامی حاشیه‌ها و المان‌های اضافی در تلویزیون */
[data-view="tv"] .header,
[data-view="tv"] .card-prizes,
[data-view="tv"] .music-bar,
[data-view="tv"] .slideshow-footer-controls {
    display: none !important;
}

[data-view="tv"] .main-layout,
[data-view="tv"] .card-slideshow {
    padding: 0;
    margin: 0;
    max-width: 100vw;
    width: 100vw;
    height: 100vh;
    border: none;
    border-radius: 0;
}

/* حیاتی: تعریف کادر برای محاسبه ابعاد فونت‌ها */
[data-view="tv"] .slideshow-screen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    background-color: #000 !important;
    container-type: inline-size;
    /* فعال‌سازی انجین محاسباتی */
}

/* ۱. اصلاح ابعاد قیمت‌ها (استفاده از ۴.۸ به جای ۴۸ برای لود درست) */
[data-view="tv"] .silver-val {
    font-size: clamp(40px, 4.8vw, 350px) !important;
    /* ۱۰ برابر بزرگتر از حالت فعلی شما */
    color: #111 !important;
    font-weight: 900;
}

[data-view="tv"] .silver-ounce {
    font-size: clamp(30px, 3.5vw, 250px) !important;
    color: #111 !important;
}

[data-view="tv"] .silver-time,
[data-view="tv"] .silver-date {
    font-size: clamp(25px, 3.8vw, 200px) !important;
    color: #111 !important;
}

/* ۲. تنظیم دقیق مکان قیمت‌ها روی بنر در حالت تمام‌صفحه */
[data-view="tv"] .silver-gram-sell {
    top: 42.5%;
    right: 24.5%;
}

[data-view="tv"] .silver-gram-buy {
    top: 42.5%;
    left: 8.5%;
}

[data-view="tv"] .silver-bar-sell {
    top: 58.5%;
    right: 24.5%;
}

[data-view="tv"] .silver-bar-buy {
    top: 58.5%;
    left: 8.8%;
}

/* انس جهانی، ساعت و تاریخ (اصلاح شده برای تلویزیون) */
[data-view="tv"] .silver-ounce {
    top: 75.7%;
    right: 23.5%;
}

[data-view="tv"] .silver-time {
    top: 73.6%;
    right: 42.5%;
}

[data-view="tv"] .silver-date {
    top: 73.6%;
    right: 61%;
}/* =============================================
   UPLOAD PROGRESS & QUEUE UI
   ============================================= */
.upload-manager-floater {
    position: fixed;
    bottom: 20px;
    /* تنظیم مختصات جدید برای تداخل نداشتن با منوی جدید */
    right: 20px;
    width: 300px;
    background: var(--card-bg) !important;
    border-radius: var(--radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    padding: 15px;
    display: none;
    border: 1px solid var(--primary);
    color: var(--text-main) !important;
}

.upload-manager-floater.active {
    display: block;
}

.upload-item-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.progress-container {
    width: 100%;
    height: 10px;
    background: #f1f5f9 !important;
    border-radius: 5px;
    overflow: hidden;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: var(--primary-gradient);
    transition: width 0.2s ease;
}

.queue-badge {
    background: var(--primary);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.7rem;
}