@import url('https://fonts.googleapis.com/css2?family=Cabin:ital,wght@0,400;0,500;0,600;0,700;1,400;1,600&family=JetBrains+Mono:wght@400;500;600;700&family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Cabin / MedSync Brand Palette */
    --cabin-taupe: #B5A18B;
    --cabin-taupe-light: #F4EFEA;
    --cabin-yellow: #FFCF68;
    --cabin-yellow-light: #FFF8E7;
    --cabin-cream: #EDE8E1;
    --cabin-dark: #201F1E;

    --bg-main: #ECE7DF;
    --bg-surface: #FFFFFF;
    --bg-surface-elevated: #F9F7F4;
    --border-main: #E3DDD4;
    --border-subtle: #EFECE6;
    --text-primary: #201F1E;
    --text-secondary: #6B655F;
    --text-muted: #9E968D;
    
    /* Semantic Status Accents */
    --accent-gold: #FFCF68;
    --accent-emerald: #10B981;
    --accent-emerald-light: #EBF7EE;
    --accent-rose: #F43F5E;
    --accent-rose-light: #FEECEF;
    --accent-taupe: #B5A18B;
    
    --card-shadow: 0 2px 10px -2px rgba(32, 31, 30, 0.04), 0 1px 3px -1px rgba(32, 31, 30, 0.03);
    --card-shadow-hover: 0 12px 28px -6px rgba(32, 31, 30, 0.08), 0 4px 10px -2px rgba(32, 31, 30, 0.04);
}

.dark {
    --cabin-taupe: #B5A18B;
    --cabin-taupe-light: rgba(181, 161, 139, 0.15);
    --cabin-yellow: #FFCF68;
    --cabin-yellow-light: rgba(255, 207, 104, 0.15);
    --cabin-cream: #201F1E;
    --cabin-dark: #FFFFFF;

    --bg-main: #181716;
    --bg-surface: #242220;
    --bg-surface-elevated: #2D2B28;
    --border-main: #383531;
    --border-subtle: #2C2A27;
    --text-primary: #F5F2EB;
    --text-secondary: #B5AEA4;
    --text-muted: #7E776E;
    
    --accent-gold: #FFCF68;
    --accent-emerald: #34D399;
    --accent-emerald-light: rgba(52, 211, 153, 0.12);
    --accent-rose: #FB7185;
    --accent-rose-light: rgba(251, 113, 133, 0.12);
    --accent-taupe: #B5A18B;
    
    --card-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.5), 0 2px 6px -2px rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 16px 32px -4px rgba(0, 0, 0, 0.6), 0 6px 12px -2px rgba(0, 0, 0, 0.4);
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Cabin', 'Vazirmatn', system-ui, -apple-system, sans-serif;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Persian / RTL Font Support */
[dir="rtl"] body,
[dir="rtl"] {
    font-family: 'Vazirmatn', 'Cabin', system-ui, -apple-system, sans-serif !important;
}

[dir="rtl"] .font-mono {
    font-family: 'JetBrains Mono', 'Vazirmatn', monospace !important;
    direction: ltr;
    display: inline-block;
}

/* Organic Rounded Cards (Cabin & MedSync style) */
.crypto-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-main);
    box-shadow: var(--card-shadow);
    border-radius: 1.25rem; /* 20px */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.crypto-card:hover {
    box-shadow: var(--card-shadow-hover);
    border-color: var(--cabin-taupe);
}

.dark .crypto-card:hover {
    border-color: rgba(255, 207, 104, 0.4);
}

/* Featured Yellow KPI Card (From Reference Image 1 & 2) */
.card-featured-yellow {
    background-color: #FFCF68 !important;
    color: #201F1E !important;
    border: 1px solid #F5C252 !important;
    box-shadow: 0 8px 20px -4px rgba(255, 207, 104, 0.35) !important;
}

.card-featured-yellow .text-slate-500,
.card-featured-yellow .text-slate-400 {
    color: #594D31 !important;
}

.card-featured-yellow .font-mono {
    color: #201F1E !important;
}

/* Featured Taupe Card */
.card-featured-taupe {
    background-color: #B5A18B !important;
    color: #FFFFFF !important;
    border: 1px solid #A4917B !important;
}

/* Ambient Golden Glow (Bottom Left like in the mockup) */
.bg-orb-1 {
    position: fixed;
    bottom: -15%;
    left: -10%;
    width: 55vw;
    height: 55vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 207, 104, 0.18) 0%, rgba(181, 161, 139, 0.10) 45%, rgba(236, 231, 223, 0) 70%);
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.bg-orb-2 {
    position: fixed;
    top: -15%;
    right: -10%;
    width: 45vw;
    height: 45vw;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(181, 161, 139, 0.14) 0%, rgba(255, 207, 104, 0.08) 45%, rgba(236, 231, 223, 0) 70%);
    filter: blur(90px);
    pointer-events: none;
    z-index: 0;
}

