/* ═══════════════════════════════════════════════════════
   Metal Exchange Theme — Main Stylesheet
   Dark Gold Premium Design — RTL Persian
════════════════════════════════════════════════════════ */

/* ---- Base Reset ---- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    background-color: var(--bg-900);
    color: var(--text-200);
    direction: rtl;
    text-align: right;
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ---- Selection ---- */
::selection {
    background: var(--gold-500);
    color: var(--bg-900);
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-800);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-400);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-600);
}

/* ---- Typography ---- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-100);
    line-height: 1.3;
}

h1 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
}

h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
}

h3 {
    font-size: 1.25rem;
}

p {
    margin-bottom: 1rem;
    color: var(--text-200);
}

a {
    color: var(--gold-400);
    text-decoration: none;
    transition: color .2s;
}

a:hover {
    color: var(--gold-500);
}

strong,
b {
    font-weight: 700;
    color: var(--text-100);
}

img {
    max-width: 100%;
    height: auto;
}

/* ═══════════════════════════════════════════════════════
   NAVBAR
════════════════════════════════════════════════════════ */
.mx-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--navbar-h);
    background: rgba(6, 11, 20, .92);
    backdrop-filter: blur(16px) saturate(1.4);
    -webkit-backdrop-filter: blur(16px) saturate(1.4);
    border-bottom: 1px solid rgba(245, 158, 11, .12);
    transition: box-shadow .3s;
}

.mx-navbar.scrolled {
    box-shadow: 0 2px 32px rgba(0, 0, 0, .7);
}

.mx-navbar-inner {
    display: flex;
    align-items: center;
    max-width: 1440px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    gap: 24px;
}

/* Brand */
.mx-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    text-decoration: none;
}

.mx-brand-logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 0 12px rgba(245, 158, 11, .3);
    flex-shrink: 0;
}

.mx-brand-text {
    display: flex;
    flex-direction: column;
}

.mx-brand-name {
    font-size: 16px;
    font-weight: 900;
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 50%, #D97706 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.1;
}

.mx-brand-tagline {
    font-size: 10px;
    color: var(--text-400);
    font-weight: 400;
}

/* Primary Nav */
.mx-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.mx-nav ul,
.mx-nav .menu {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
}

.mx-nav ul li a,
.mx-nav .menu li a {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-300);
    border-radius: var(--radius-sm);
    transition: background .2s, color .2s;
    white-space: nowrap;
}

.mx-nav ul li a:hover,
.mx-nav .menu li a:hover,
.mx-nav ul li.current-menu-item>a,
.mx-nav .menu li.current-menu-item>a {
    background: rgba(245, 158, 11, .1);
    color: var(--gold-400);
}

/* Live Prices Indicator */
.mx-live-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-400);
    flex-shrink: 0;
}

.mx-live-dot {
    width: 7px;
    height: 7px;
    background: #EF4444;
    border-radius: 50%;
    animation: mx-pulse 1.5s infinite;
}

@keyframes mx-pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: .6;
    }
}

/* Nav Actions */
.mx-nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.mx-user-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--bg-600);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: 50px;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    text-decoration: none;
}

.mx-user-pill:hover {
    background: var(--bg-500);
    border-color: rgba(245, 158, 11, .25);
}

.mx-user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
    color: var(--bg-900);
    font-size: 11px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mx-user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-200);
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mx-btn-login {
    padding: 8px 20px;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
    color: var(--bg-900);
    font-weight: 700;
    font-size: 14px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: transform .15s, box-shadow .2s;
    text-decoration: none;
}

.mx-btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 18px rgba(245, 158, 11, .35);
    color: var(--bg-900);
}

/* Hamburger */
.mx-hamburger {
    display: none;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: var(--bg-600);
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin-right: auto;
}

.mx-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-300);
    border-radius: 1px;
    transition: all .3s;
}

.mx-hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mx-hamburger.open span:nth-child(2) {
    opacity: 0;
}

