/*
Theme Name: Nerkhchi Child
Template: hello-elementor
Version: 2.0.0 (Final Vertical Layout)
*/

/* =========================================
   1. تنظیمات عمومی و بادی
   ========================================= */
body {
    background-color: #f0f4f3;
    color: #f1f5f9;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    padding-bottom: 80px; /* فضای خالی برای منوی موبایل */
    -webkit-font-smoothing: antialiased;
}

/* =========================================
   2. هدر و اطلاعات
   ========================================= */
header h1 { 
    font-weight: 850; 
    letter-spacing: -1px; 
    margin:0; 
    color: #38bdf8;
}

.header-info {
    text-align: center;
    padding: 20px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    width: 100%;
}

#live-clock-container {
    font-size: 1.1rem; 
    margin-top: 10px; 
    color: #cbd5e1; 
}
#time-part {
    font-weight: bold; 
    color: #f1f5f9;
}

/* =========================================
   3. ساختار گرید و کارت‌ها
   ========================================= */
.price-grid {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}
.price-grid.active { display: grid; }

/* استایل کارت با ساختار دو ردیفه (Force Column) */
.price-card {
    background: #fff;
    border-radius: 16px;
    padding: 10px 15px; /* کمی پدینگ کمتر برای جایگیری بهتر */
    border: 1px solid #e8f1ff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px -1px rgba(0, 0, 0, 0.1);
    
    /* تنظیمات فلکس برای دو ردیف */
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between;
    align-items: center;
    min-height: 100px;
}

.price-card:hover {
    transform: translateY(-5px);
    border-color: #38bdf8;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* --- ردیف بالا: آیکون، نام و قیمت --- */
.card-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 5px;
    flex: 1;
}

/* --- ردیف پایین: نمودار --- */
.card-bottom-row {
    width: 100%;
    height: 35px; /* ارتفاع ثابت نمودار */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    position: relative;
}

/* =========================================
   4. جزئیات داخلی کارت
   ========================================= */
.item-info { display: flex; align-items: center; gap: 4px; }
.item-icon { 
    width: 42px; height: 42px; border-radius: 50%; 
    object-fit: contain; background: rgba(255,255,255,0.05); padding: 2px;
}

.item-name {
    font-size: 1rem;
    font-weight: 400; 
    color: #2c3235; 
    margin-left: 10px;
}

.price-container { text-align: left; }

.item-price { 
    font-size: 1.3rem; 
    color: #2c3235; 
    letter-spacing: -0.5px;
    font-weight: 800; 
    font-feature-settings: "ss01"; 
    
    /* تنظیمات انیمیشن */
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 8px;
    transition: color 0.3s ease;
}

.currency-unit {
    font-size: 0.75rem;
    font-weight: 200;
    color: #2c3235;
}

.price-arrow {
    font-size: 0.8rem;
    margin-right: 5px;
    display: inline-block;
    width: 10px;
}

/* بنر تبلیغاتی */
.banner-ad { 
    width: 100%; height: 90px; background: #020617; margin: 15px 0; 
    display: flex; align-items: center; justify-content: center; 
    color: #475569; border: 1px dashed #334155; border-radius: 12px;
}

/* =========================================
   5. منوی موبایل و ریسپانسیو
   ========================================= */
.mobile-nav {
    position: fixed; 
    bottom: 0; 
    left: 0; right: 0; 
    width: 100%; 
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px); 
    display: flex; 
    justify-content: space-around;
    padding: 12px 0; 
    border-top: 1px solid #334155; 
    z-index: 1000;
}
.nav-item {
    color: #64748b; 
    cursor: pointer; 
    text-align: center; 
    padding: 5px 10px;
    transition: all 0.3s; 
    font-weight: 400;
}
.nav-item.active { 
    color: #38bdf8; 
    font-weight: 700; 
}

@media (min-width: 768px) {
    body {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        padding-bottom: 0;
    }
    .header-info { order: 1; }
    .mobile-nav {
        order: 2;
        position: sticky; 
        top: 0; bottom: auto; 
        border-top: none;
        border-bottom: 1px solid #334155; 
        margin-bottom: 20px;
        background: #1e293b; 
        justify-content: center; 
        gap: 30px;
        padding: 15px 0;
    }
    .banner-ad, .price-grid, .container, footer, .site-footer { order: 3; }
}