.dark .bg-orb-1 {
    background: radial-gradient(circle, rgba(255, 207, 104, 0.08) 0%, rgba(181, 161, 139, 0.05) 45%, rgba(0, 0, 0, 0) 70%);
}

.dark .bg-orb-2 {
    background: radial-gradient(circle, rgba(181, 161, 139, 0.07) 0%, rgba(255, 207, 104, 0.04) 45%, rgba(0, 0, 0, 0) 70%);
}

/* Segmented Navigation & Pill Controls */
.nav-tab-btn {
    border-radius: 9999px; /* full pill */
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 700;
    transition: all 0.2s ease;
    color: #6B655F;
}

.dark .nav-tab-btn {
    color: #B5AEA4;
}

.nav-tab-btn:hover {
    color: #201F1E;
    background-color: rgba(32, 31, 30, 0.04);
}

.dark .nav-tab-btn:hover {
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.06);
}

.nav-tab-btn.active {
    background-color: #201F1E !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 12px -2px rgba(32, 31, 30, 0.25);
}

.dark .nav-tab-btn.active {
    background-color: #FFCF68 !important;
    color: #201F1E !important;
    box-shadow: 0 4px 12px -2px rgba(255, 207, 104, 0.3);
}

/* Pill Badges & Buttons */
.pill-badge-dark {
    background-color: #201F1E;
    color: #FFFFFF;
    border-radius: 9999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.6875rem;
    font-weight: 700;
}

.pill-badge-taupe {
    background-color: #B5A18B;
    color: #FFFFFF;
    border-radius: 9999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.6875rem;
    font-weight: 700;
}

.pill-badge-yellow {
    background-color: #FFCF68;
    color: #201F1E;
    border-radius: 9999px;
    padding: 0.2rem 0.65rem;
    font-size: 0.6875rem;
    font-weight: 700;
}

/* Custom Animated Live Ticker Ribbon */
.ticker-wrap {
    overflow: hidden;
    white-space: nowrap;
    mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 5%, black 95%, transparent);
}

.ticker-move {
    display: inline-flex;
    animation: tickerScroll 38s linear infinite;
}

.ticker-wrap:hover .ticker-move {
    animation-play-state: paused;
}

@keyframes tickerScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

[dir="rtl"] .ticker-move {
    animation: tickerScrollRtl 38s linear infinite;
}

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

/* Order Book Depth Bars */
.depth-bar-bid {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    background: rgba(16, 185, 129, 0.15);
    z-index: 1;
    transition: width 0.3s ease;
}

.depth-bar-ask {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    background: rgba(244, 63, 94, 0.15);
    z-index: 1;
    transition: width 0.3s ease;
}

[dir="rtl"] .depth-bar-bid,
[dir="rtl"] .depth-bar-ask {
    right: auto;
    left: 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #D3CCC2;
    border-radius: 9999px;
}

.dark ::-webkit-scrollbar-thumb {
    background: #45403B;
}

::-webkit-scrollbar-thumb:hover {
    background: #B5A18B;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #635C54;
}

/* Price Flash Animations */
@keyframes flashGreen {
    0% { background-color: rgba(16, 185, 129, 0.35); }
    100% { background-color: transparent; }
}

@keyframes flashRed {
    0% { background-color: rgba(244, 63, 94, 0.35); }
    100% { background-color: transparent; }
}

.flash-up {
    animation: flashGreen 1s ease-out;
}

.flash-down {
    animation: flashRed 1s ease-out;
}

/* ApexCharts Tweaks */
.apexcharts-tooltip {
    font-family: 'Cabin', 'Inter', system-ui, sans-serif !important;
    border-radius: 1rem !important;
    box-shadow: 0 12px 28px -6px rgba(32, 31, 30, 0.18) !important;
    border: 1px solid var(--border-main) !important;
    background: var(--bg-surface) !important;
    color: var(--text-primary) !important;
}

.dark .apexcharts-tooltip {
    background: #242220 !important;
    border-color: #383531 !important;
    color: #F5F2EB !important;
}

.apexcharts-menu {
    background: var(--bg-surface) !important;
    border-color: var(--border-main) !important;
    color: var(--text-primary) !important;
    border-radius: 0.75rem !important;
}

.dark .apexcharts-menu {
    background: #2D2B28 !important;
    border-color: #383531 !important;
    color: #F5F2EB !important;
}

/* Toast Container */
#toastContainer {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
}

[dir="rtl"] #toastContainer {
    left: auto;
    right: 1.5rem;
}

.toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(32, 31, 30, 0.2);
    animation: toastSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s ease;
    background-color: #201F1E;
    color: #FFFFFF;
}

.dark .toast {
    background-color: #FFCF68;
    color: #201F1E;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
