/* ============================================
   ZARNO - Main Stylesheet
   ============================================ */

/* --- Base Styles --- */
body {
    font-family: 'Vazirmatn', sans-serif;
    background-color: #020202;
    color: white;
    overflow-x: hidden;
    scroll-behavior: smooth;
}
/* Chart containers: responsive wrapper for Chart.js */
.chart-wrap {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    position: relative;
    min-height: 200px;
    height: 280px;
}
.chart-wrap canvas {
    max-height: none !important;
    display: block;
}
@media (max-width: 480px) {
    .chart-wrap { height: 240px; min-height: 180px; }
}
@media (max-width: 360px) {
    .chart-wrap { height: 200px; min-height: 160px; }
}
:root {
    --gold: #E9C15B;
}

/* --- Layout Grid --- */
.layout-grid {
    display: grid;
    grid-template-columns: 260px 1fr 380px;
    min-height: 100vh;
    width: 100%;
    gap: 0;
}

/* Sidebar in layout-grid */
.layout-grid .sidebar {
    position: relative;
    height: auto;
    grid-column: 1;
}

/* Main content in layout-grid */
.layout-grid .main-content {
    grid-column: 2;
    width: 100%;
    max-width: 100%;
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
    min-height: 100vh;
    margin-right: 0;
    box-sizing: border-box;
}

/* Trade panel in layout-grid */
.layout-grid .trade-panel {
    position: relative;
    height: auto;
    grid-column: 3;
}

@media (max-width: 1024px) {
    .layout-grid {
        grid-template-columns: 260px 1fr;
    }
    .layout-grid .trade-panel {
        display: none;
    }
    .layout-grid .main-content {
        grid-column: 2;
    }
}

@media (max-width: 768px) {
    .layout-grid {
        grid-template-columns: 1fr;
        min-height: auto;
    }
    .layout-grid .sidebar {
        position: fixed;
        width: 260px;
        height: 100vh;
        /* RTL off-canvas (hidden by default) */
        transform: translateX(110%);
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        grid-column: 1;
        display: none;
        top:0;
        right:0;
    }
    .layout-grid .sidebar.open {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
        display: block;
        position: fixed;
    }
    .layout-grid .main-content {
        grid-column: 1;
        margin-right: 0;
        padding: 16px;
    }
    .layout-grid .trade-panel {
        display: none;
    }
}

/* زیر ۴۰۰px و ۳۶۰px: فشرده‌تر برای موبایل کوچک */
@media (max-width: 400px) {
    .layout-grid .main-content { padding: 12px; }
    .main-content { padding: 12px; }
    .glass-box { padding: 14px !important; }
}

@media (max-width: 360px) {
    .layout-grid .main-content { padding: 10px; }
    .main-content { padding: 10px; }
    .glass-box { padding: 12px !important; }
    /* هدر داشبورد و صفحات مشابه */
    .main-content .flex.justify-between.items-center { flex-wrap: wrap; gap: 8px; }
    .main-content .text-2xl { font-size: 1.25rem; }
    .main-content .text-3xl { font-size: 1.5rem; }
    .main-content .text-4xl { font-size: 1.75rem; }
    .main-content .grid { gap: 10px; }
}

/* --- Main Content (standalone) --- */
.main-content {
    overflow-y: auto;
    padding: 24px;
    scroll-behavior: smooth;
    min-height: 100vh;
    width: 100%;
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }
}

.main-content::-webkit-scrollbar {
    width: 6px;
}

.main-content::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

/* --- Sidebar (standalone) --- */
.sidebar {
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    width: 260px;
    z-index: 1000;
    transition: transform 0.3s ease;
    background: #050505;
    border-left: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    padding: 24px;
    overflow-y: auto;
}