.mx-hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile drawer */
.mx-mobile-menu {
    display: none;
    position: fixed;
    top: var(--navbar-h);
    left: 0;
    right: 0;
    background: var(--bg-800);
    border-bottom: 1px solid rgba(245, 158, 11, .1);
    padding: 16px;
    z-index: 999;
}

.mx-mobile-menu.open {
    display: block;
}

.mx-mobile-menu ul,
.mx-mobile-menu .menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mx-mobile-menu ul li a,
.mx-mobile-menu .menu li a {
    display: block;
    padding: 12px 16px;
    color: var(--text-200);
    font-size: 15px;
    border-radius: var(--radius-sm);
    transition: background .15s;
}

.mx-mobile-menu ul li a:hover {
    background: var(--bg-600);
    color: var(--gold-400);
}

/* ═══════════════════════════════════════════════════════
   PAGE OFFSET (for fixed navbar)
════════════════════════════════════════════════════════ */
body {
    padding-top: var(--navbar-h);
}

body.is-dashboard {
    padding-top: 0;
    /* dashboard is full-screen, manages its own space */
}

body.admin-bar .mx-navbar {
    top: 32px;
}

body.admin-bar {
    padding-top: calc(var(--navbar-h) + 32px);
}

/* ═══════════════════════════════════════════════════════
   HERO SECTION (homepage)
════════════════════════════════════════════════════════ */
.mx-hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: var(--bg-900);
}

.mx-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 60% 50% at 50% 0%, rgba(245, 158, 11, .07) 0%, transparent 70%),
        radial-gradient(ellipse 40% 60% at 80% 50%, rgba(16, 185, 129, .04) 0%, transparent 60%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(96, 165, 250, .04) 0%, transparent 60%);
}

.mx-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(245, 158, 11, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(245, 158, 11, .04) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 100% 100% at 50% 0%, black, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse 100% 100% at 50% 0%, black, transparent 75%);
}

.mx-hero-content {
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
    padding: 80px 24px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.mx-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .25);
    border-radius: 50px;
    font-size: 13px;
    color: var(--gold-400);
    font-weight: 600;
    margin-bottom: 20px;
}

.mx-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 900;
    line-height: 1.15;
    margin-bottom: 20px;
}

.mx-hero-title .gold {
    background: linear-gradient(135deg, #FBBF24, #F59E0B, #D97706);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.mx-hero-desc {
    font-size: 17px;
    color: var(--text-300);
    margin-bottom: 32px;
    line-height: 1.8;
}

.mx-hero-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.mx-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
    color: var(--bg-900);
    font-weight: 800;
    font-size: 15px;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: transform .15s, box-shadow .2s;
}

.mx-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(245, 158, 11, .4);
    color: var(--bg-900);
}

.mx-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 26px;
    background: transparent;
    color: var(--text-200);
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, .12);
    cursor: pointer;
    text-decoration: none;
    transition: background .2s, border-color .2s, color .2s;
}

.mx-btn-secondary:hover {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(245, 158, 11, .3);
    color: var(--gold-400);
}

/* Price stats strip */
.mx-stats-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.mx-stat-card {
    padding: 20px;
    background: var(--bg-700);
    border: 1px solid rgba(255, 255, 255, .06);
    border-radius: var(--radius-md);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-card);
    transition: border-color .2s, transform .2s;
}

.mx-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent, var(--gold-500));
    opacity: .7;
}

.mx-stat-card:hover {
    border-color: rgba(245, 158, 11, .2);
    transform: translateY(-2px);
}

.mx-stat-icon {
    font-size: 28px;
    margin-bottom: 10px;
    display: block;
}

.mx-stat-name {
    font-size: 13px;
    color: var(--text-400);
    margin-bottom: 4px;
}

.mx-stat-price {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-100);
    font-family: 'Inter', sans-serif;
}

