/* ========================================
   قیمت طلا و سکه - نرخ آنلاین
   narkhonline.ir
   ======================================== */

/* ---------- Prevent horizontal scroll on mobile ---------- */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* ---------- متغیرهای پایه ---------- */
:root {
    --primary: #1e4a76;
    --primary-dark: #0f2b3d;
    --primary-light: #3b82f6;
    --secondary: #f59e0b;
    --success: #059669;
    --danger: #dc2626;
    --warning: #f59e0b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-700: #334155;
    --gray-900: #0f172a;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;
    --animation-duration: 0.6s;
    --animation-delay-step: 0.05s;
}

/* ---------- رنگ‌های اختصاصی هر بخش ---------- */
.section-coin    { --accent: #CD7F32; --accent-dark: #8B4513; --accent-light: #FFF3E0; }
.section-bubble  { --accent: #E91E63; --accent-dark: #C2185B; --accent-light: #FCE4EC; }
.section-fund    { --accent: #2E7D32; --accent-dark: #1B5E20; --accent-light: #E8F5E9; }
.section-currency{ --accent: #1565C0; --accent-dark: #0D47A1; --accent-light: #E3F2FD; }
.section-hawala  { --accent: #6A1B9A; --accent-dark: #4A148C; --accent-light: #F3E5F5; }

.gold-card   { --accent: #FFD700; --accent-dark: #B8860B; --accent-light: #FFF8E1; }
.silver-card { --accent: #B0BEC5; --accent-dark: #78909C; --accent-light: #ECEFF1; }

/* ---------- Reset (FIXED: added *) ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ---------- انیمیشن‌های ورود صفحه ---------- */
@keyframes fadeInScale {
    0%   { opacity: 0; transform: scale(0.98); }
    100% { opacity: 1; transform: scale(1); }
}
@keyframes slideInRight {
    0%   { opacity: 0; transform: translateX(30px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideInLeft {
    0%   { opacity: 0; transform: translateX(-30px); }
    100% { opacity: 1; transform: translateX(0); }
}
@keyframes slideInUp {
    0%   { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes glowPulse {
    0%   { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    70%  { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
    100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}
@keyframes shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}
@keyframes priceFlash {
    0%   { background-color: rgba(245, 158, 11, 0); transform: scale(1); }
    50%  { background-color: rgba(245, 158, 11, 0.3); transform: scale(1.02); }
    100% { background-color: rgba(245, 158, 11, 0); transform: scale(1); }
}
@keyframes borderPulse {
    0%   { border-color: var(--accent); opacity: 0.6; }
    100% { border-color: var(--accent-dark); opacity: 1; }
}
@keyframes rotateIcon {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes bounceIn {
    0%   { opacity: 0; transform: scale(0.3); }
    50%  { opacity: 1; transform: scale(1.05); }
    70%  { transform: scale(0.98); }
    100% { transform: scale(1); }
}
@keyframes rippleEffect {
    0%   { transform: scale(0); opacity: 0.5; }
    100% { transform: scale(4); opacity: 0; }
}
@keyframes floatAnimation {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}
@keyframes highlightFade {
    0%   { background-color: rgba(59, 130, 246, 0.2); }
    100% { background-color: transparent; }
}
@keyframes priceChangeUp {
    0%   { background-color: rgba(5, 150, 105, 0); transform: translateY(0); }
    50%  { background-color: rgba(5, 150, 105, 0.3); transform: translateY(-3px); }
    100% { background-color: rgba(5, 150, 105, 0); transform: translateY(0); }
}
@keyframes priceChangeDown {
    0%   { background-color: rgba(220, 38, 38, 0); transform: translateY(0); }
    50%  { background-color: rgba(220, 38, 38, 0.3); transform: translateY(3px); }
    100% { background-color: rgba(220, 38, 38, 0); transform: translateY(0); }
}

/* ---------- پایه صفحه ---------- */
body {
    font-family: 'Vazir', 'Tahoma', 'Segoe UI', system-ui, sans-serif;
    background: linear-gradient(135deg, var(--gray-50) 0%, #eef2ff 100%);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
    direction: rtl;                /* ✅ اضافه شد */
    font-feature-settings: "ss02";
    font-variant-numeric: ordinal;
    animation: fadeInScale var(--animation-duration) ease-out;
}

.container { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- هدر ---------- */
.top-bar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 0;
    position: relative;            /* not sticky → scrolls away */
    box-shadow: var(--shadow-sm);
    animation: slideInRight 0.5s ease-out;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ---------- لوگو ---------- */
.logo-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
    transition: opacity var(--transition-fast);
}
.logo-link:hover { opacity: 0.85; }

.logo-img {
    height: 42px;
    width: auto;
    flex-shrink: 0;
}

.logo-text { display: flex; flex-direction: column; }

.logo-text h1,
.logo h1 {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    transition: all var(--transition-normal);
    animation: slideInLeft 0.5s ease-out;
}
.logo h1 { font-size: 1.8rem; }

.logo h1:hover { transform: scale(1.02); letter-spacing: 0.5px; }

.logo p,
.logo .tagline,
.logo-text .tagline {
    font-size: 0.75rem;
    color: var(--gray-700);
    margin-top: 0.1rem;
    transition: color var(--transition-fast);
}
.logo:hover p { color: var(--primary); }

/* ---------- زمان زنده ---------- */
.live-time {
    font-family: 'Vazir', 'Courier New', monospace;
    font-size: 0.8rem;
    background: #e6f7ff;
    padding: 0.4rem 1rem;
    border-radius: 40px;
    border: 1px solid #bae6fd;
    color: var(--primary-dark);
    font-weight: 500;
    transition: all var(--transition-normal);
    animation: glowPulse 2s infinite;
}
.live-time:hover {
    transform: scale(1.05);
    background: #d4efff;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

/* ---------- ناوبری ---------- */
.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.2rem;
    align-items: center;
}
.main-nav a {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 30px;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.main-nav a.active {
    background: var(--primary-light);
    color: white;
    font-weight: 700;
}
.main-nav a:hover:not(.active) {
    background: var(--primary-light);
    color: white;
}

/* ---------- عنوان بخش‌ها ---------- */
.section-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 2rem 0 1.2rem 0;
    padding-right: 0.8rem;
    border-right: 5px solid var(--primary);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--primary-dark);
    opacity: 0;
    animation: slideInRight 0.5s ease-out forwards;
    transition: all var(--transition-normal);
}
.section-title:hover {
    transform: translateX(-5px);
    border-right-width: 8px;
}
.section-title i {
    color: var(--primary);
    font-size: 1.4rem;
    transition: all var(--transition-normal);
}
.section-title:hover i { transform: rotate(10deg) scale(1.1); }

/* ---------- کارت‌های hero (طلا/نقره) ---------- */
.hero-gold-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
    margin: 1.8rem 0;
}

.gold-card, .silver-card {
    background: linear-gradient(135deg, var(--accent-light), white);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--accent);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
    opacity: 0;
    animation: slideInUp 0.6s ease-out forwards;
    cursor: pointer;
}
.gold-card:nth-child(1) { animation-delay: 0.1s; }
.gold-card:nth-child(2) { animation-delay: 0.2s; }
.silver-card:nth-child(3) { animation-delay: 0.3s; }
.silver-card:nth-child(4) { animation-delay: 0.4s; }

.gold-card::before, .silver-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 4px;
    height: 100%;
    background: var(--accent);
    transition: width 0.3s, background 0.3s;
}
.gold-card::after, .silver-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.gold-card:hover, .silver-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
}
.gold-card:hover::before, .silver-card:hover::before {
    width: 8px;
    background: var(--accent-dark);
}
.gold-card:hover::after, .silver-card:hover::after {
    opacity: 0.2;
    animation: rotateIcon 0.6s ease-out;
}

.gold-name i {
    font-size: 1.8rem;
    color: var(--accent);
    margin-left: 0.5rem;
    transition: all var(--transition-normal);
    display: inline-block;
}
.gold-card:hover .gold-name i,
.silver-card:hover .gold-name i {
    transform: scale(1.2) rotate(5deg);
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}

.gold-price {
    font-size: 1.7rem;
    font-weight: 800;
    display: inline-block;
    margin: 0.6rem 0;
    color: var(--accent-dark);
    letter-spacing: -0.5px;
    transition: all var(--transition-fast);
}
.gold-price:active { transform: scale(0.98); }

.gold-change {
    font-size: 0.85rem;
    font-weight: 500;
    margin-right: 0.5rem;
    display: inline-block;
    transition: all var(--transition-fast);
}

.positive {
    color: var(--success);
    background: #e6f7ec;
    padding: 0.1rem 0.4rem;
    border-radius: 20px;
    display: inline-block;
    transition: all var(--transition-fast);
}
.positive:hover { transform: scale(1.05); background: #d0f0da; }

.negative {
    color: var(--danger);
    background: #fee2e2;
    padding: 0.1rem 0.4rem;
    border-radius: 20px;
    display: inline-block;
    transition: all var(--transition-fast);
}
.negative:hover { transform: scale(1.05); background: #fcd0d0; }

/* ---------- دکمه‌های خرید ---------- */
.buy-btn, .buy-small {
    background: var(--accent, var(--primary));
    color: white;
    border: none;
    padding: 0.4rem 1.2rem;
    border-radius: 40px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.buy-btn::before, .buy-small::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.5s, height 0.5s;
}
.buy-btn:hover::before, .buy-small:hover::before { width: 200px; height: 200px; }

.buy-btn:hover, .buy-small:hover {
    background: var(--accent-dark, var(--primary-dark));
    transform: scale(1.05) translateY(-2px);
    box-shadow: var(--shadow-md);
}
.buy-btn:active, .buy-small:active { transform: scale(0.98); }

/* ---------- جداول ---------- */
.data-table {
    width: 100%;
    background: white;
    border-radius: var(--radius-lg);
    overflow-x: auto;
    border: 1px solid var(--gray-200);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
}
.data-table:hover { box-shadow: var(--shadow-lg); }

.data-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 500px;
}

.data-table th,
.data-table td {
    padding: 1.5rem 1.35rem;
    text-align: right;
    vertical-align: middle;
    border-bottom: 1px solid var(--gray-200);
    font-size: 1.35rem;
    transition: all var(--transition-fast);
}
.data-table tr:last-child td { border-bottom: none; }

.data-table th {
    background: linear-gradient(135deg, #eef4ff 0%, #e2eafc 100%);
    font-weight: 700;
    color: var(--primary-dark);
    font-size: 1.275rem;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--primary-light);
    transition: all var(--transition-normal);
}
.data-table th:hover {
    background: linear-gradient(135deg, #e2ecff 0%, #d4e2f8 100%);
    letter-spacing: 0.3px;
}

.data-table tr {
    transition: all var(--transition-normal);
    background-color: white;
    opacity: 0;
    animation: slideInUp 0.4s ease-out forwards;
}

/* استاگر ردیف‌های جدول */
.data-table tbody tr:nth-child(1)  { animation-delay: 0.05s; }
.data-table tbody tr:nth-child(2)  { animation-delay: 0.1s; }
.data-table tbody tr:nth-child(3)  { animation-delay: 0.15s; }
.data-table tbody tr:nth-child(4)  { animation-delay: 0.2s; }
.data-table tbody tr:nth-child(5)  { animation-delay: 0.25s; }
.data-table tbody tr:nth-child(6)  { animation-delay: 0.3s; }
.data-table tbody tr:nth-child(7)  { animation-delay: 0.35s; }
.data-table tbody tr:nth-child(8)  { animation-delay: 0.4s; }
.data-table tbody tr:nth-child(9)  { animation-delay: 0.45s; }
.data-table tbody tr:nth-child(10) { animation-delay: 0.5s; }

.data-table tr:hover {
    background: linear-gradient(90deg, #f8faff, #ffffff);
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.data-table td:first-child,
.data-table th:first-child { font-weight: 600; }

.data-table td:nth-child(2) {
    font-weight: 700;
    color: var(--primary-dark);
    text-align: right;
    letter-spacing: -0.3px;
    transition: all var(--transition-fast);
}
.data-table tr:hover td:nth-child(2) {
    color: var(--primary);
    transform: translateX(-5px);
}

.data-table td:nth-child(3) { font-size: 1.2rem; transition: all var(--transition-fast); }

.data-table .buy-small {
    padding: 0.45rem 1.5rem;
    font-size: 1.05rem;
    background: var(--accent, var(--primary));
}
.data-table .buy-small:hover {
    background: var(--accent-dark, var(--primary-dark));
    transform: translateY(-2px) scale(1.02);
}

.data-table tbody tr:nth-child(even) { background-color: #fafcff; }
.data-table tbody tr:nth-child(odd)  { background-color: #ffffff; }

.price-flash { animation: priceFlash 0.4s ease-out; }

/* ---------- کارت‌های حباب ---------- */
.bubble-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.bubble-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 1.2rem;
    border-right: 5px solid var(--accent, var(--primary));
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    opacity: 0;
    animation: slideInRight 0.5s ease-out forwards;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.bubble-card:nth-child(1) { animation-delay: 0.05s; }
.bubble-card:nth-child(2) { animation-delay: 0.1s; }
.bubble-card:nth-child(3) { animation-delay: 0.15s; }
.bubble-card:nth-child(4) { animation-delay: 0.2s; }
.bubble-card:nth-child(5) { animation-delay: 0.25s; }
.bubble-card:nth-child(6) { animation-delay: 0.3s; }

.bubble-card:hover {
    transform: translateX(-8px) translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-right-width: 8px;
}
.bubble-card:active { transform: translateX(-4px) translateY(-1px); }

.bubble-card i {
    color: var(--accent, var(--primary));
    margin-left: 0.5rem;
    transition: all var(--transition-normal);
    display: inline-block;
}
.bubble-card:hover i {
    transform: rotate(10deg) scale(1.2);
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}
.bubble-card strong { transition: all var(--transition-fast); }
.bubble-card:hover strong { color: var(--accent-dark, var(--primary-dark)); }

/* ---------- رنگ‌آمیزی بخش‌ها (FIXED comments) ---------- */
/* سکه */
.section-coin .section-title { border-right-color: var(--accent); color: var(--accent-dark); }
.section-coin .section-title i { color: var(--accent); }
.section-coin .data-table th {
    background: linear-gradient(135deg, var(--accent-light), #f5e1c0);
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}
.section-coin .data-table th:hover { background: linear-gradient(135deg, #f5e1c0, #ecd5af); }
.section-coin .data-table td:nth-child(2) { color: var(--accent-dark); }
.section-coin .buy-btn, .section-coin .buy-small { background: var(--accent); }
.section-coin .buy-btn:hover, .section-coin .buy-small:hover { background: var(--accent-dark); }

/* حباب */
.section-bubble .section-title { border-right-color: var(--accent); color: var(--accent-dark); }
.section-bubble .section-title i { color: var(--accent); }
.section-bubble .bubble-card { border-right-color: var(--accent); }
.section-bubble .bubble-card strong { color: var(--accent-dark); }

/* صندوق‌ها */
.section-fund .section-title { border-right-color: var(--accent); color: var(--accent-dark); }
.section-fund .section-title i { color: var(--accent); }
.section-fund .data-table th {
    background: linear-gradient(135deg, var(--accent-light), #c8e6c9);
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}
.section-fund .data-table td:nth-child(2) { color: var(--accent-dark); }
.section-fund .buy-btn, .section-fund .buy-small { background: var(--accent); }
.section-fund .buy-btn:hover, .section-fund .buy-small:hover { background: var(--accent-dark); }

/* ارز */
.section-currency .section-title { border-right-color: var(--accent); color: var(--accent-dark); }
.section-currency .section-title i { color: var(--accent); }
.section-currency .data-table th {
    background: linear-gradient(135deg, var(--accent-light), #bbdefb);
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}
.section-currency .data-table td:nth-child(2) { color: var(--accent-dark); }
.section-currency .buy-btn, .section-currency .buy-small { background: var(--accent); }
.section-currency .buy-btn:hover, .section-currency .buy-small:hover { background: var(--accent-dark); }

/* حواله */
.section-hawala .section-title { border-right-color: var(--accent); color: var(--accent-dark); }
.section-hawala .section-title i { color: var(--accent); }
.section-hawala .data-table th {
    background: linear-gradient(135deg, var(--accent-light), #e1bee7);
    color: var(--accent-dark);
    border-bottom-color: var(--accent);
}
.section-hawala .data-table td:nth-child(2),
.section-hawala .data-table td:nth-child(3) { color: var(--accent-dark); }
.section-hawala .buy-btn, .section-hawala .buy-small { background: var(--accent); }
.section-hawala .buy-btn:hover, .section-hawala .buy-small:hover { background: var(--accent-dark); }

/* ---------- المان‌های متفرقه ---------- */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

.refresh-icon { transition: all var(--transition-normal); }
.refresh-icon:hover { animation: rotateIcon 0.6s ease-out; }

.highlight-row { animation: highlightFade 1s ease-out; }

.price-up   { animation: priceChangeUp 0.4s ease-out; }
.price-down { animation: priceChangeDown 0.4s ease-out; }

.delayed-animation {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ---------- Footer ---------- */
footer {
    margin-top: 4rem;
    background: white;
    border-top: 1px solid var(--gray-200);
    padding: 2rem 0 1rem;
    font-size: 0.85rem;
    color: var(--gray-700);
    text-align: right;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-brand h4 {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.footer-links a {
    color: var(--gray-700);
    text-decoration: none;
    margin-left: 1.5rem;
    transition: color var(--transition-fast);
}
.footer-links a:hover { color: var(--primary); }

.footer-contact span { white-space: nowrap; }

.copyright {
    text-align: center;
    border-top: 1px solid var(--gray-100);
    padding-top: 1rem;
    margin-top: 1rem;
    font-size: 0.75rem;
}

/* ---------- اسکرول‌بار سفارشی ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track {
    background: var(--gray-100);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
    transition: background var(--transition-fast);
}
::-webkit-scrollbar-thumb:hover { background: var(--primary-dark); }

/* ---------- واکنش‌گرایی ---------- */
@media (max-width: 768px) {
    .container { padding: 0 1rem; }
    .gold-price { font-size: 1.3rem; }
    .section-title { font-size: 1.3rem; }
    .hero-gold-grid { gap: 1rem; }
    .logo h1 { font-size: 1.4rem; }
    .data-table th, .data-table td { padding: 1.05rem 0.75rem; font-size: 1.05rem; }
    .data-table th { font-size: 1.05rem; }
    .data-table td .positive,
    .data-table td .negative { font-size: 0.975rem; padding: 0.1rem 0.4rem; }
    .data-table .buy-small { padding: 0.3rem 0.9rem; font-size: 0.9rem; }

    .gold-card, .silver-card, .bubble-card, .data-table tr {
        animation-duration: 0.4s;
    }

    .data-table table { min-width: 100%; }

    .main-nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    .header-flex { flex-direction: column; align-items: stretch; text-align: center; }
    .live-time { text-align: center; }
    .section-title { font-size: 1.1rem; }
    .gold-card:hover, .silver-card:hover, .bubble-card:hover {
        transform: translateY(-3px);
    }
}

/* ---------- دسترسی: کاهش انیمیشن برای کاربرانی که ترجیح می‌دن ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .gold-card, .silver-card, .bubble-card,
    .section-title, .data-table tr {
        opacity: 1 !important;
    }
}

/* ---------- چاپ ---------- */
@media print {
    .buy-btn, .buy-small, .top-bar { display: none; }
    body { background: white; }
    .data-table { box-shadow: none; border: 1px solid #ccc; }
    * {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }
}

.gold-price,
.gold-change,
.bubble-card span,
td.positive, td.negative,
th.positive, th.negative {
    unicode-bidi: isolate;
    direction: ltr;
    white-space: nowrap;
}


td.positive, td.negative, th.positive, th.negative {
    display: table-cell;
    text-align: center; /* Change to 'right' if your design prefers right-aligned numbers */
}