/* Sidebar in layout-grid */
.layout-grid .sidebar {
    position: relative;
    height: auto;
    width: 260px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-close {
    display: none;
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

.mobile-menu-toggle {
    display: none;
    position: static;
    margin-top: 16px;
    margin-right: 16px;
    z-index: 1001;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .sidebar {
        /* RTL off-canvas (hidden by default) */
        transform: translateX(110%);
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
    }
    .sidebar.open {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }
    .sidebar-close {
        display: flex;
    }
    .mobile-menu-toggle {
        display: flex;
    }
    html body .bottom-6{
      bottOm:60px!important;
    }
}

/* --- Menu Items --- */
.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 4px;
    color: #9CA3AF;
    border-radius: 12px;
    transition: 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.menu-item:hover,
.menu-item.active {
    background: rgba(233, 193, 91, 0.08);
    color: #E9C15B;
}

.menu-item.active {
    font-weight: bold;
    border-right: 3px solid #E9C15B;
}

/* --- Trade Panel (standalone) --- */
.trade-panel {
    background: #08080a;
    border-right: 1px solid rgba(255,255,255,0.08);
    padding: 24px;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    width: 380px;
    height: 100vh;
    overflow-y: auto;
}

/* Trade panel in layout-grid */
.layout-grid .trade-panel {
    position: relative;
    height: auto;
    width: 380px;
}

@media (max-width: 1024px) {
    .trade-panel:not(.layout-grid .trade-panel) {
        display: none;
    }
}

/* --- Glass Box --- */
.glass-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    transition: 0.3s;
}

.glass-box:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* --- Onboarding Card --- */
.onboarding-card {
    background: linear-gradient(135deg, #1e1b4b 0%, #0F0C15 100%);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(30, 27, 75, 0.5);
}

.progress-track {
    background: rgba(255,255,255,0.1);
    height: 6px;
    border-radius: 10px;
    width: 100%;
    overflow: hidden;
}

.progress-fill {
    background: #E9C15B;
    height: 100%;
    border-radius: 10px;
    box-shadow: 0 0 10px #E9C15B;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    color: #6B7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    border: 2px dashed rgba(255,255,255,0.05);
    border-radius: 20px;
    background: rgba(0,0,0,0.2);
}

/* --- Ticker Strip --- */
.ticker-strip {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ticker-item {
    background: #15151a;
    border: 1px solid rgba(255,255,255,0.05);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 11px;
    display: flex;
    gap: 8px;
    align-items: center;
}

/* --- Tables --- */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

th {
    text-align: right;
    padding: 16px;
    color: #6B7280;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

td {
    padding: 16px;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
}

tr:hover td {
    background: rgba(255,255,255,0.02);
}

/* Table responsive wrapper */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    table {
        font-size: 11px;
    }
    th, td {
        padding: 10px 8px;
        white-space: nowrap;
    }
}

/* --- Responsive Grid --- */
@media (max-width: 768px) {
    .grid-cols-3 {
        grid-template-columns: 1fr 1fr !important;
    }
    .grid-cols-12 {
        grid-template-columns: 1fr !important;
    }
    .col-span-5,
    .col-span-7,
    .col-span-12 {
        grid-column: span 1 !important;
    }
    .onboarding-card {
        flex-direction: column;
        text-align: center;
    }
    /* Asset tabs scrollable on mobile */
    .asset-tab {
        white-space: nowrap;
        padding: 6px 10px;
        font-size: 10px;
    }
    header.flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }
    header .flex.bg-white\/5 {
        overflow-x: auto;
        width: 100%;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Landing Page Specific --- */
.hero-section {
    padding: 80px 24px;
}

.hero-title {
    font-size: 3.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 40px 16px !important;
    }
    .hero-title {
        font-size: 2rem !important;
    }
    .hero-subtitle {
        font-size: 1rem !important;
    }
}

/* --- Admin Layout --- */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 260px;
    background: #050505;
    border-left: 1px solid rgba(255,255,255,0.08);
    display: flex;
    flex-direction: column;
    padding: 24px;
    position: fixed;
    right: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.admin-sidebar::-webkit-scrollbar {
    width: 6px;
}

.admin-sidebar::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 3px;
}

.admin-content {
    flex: 1;
    margin-right: 260px;
    min-height: 100vh;
}

@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-content {
        margin-right: 0;
    }
}

/* --- Stat Cards --- */
.stat-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px;
    transition: 0.3s;
}

.stat-card:hover {
    border-color: rgba(233, 193, 91, 0.4);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px -10px rgba(233, 193, 91, 0.2);
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: #10B981;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@media (max-width: 768px) {
    .stat-card {
        padding: 16px;
    }
}