.mx-stat-irt {
    font-size: 11px;
    color: var(--text-400);
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════
   FEATURES SECTION
════════════════════════════════════════════════════════ */
.mx-section {
    padding: 80px 24px;
    max-width: 1440px;
    margin: 0 auto;
}

.mx-section-header {
    text-align: center;
    margin-bottom: 56px;
}

.mx-section-label {
    display: inline-block;
    padding: 4px 14px;
    background: rgba(245, 158, 11, .08);
    border: 1px solid rgba(245, 158, 11, .2);
    border-radius: 50px;
    font-size: 12px;
    font-weight: 700;
    color: var(--gold-400);
    letter-spacing: .08em;
    text-transform: uppercase;
    margin-bottom: 14px;
}

.mx-section-title {
    margin-bottom: 14px;
}

.mx-section-desc {
    font-size: 16px;
    color: var(--text-300);
    max-width: 560px;
    margin: 0 auto;
}

.mx-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.mx-feature-card {
    padding: 28px;
    background: var(--bg-700);
    border: 1px solid rgba(255, 255, 255, .05);
    border-radius: var(--radius-lg);
    transition: border-color .25s, transform .25s, box-shadow .25s;
    position: relative;
    overflow: hidden;
}

.mx-feature-card:hover {
    border-color: rgba(245, 158, 11, .2);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}

.mx-feature-icon-wrap {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(245, 158, 11, .1);
    border: 1px solid rgba(245, 158, 11, .2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    margin-bottom: 18px;
}

.mx-feature-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-100);
    margin-bottom: 8px;
}