@media screen and (max-width: 480px) {
    .price-grid {
        grid-template-columns: repeat(auto-fill, minmax(100%, 1fr));
    }
}

/* =========================================
   6. رنگ‌ها و انیمیشن‌ها (Nerkhchi Pro)
   ========================================= */
:root {
    --up-color: #10b981;    /* سبز */
    --up-bg: rgba(16, 185, 129, 0.1);
    --down-color: #ef4444;  /* قرمز */
    --down-bg: rgba(239, 68, 68, 0.1);
    --neutral-color: #334155;
    --tooltip-bg: rgba(30, 41, 59, 0.95);
}

/* کلاس‌های فعال شده با JS */
.card-pulse-up { animation: liquidGlowUp 0.8s cubic-bezier(0.4, 0, 0.2, 1); border-color: var(--up-color) !important; }
.card-pulse-down { animation: liquidGlowDown 0.8s cubic-bezier(0.4, 0, 0.2, 1); border-color: var(--down-color) !important; }

.text-slide-up { animation: slideBlurUp 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards; color: var(--up-color) !important; background: var(--up-bg); }
.text-slide-down { animation: slideBlurDown 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards; color: var(--down-color) !important; background: var(--down-bg); }

/* Keyframes */
@keyframes liquidGlowUp {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 20px 15px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
@keyframes liquidGlowDown {
    0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { box-shadow: 0 0 20px 15px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@keyframes slideBlurUp {
    0% { transform: translateY(100%); opacity: 0; filter: blur(8px); }
    100% { transform: translateY(0); opacity: 1; filter: blur(0); }
}
@keyframes slideBlurDown {
    0% { transform: translateY(-100%); opacity: 0; filter: blur(8px); }
    100% { transform: translateY(0); opacity: 1; filter: blur(0); }
}

/* حذف استایل‌های قدیمی */
.price-change-up, .price-change-down { animation: none !important; }

/* =========================================
   7. استایل‌های نمودار (Sparkline)
   ========================================= */
.chart-placeholder {
    width: 120px; /* عرض ثابت نمودار */
    height: 100%;
}

.sparkline-wrapper {
    width: 100% !important;
    height: 100% !important;
    position: relative;
    overflow: visible; 
    cursor: crosshair;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
}

.sparkline-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: block;
}

.spark-path {
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: stroke 0.3s ease;
    pointer-events: none;
}

.spark-fill {
    stroke: none;
    opacity: 0.15;
    transition: fill 0.3s ease;
    pointer-events: none;
}

.spark-dot {
    transition: fill 0.3s ease;
    pointer-events: none;
}

/* هاور و اینتراکشن */
.spark-hover-bar {
    fill: transparent;
    transition: fill 0.1s;
    cursor: crosshair;
    pointer-events: all;
}
.spark-hover-bar:hover { fill: rgba(0,0,0,0.03); }

.spark-active-dot {
    fill: #fff;
    stroke-width: 2;
    r: 4;
    opacity: 0;
    transition: opacity 0.1s;
    pointer-events: none;
    z-index: 10;
}

/* رنگ‌بندی نمودار */
.trend-up .spark-path { stroke: var(--up-color); }
.trend-up .spark-fill { fill: var(--up-color); }
.trend-up .spark-dot  { fill: var(--up-color); }
.trend-up .spark-active-dot { stroke: var(--up-color); }

.trend-down .spark-path { stroke: var(--down-color); }
.trend-down .spark-fill { fill: var(--down-color); }
.trend-down .spark-dot  { fill: var(--down-color); }
.trend-down .spark-active-dot { stroke: var(--down-color); }

.trend-neutral .spark-path { stroke: var(--neutral-color); }
.trend-neutral .spark-fill { fill: var(--neutral-color); }
.trend-neutral .spark-dot  { fill: var(--neutral-color); }
.trend-neutral .spark-active-dot { stroke: var(--neutral-color); }

.text-up { color: var(--up-color) !important; }
.text-down { color: var(--down-color) !important; }
.text-neutral { color: var(--neutral-color) !important; }

/* =========================================
   8. استایل تولتیپ (Tooltip)
   ========================================= */
.chart-tooltip {
    position: absolute;
    background: var(--tooltip-bg);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    pointer-events: none;
    opacity: 0;
    transform: translate(-50%, -150%);
    white-space: nowrap;
    transition: opacity 0.2s;
    z-index: 20;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
}
.chart-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -4px;
    border-width: 4px;
    border-style: solid;
    border-color: var(--tooltip-bg) transparent transparent transparent;
}

/* =========================================
   7. استایل‌های اصلاح شده کارت‌ها (ارز، طلا، سکه)
   ========================================= */

/* 1. تنظیمات حیاتی برای نگه داشتن واترمارک داخل کارت */
.price-card {
    position: relative !important; /* این خط واترمارک را داخل کارت حبس می‌کند */
    overflow: hidden !important;   /* این خط از بیرون زدن واترمارک جلوگیری می‌کند */
    z-index: 1; /* سطح پایین برای کارت */
    isolation: isolate; /* ایجاد محیط ایزوله برای لایه‌ها */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* 2. تنظیمات واترمارک (تصویر پس‌زمینه) */
.card-watermark {
    position: absolute;
    right: -10px; /* کمی به سمت راست متمایل شود */
    bottom: -10px; /* از پایین تراز شود */
    top: auto; /* تداخل با بالا نداشته باشد */
    width: 80px; /* سایز بزرگتر و مشخص */
    height: 80px;
    z-index: 0; /* زیر تمام نوشته‌ها */
    pointer-events: none; /* تاثیری روی کلیک موس نداشته باشد */
    opacity: 0.15; /* شفافیت */
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-watermark svg {
    width: 100%;
    height: 100%;
    fill: none; /* جلوگیری از پر شدن ناخواسته */
}

/* 3. اطمینان از اینکه متن‌ها و نمودار روی واترمارک باشند */
.price-card .card-top-row,
.price-card .card-bottom-row {
    position: relative;
    z-index: 2; /* بالاتر از واترمارک */
    background: transparent; /* جلوگیری از پوشاندن واترمارک */
}

/* -----------------------------------------
   A. استایل اسکناس (برای ارزها) - Currency
   ----------------------------------------- */
.price-card.currency-bill-style {
    background-color: #fdfbf7;
    background-image: repeating-linear-gradient(135deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 2px, transparent 2px, transparent 4px);
    border: 1px solid rgba(0,0,0,0.05) !important;
    border-radius: 12px;
}
.currency-bill-style .monument-mark {
    color: #475569;
    transform: rotate(-15deg); /* چرخش هنری */
    right: 5px;
    bottom: 5px;
}

/* -----------------------------------------
   B. استایل شمش (برای طلا) - Gold
   ----------------------------------------- */
.price-card.gold-ingot-style {
    background: linear-gradient(135deg, #fffcf2 0%, #fff7e0 100%);
    border: 1px solid rgba(234, 179, 8, 0.15) !important;
    border-radius: 16px;
}
/* بافت فلزی روی کارت طلا */
.price-card.gold-ingot-style::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background-image: repeating-linear-gradient(90deg, transparent 0, transparent 2px, rgba(234, 179, 8, 0.03) 2px, rgba(234, 179, 8, 0.03) 4px);
    z-index: 0; pointer-events: none;
}
.gold-ingot-style .gold-mark {
    color: #d97706;
    opacity: 0.12;
    transform: scale(1.2);
    right: 0;
    bottom: 0;
}

/* -----------------------------------------
   C. استایل ضرابخانه (برای سکه) - Coin
   ----------------------------------------- */
.price-card.coin-mint-style {
    background: radial-gradient(circle at 80% 80%, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
    border-radius: 40px 12px 12px 40px; /* لبه گرد سمت راست */
}
.coin-mint-style .coin-mark {
    color: #64748b;
    right: 10px;
    bottom: 5px;
}

/* -----------------------------------------
   اصلاح منوی موبایل (جلوگیری از تداخل)
   ----------------------------------------- */
.mobile-nav {
    z-index: 9999 !important; /* همیشه بالاترین لایه باشد */
    background: rgba(30, 41, 59, 0.98); /* تیرگی بیشتر برای خوانایی */
}

/* اصلاح هاور کارت‌ها */
.price-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.price-card:hover .card-watermark {
    transform: scale(1.1) rotate(5deg); /* حرکت نرم واترمارک هنگام هاور */
    opacity: 0.25;
}


/* =========================================
   7. استایل‌های اختصاصی کارت‌ها (ارز، طلا، سکه)
   ========================================= */

/* تنظیمات مشترک واترمارک‌ها */
.card-watermark {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 65px;
    height: 65px;
    z-index: 0;
    pointer-events: none;
    transition: all 0.5s ease;
}
.card-watermark svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 2px rgba(0,0,0,0.05));
}
/* افکت هاور مشترک */
.price-card:hover .card-watermark {
    transform: translateY(-50%) scale(1.15) rotate(-5deg);
    opacity: 0.3 !important;
}
/* اطمینان از قرارگیری متن روی واترمارک */
.price-card .card-top-row,
.price-card .card-bottom-row {
    position: relative;
    z-index: 2;
}

/* -----------------------------------------
   A. استایل اسکناس (برای ارزها) - Currency
   ----------------------------------------- */
.price-card.currency-bill-style {
    border: none !important;
    background-color: #fdfbf7;
    /* بافت کاغذ اسکناس */
    background-image: 
        repeating-linear-gradient(135deg, rgba(0,0,0,0.02) 0px, rgba(0,0,0,0.02) 2px, transparent 2px, transparent 4px);
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05), inset 0 0 0 1px rgba(0,0,0,0.05);
    overflow: hidden;
    padding: 12px 15px;
}
/* واترمارک ارز */
.monument-mark {
    opacity: 0.12;
    color: #475569;
}
/* خط تزئینی سمت راست */
.price-card.currency-bill-style::after {
    content: ''; position: absolute; top: 10px; bottom: 10px; right: 10px; width: 70px;
    border: 1px dashed rgba(0,0,0,0.1); border-radius: 10px; pointer-events: none;
}


/* -----------------------------------------
   B. استایل شمش سلطنتی (برای طلا) - Gold
   ----------------------------------------- */
.price-card.gold-ingot-style {
    border: none !important;
    /* رنگ زمینه طلایی بسیار ملایم (برای خوانایی متن) */
    background: linear-gradient(135deg, #fffcf2 0%, #fff7e0 100%);
    border-radius: 20px; /* گردتر */
    /* سایه طلایی نرم */
    box-shadow: 
        0 4px 15px rgba(234, 179, 8, 0.1), 
        inset 0 0 0 1px rgba(234, 179, 8, 0.15); /* حاشیه طلایی ظریف */
    overflow: hidden;
    padding: 12px 15px;
    position: relative;
}
/* افکت فلزی برس خورده (Brushed Metal) */
.price-card.gold-ingot-style::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: repeating-linear-gradient(90deg, transparent 0, transparent 2px, rgba(234, 179, 8, 0.03) 2px, rgba(234, 179, 8, 0.03) 4px);
    z-index: 0; pointer-events: none;
}
/* واترمارک طلا */
.gold-mark {
    opacity: 0.15;
    color: #d97706; /* طلایی تیره */
    right: 5px; /* کمی جلوتر */
}
/* متن قیمت در طلا کمی خواناتر شود */
.price-card.gold-ingot-style .item-price {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(234, 179, 8, 0.2);
}


/* -----------------------------------------
   C. استایل ضرب ضرابخانه (برای سکه) - Coin
   ----------------------------------------- */
.price-card.coin-mint-style {
    border: none !important;
    /* زمینه نقره‌ای/پلاتینیوم با مرکز روشن */
    background: radial-gradient(circle at 70% 50%, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 50px 16px 16px 50px; /* سمت راست کاملا گرد (شبیه لبه سکه) */
    box-shadow: 
        0 4px 15px rgba(0,0,0,0.06),
        inset 0 0 0 1px rgba(148, 163, 184, 0.2);
    overflow: hidden;
    padding: 12px 15px;
    padding-right: 20px;
}
/* دایره‌های محیطی (مثل لبه‌های سکه) */
.price-card.coin-mint-style::after {
    content: ''; position: absolute; top: -50%; right: -20%; width: 200px; height: 200px;
    border-radius: 50%;
    border: 20px solid rgba(0,0,0,0.02);
    pointer-events: none;
}
/* واترمارک سکه */
.coin-mark {
    opacity: 0.15;
    color: #64748b; /* خاکستری مایل به آبی */
    right: 15px;
}

/* هاور برای همه کارت‌ها */
.price-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.15) !important;
}

/* اصلاح فونت‌ها برای هماهنگی با طرح جدید */
.item-name {
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #1e293b;
}