/* --- Virtual Card --- */
.virtual-card {
    background: linear-gradient(135deg, #1e3a8a 0%, #0F0C15 100%);
    border-radius: 24px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(30, 58, 138, 0.3);
}

/* --- Bank Item --- */
.bank-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    transition: 0.2s;
}

.bank-item:hover {
    border-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.02);
}

/* --- Wallet Table --- */
.wallet-table {
    font-size: 12px;
}

.wallet-table td {
    padding: 12px 8px;
    border-bottom: 1px dashed rgba(255,255,255,0.05);
}

.wallet-table tr:last-child td {
    border-bottom: none;
}

@media (max-width: 768px) {
    .wallet-table {
        font-size: 11px;
    }
    .wallet-table td {
        padding: 8px 4px;
    }
}

/* --- Asset Tab --- */
.asset-tab {
    padding: 8px 16px;
    font-size: 11px;
    border-radius: 8px;
    background: transparent;
    color: #9CA3AF;
    transition: 0.2s;
}

.asset-tab.active {
    background: #E9C15B;
    color: black;
    font-weight: bold;
}

/* --- Bubble Bar --- */
.bubble-bar-bg {
    background: rgba(255,255,255,0.1);
    height: 8px;
    border-radius: 10px;
    position: relative;
}

.bubble-bar-fill {
    height: 100%;
    border-radius: 10px;
    background: linear-gradient(90deg, #10B981, #F59E0B, #EF4444);
}

/* --- Trade Panel Col --- */
.trade-panel-col {
    background: #08080a;
    border-right: 1px solid rgba(255,255,255,0.08);
    padding: 24px;
    display: flex;
    flex-direction: column;
}

@media (max-width: 1024px) {
    .trade-panel-col {
        display: none;
    }
}

/* --- Settings Group --- */
.settings-group {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .settings-group {
        padding: 16px;
    }
}

/* --- User Card --- */
.user-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

/* --- Gateway Card --- */
.gateway-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 16px;
}

.gateway-card.active {
    border-color: #10B981;
}

.gateway-card.inactive {
    border-color: #6B7280;
    opacity: 0.7;
}

/* --- Content Block Card --- */
.content-block-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
}

/* --- Glass Panel (Landing) --- */
.glass-panel {
    background: rgba(30, 30, 35, 0.4);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(12px);
    border-radius: 24px;
    transition: 0.3s;
}

.glass-panel:hover {
    border-color: rgba(233, 193, 91, 0.4);
    background: rgba(30, 30, 40, 0.6);
    transform: translateY(-5px);
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.6);
}

/* --- Trade Widget --- */
.trade-widget {
    background: #0f0c15;
    border: 1px solid #E9C15B;
    border-radius: 32px;
    box-shadow: 0 0 60px rgba(217, 119, 6, 0.15);
    overflow: hidden;
}

/* --- Ticker Wrap --- */
.ticker-wrap {
    background: #08060a;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
    overflow: hidden;
}

.ticker-move {
    display: inline-block;
    animation: marquee 80s linear infinite;
}

@keyframes marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(100%);
    }
}

/* --- Gold Bar CSS --- */
.gold-bar-css {
    width: 45px;
    height: 75px;
    background: linear-gradient(135deg, #FDE68A, #D97706);
    border: 1px solid #FEF3C7;
    border-radius: 4px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #451a03;
    font-weight: 900;
    font-family: serif;
}

/* --- Range Input --- */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #E9C15B;
    border: 3px solid #000;
    cursor: pointer;
    margin-top: -8px;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.2);
    border-radius: 2px;
}

/* --- Badge Box --- */
.badge-box {
    background: white;
    border-radius: 8px;
    padding: 8px 12px;
    display: inline-block;
}

/* ============================================
   Utilities
   ============================================ */
.dir-ltr {
    direction: ltr;
}

/* OTP / Code inputs */
.code-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
}

/* ============================================
   Mobile bottom navigation (App-like)
   ============================================ */
@media (max-width: 768px) {
    body {
        padding-bottom: 72px; /* space for bottom nav */
    }
}