.mx-feature-desc {
    font-size: 14px;
    color: var(--text-300);
    line-height: 1.7;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════
   LIVE PRICES PREVIEW
════════════════════════════════════════════════════════ */
.mx-prices-preview {
    background: var(--bg-800);
    border-top: 1px solid rgba(255, 255, 255, .04);
    border-bottom: 1px solid rgba(255, 255, 255, .04);
    padding: 80px 24px;
}

/* ═══════════════════════════════════════════════════════
   CTA BAND
════════════════════════════════════════════════════════ */
.mx-cta-band {
    margin: 0 24px 80px;
    padding: 60px 40px;
    background: linear-gradient(135deg, rgba(245, 158, 11, .1) 0%, rgba(13, 21, 32, .8) 50%, rgba(16, 185, 129, .06) 100%);
    border: 1px solid rgba(245, 158, 11, .15);
    border-radius: var(--radius-xl);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.mx-cta-band::before {
    content: 'GOLD';
    position: absolute;
    font-size: 180px;
    font-weight: 900;
    color: rgba(245, 158, 11, .025);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    letter-spacing: 20px;
}

.mx-cta-title {
    font-size: clamp(1.5rem, 4vw, 2.4rem);
    font-weight: 900;
    margin-bottom: 14px;
}

.mx-cta-desc {
    font-size: 16px;
    color: var(--text-300);
    margin-bottom: 28px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* ═══════════════════════════════════════════════════════
   STANDARD PAGE
════════════════════════════════════════════════════════ */
.mx-page-wrap {
    max-width: 860px;
    margin: 0 auto;
    padding: 60px 24px 80px;
}

.mx-page-header {
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    padding-bottom: 28px;
    margin-bottom: 36px;
}

.mx-page-title {
    font-size: clamp(1.6rem, 4vw, 2.5rem);
    font-weight: 900;
    margin-bottom: 8px;
}

.mx-page-content {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text-200);
}

.mx-page-content h2 {
    margin: 36px 0 16px;
    font-size: 1.4rem;
}

.mx-page-content h3 {
    margin: 28px 0 12px;
    font-size: 1.15rem;
    color: var(--text-100);
}

.mx-page-content p {
    margin-bottom: 16px;
}

.mx-page-content ul,
.mx-page-content ol {
    padding-right: 24px;
    margin-bottom: 16px;
}

.mx-page-content li {
    margin-bottom: 8px;
}

.mx-page-content blockquote {
    border-right: 3px solid var(--gold-500);
    padding: 16px 20px;
    background: var(--bg-700);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 24px 0;
    font-style: italic;
    color: var(--text-300);
}

/* ═══════════════════════════════════════════════════════
   DASHBOARD FULL-SCREEN PAGE
════════════════════════════════════════════════════════ */
.mx-dashboard-page {
    min-height: 100vh;
    background: var(--bg-900);
    display: flex;
    flex-direction: column;
}

.mx-dashboard-page .mx-navbar {
    position: sticky;
    top: 0;
}

.mx-dashboard-main {
    flex: 1;
}

/* ═══════════════════════════════════════════════════════
   FOOTER
════════════════════════════════════════════════════════ */
.mx-footer {
    background: var(--bg-800);
    border-top: 1px solid rgba(255, 255, 255, .05);
    padding: 52px 24px 28px;
}

.mx-footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 40px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.mx-footer-brand .mx-brand-name {
    font-size: 20px;
}

.mx-footer-about {
    font-size: 14px;
    color: var(--text-400);
    line-height: 1.7;
    margin-top: 12px;
}

.mx-footer-col h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-200);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.mx-footer-col ul {
    list-style: none;
    padding: 0;
}

.mx-footer-col ul li {
    margin-bottom: 10px;
}

.mx-footer-col ul li a {
    font-size: 14px;
    color: var(--text-400);
    transition: color .2s;
}

.mx-footer-col ul li a:hover {
    color: var(--gold-400);
}

.mx-footer-bottom {
    max-width: 1440px;
    margin: 0 auto;
    padding-top: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.mx-footer-copy {
    font-size: 13px;
    color: var(--text-500);
}

.mx-footer-disclaimer {
    font-size: 12px;
    color: var(--text-500);
    text-align: center;
}

/* ═══════════════════════════════════════════════════════
   404 PAGE
════════════════════════════════════════════════════════ */
.mx-404 {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 24px;
}

.mx-404-code {
    font-size: clamp(6rem, 18vw, 12rem);
    font-weight: 900;
    line-height: 1;
    background: linear-gradient(135deg, rgba(245, 158, 11, .3), rgba(245, 158, 11, .06));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: block;
    margin-bottom: 8px;
}

.mx-404-msg {
    font-size: 1.3rem;
    color: var(--text-200);
    margin-bottom: 8px;
}

.mx-404-hint {
    font-size: 15px;
    color: var(--text-400);
    margin-bottom: 32px;
}

/* ═══════════════════════════════════════════════════════
   UTILITIES
════════════════════════════════════════════════════════ */
.mx-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
}

.mx-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, .05);
    margin: 0;
}

.text-gold {
    color: var(--gold-400) !important;
}

.text-green {
    color: var(--success) !important;
}

.text-red {
    color: var(--danger) !important;
}

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .mx-hero-content {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .mx-stats-strip {
        grid-template-columns: repeat(3, 1fr);
    }

    .mx-footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    .mx-footer-inner>*:first-child {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .mx-nav {
        display: none;
    }

    .mx-live-badge {
        display: none;
    }

    .mx-hamburger {
        display: flex;
    }

    .mx-nav-actions .mx-user-pill .mx-user-name {
        display: none;
    }

    .mx-hero-content {
        padding: 48px 0;
    }

    .mx-stats-strip {
        grid-template-columns: 1fr;
    }

    .mx-features-grid {
        grid-template-columns: 1fr;
    }

    .mx-footer-inner {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .mx-footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .mx-cta-band {
        margin: 0 0 60px;
        border-radius: 0;
    }

    .mx-section {
        padding: 60px 16px;
    }
}

@media (max-width: 480px) {
    .mx-hero-btns {
        flex-direction: column;
    }

    .mx-btn-primary,
    .mx-btn-secondary {
        justify-content: center;
    }
}