/**
 * Gold Price Theme — custom.css
 *
 * Supplementary styles on top of compiled Tailwind (assets/css/tailwind.css).
 * Covers: RTL font loading, table utilities, print styles,
 * skeleton animation, and scrollbar theming.
 */

/* ── Google Fonts (Inter + Noto Sans Arabic) ─────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&family=Noto+Sans+Arabic:wght@400;500;600;700;900&display=swap');

/* ── RTL-aware table alignment ──────────────────────────────────────────────
   Tailwind's text-start/text-end classes handle LTR/RTL automatically,
   but we add explicit rules for older Tailwind Play CDN builds.
*/
[dir="rtl"] .text-end  { text-align: left  !important; }
[dir="rtl"] .text-start { text-align: right !important; }
[dir="rtl"] .rtl\:text-left  { text-align: left; }
[dir="rtl"] .rtl\:text-right { text-align: right; }

/* ── Scrollbar (webkit) ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
.dark ::-webkit-scrollbar-thumb { background: #334155; }

/* ── Skeleton loading animation ─────────────────────────────────────────── */
.gt-skeleton {
    display: inline-block;
    border-radius: 4px;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 200% 100%;
    animation: gt-shimmer 1.4s infinite;
}
.dark .gt-skeleton {
    background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    background-size: 200% 100%;
}
@keyframes gt-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Mono font for price numbers ─────────────────────────────────────────── */
.font-mono {
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum";
}

/* ── Sticky header shadow on scroll ─────────────────────────────────────── */
#site-header {
    transition: box-shadow 0.2s ease;
}

/* ── Section scroll offset (accounts for sticky header) ─────────────────── */
section[id] {
    scroll-margin-top: 72px;
}

/* ── Table hover row ─────────────────────────────────────────────────────── */
table tbody tr {
    transition: background-color 0.15s ease;
}

/* ── Print styles ────────────────────────────────────────────────────────── */
@media print {
    #site-header,
    #gt-dark-toggle,
    #gt-menu-toggle,
    #gt-nav-drawer,
    #gt-lang-drawer,
    #gt-lang-drawer-open,
    footer {
        display: none !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .gt-section {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* ── Focus ring for accessibility ────────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Responsive table overflow ───────────────────────────────────────────── */
.overflow-x-auto {
    -webkit-overflow-scrolling: touch;
}

/* ── ApexCharts dark mode text fix ───────────────────────────────────────── */
.dark .apexcharts-text,
.dark .apexcharts-xaxis-label,
.dark .apexcharts-yaxis-label {
    fill: #94a3b8;
}
.dark .apexcharts-tooltip {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f1f5f9 !important;
}
.dark .apexcharts-tooltip-title {
    background: #0f172a !important;
    border-color: #334155 !important;
}