.bottom-nav {
    position: fixed;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 1002;
    backdrop-filter: blur(18px);
    background: radial-gradient(circle at top, rgba(233,193,91,0.15), rgba(0,0,0,0.95));
    border-top: 1px solid rgba(255,255,255,0.08);
}
.bottom-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 480px;
    margin: 0 auto;
    padding: 8px 16px 12px;
    gap: 8px;
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 4px;
    border-radius: 999px;
    color: #9CA3AF;
    font-size: 10px;
    text-decoration: none;
}
.bottom-nav-item span {
    line-height: 1;
}
.bottom-nav-item i {
    width: 18px;
    height: 18px;
}
.bottom-nav-item.active {
    color: #F9FAFB;
    background: linear-gradient(135deg, rgba(233,193,91,0.2), rgba(16,185,129,0.15));
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
}
@media (min-width: 769px) {
    .bottom-nav {
        display: none;
    }
}

/* ============================================
   Deposit success (receipt modal)
   ============================================ */
.page-deposit-success {
    overflow: hidden;
    background-color: #000;
}
.page-deposit-success .blur-bg {
    filter: blur(10px) brightness(0.4);
    transform: scale(0.98);
    pointer-events: none;
    transition: 0.5s;
}
.page-deposit-success .modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    animation: receipt-fadeIn 0.3s;
}
@keyframes receipt-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.page-deposit-success .receipt-card {
    width: 480px;
    max-width: calc(100vw - 32px);
    background: #0F0C15;
    border-radius: 32px;
    border: 1px solid rgba(16, 185, 129, 0.4);
    padding: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 100px rgba(16, 185, 129, 0.2);
    animation: receipt-slideUp 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes receipt-slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.page-deposit-success .success-header {
    background: linear-gradient(180deg, rgba(16,185,129,0.15) 0%, rgba(15,12,21,0) 100%);
    padding: 40px 0 20px;
    text-align: center;
}
.page-deposit-success .icon-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    margin: 0 auto;
    background: #10B981;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 40px rgba(16, 185, 129, 0.6);
    animation: receipt-popIcon 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
@keyframes receipt-popIcon {
    0% { transform: scale(0); }
    100% { transform: scale(1); }
}
.page-deposit-success .confetti {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #10B981;
    animation: receipt-fall 3s ease-out forwards;
}
@keyframes receipt-fall {
    from { transform: translateY(-50px) rotate(0deg); opacity: 1; }
    to { transform: translateY(400px) rotate(720deg); opacity: 0; }
}
.page-deposit-success .confetti--gold { background: #E9C15B; }
.page-deposit-success .confetti--white { background: #ffffff; }
.page-deposit-success .delay-100 { animation-delay: 0.1s; }
.page-deposit-success .delay-200 { animation-delay: 0.2s; }
.page-deposit-success .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 13px;
}
.page-deposit-success .row span:first-child { color: #9CA3AF; }
.page-deposit-success .row span:last-child { color: white; font-weight: bold; font-family: monospace; }
.page-deposit-success .divider {
    border-bottom: 2px dashed rgba(255,255,255,0.1);
    margin: 24px 0;
    position: relative;
}
.page-deposit-success .divider::before,
.page-deposit-success .divider::after {
    content: '';
    position: absolute;
    top: -10px;
    width: 20px;
    height: 20px;
    background: #000;
    border-radius: 50%;
}
.page-deposit-success .divider::before { left: -42px; }
.page-deposit-success .divider::after { right: -42px; }
.bottom-7{
   bottom:70px!important;
}

/* --- Zerex loading states --- */
.zerex-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.65;
}
.zerex-loading::after {
    content: attr(data-zerex-loading-text);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    border-radius: inherit;
    font-size: 11px;
    color: #E9C15B;
    font-weight: bold;
    z-index: 5;
}
.calc-result-loading {
    opacity: 0.5;
}
.calc-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(233, 193, 91, 0.3);
    border-top-color: #E9C15B;
    border-radius: 50%;
    animation: zerex-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-left: 6px;
}
@keyframes zerex-spin {
    to { transform: rotate(360deg); }
}