/* =============================================================================
   FX-AESTHETIC — Professional Futures Trading Theme (Binance-style)
   ----------------------------------------------------------------------------
   Professional trading platform theme with enhanced dark/light modes,
   professional color palette inspired by Binance, Bybit, and top exchanges.
   
   Version: 2.0 (Enhanced)
   Features:
   - Enhanced color contrast for readability
   - Professional trading indicators (green/red for buy/sell)
   - Smooth theme transitions
   - Professional typography hierarchy
   - Mobile-first responsive design
   - Advanced order book styling
   - Micro-interactions and animations
   - Loading states and skeleton loaders
   - Glass morphism effects
   ========================================================================= */

/* -- LIGHT (default Bicryptoo, slate-based) ------------------------------- */
.fx-page {
    /* HSL tokens consumed by Tailwind utilities & shadcn components */
    --background:           0 0% 100%;
    --foreground:           222 47% 11%;     /* slate-900 */
    --card:                 210 40% 98%;     /* slate-50 */
    --card-foreground:      222 47% 11%;
    --popover:              0 0% 100%;
    --popover-foreground:   222 47% 11%;
    --muted:                210 40% 96%;     /* slate-100 */
    --muted-foreground:     215 16% 47%;     /* slate-500 */
    --accent:               210 40% 96%;
    --accent-foreground:    222 47% 11%;
    --border:               214 32% 91%;     /* slate-200 */
    --input:                214 32% 91%;
    --ring:                 var(--primary);
    --primary-foreground:   0 0% 100%;
    --secondary:            210 40% 96%;
    --secondary-foreground: 222 47% 11%;
    --destructive:          0 72% 51%;
    --destructive-foreground: 0 0% 100%;

    /* Optional helpers for compact futures cards */
    --fx-surface:    hsl(var(--card));
    --fx-surface-2:  hsl(var(--muted));
    --fx-text:       hsl(var(--foreground));
    --fx-text-dim:   hsl(var(--muted-foreground));
    --fx-border:     hsl(var(--border));
    --fx-accent:     hsl(var(--primary));
    --fx-rise:       #16a34a;
    --fx-fall:       #dc2626;
    --fx-radius:     12px;
    --fx-radius-sm:  10px;
    --fx-shadow:     0 1px 3px 0 rgb(0 0 0 / 0.06), 0 1px 2px -1px rgb(0 0 0 / 0.04);
    
    /* Professional exchange colors - Enhanced */
    --fx-yellow:     #f0b90b;      /* Binance yellow */
    --fx-blue:      hsl(var(--primary));      /* Links & info */
    --fx-orange:    #f97316;      /* Warnings */
    --fx-purple:    hsl(var(--primary));      /* Special items */
    
    /* Glass morphism - Light mode */
    --fx-glass:     rgba(255, 255, 255, 0.7);
    --fx-glass-bg:  rgba(255, 255, 255, 0.5);
    --fx-glass-border: rgba(0, 0, 0, 0.08);
}

/* -- DARK overrides ------------------------------------------------------- */
html.dark .fx-page {
    --background:           0 0% 4%;         /* #0a0a0a */
    --foreground:           232 24% 91%;     /* #e2e5f0 */
    --card:                 0 0% 7%;         /* #111111 */
    --card-foreground:      232 24% 91%;
    --popover:              0 0% 9%;
    --popover-foreground:   232 24% 91%;
    --muted:                0 0% 9%;         /* #181818 */
    --muted-foreground:     228 13% 50%;
    --accent:               0 0% 11%;
    --accent-foreground:    232 24% 91%;
    --border:               0 0% 13%;        /* #222 */
    --input:                0 0% 13%;
    --ring:                 var(--primary);
    --primary-foreground:   0 0% 100%;
    --secondary:            0 0% 9%;
    --secondary-foreground: 232 24% 91%;
    --destructive:          0 84% 60%;
    --destructive-foreground: 0 0% 100%;

    /* Binance-style professional trading colors */
    --fx-rise:    #00dc81;
    --fx-fall:   #f6465d;
    --fx-rise-bg:   rgba(0, 220, 129, 0.12);
    --fx-fall-bg:    rgba(246, 70, 93, 0.12);
    --fx-shadow:  0 1px 3px 0 rgb(0 0 0 / 0.4), 0 1px 2px -1px rgb(0 0 0 / 0.5);
    --fx-surface: #16181d;
    --fx-surface-2: #1c1e26;
    --fx-overlay: rgba(255, 255, 255, 0.04);
    --fx-overlay-2: rgba(255, 255, 255, 0.08);
}

/* Binance green/red utility classes - Use these for trading actions */
.fx-rise { color: var(--fx-rise) !important; }
.fx-fall { color: var(--fx-fall) !important; }
.fx-rise-bg { background: var(--fx-rise-bg); }
.fx-fall-bg { background: var(--fx-fall-bg); }

/* Green/Red button actions - Binance style */
.fx-btn-buy,
.fx-btn-long {
    background: var(--fx-rise) !important;
    color: #000 !important;
    border-color: var(--fx-rise) !important;
}
.fx-btn-buy:hover,
.fx-btn-long:hover {
    background: #00c474 !important;
    filter: brightness(1.05);
}

.fx-btn-sell,
.fx-btn-short {
    background: var(--fx-fall) !important;
    color: #fff !important;
    border-color: var(--fx-fall) !important;
}
.fx-btn-sell:hover,
.fx-btn-short:hover {
    background: #e0404f !important;
    filter: brightness(1.05);
}

/* -- Container behavior --------------------------------------------------- */
.fx-page {
    background: hsl(var(--background));
    color: hsl(var(--foreground));
}

/* Mobile-first compact container — desktop centered with max-width */
.fx-page > .fx-container,
.fx-page .fx-container {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 16px;
}
@media (max-width: 480px) {
    .fx-page .fx-container { padding: 12px; }
}

/* -- Section header (back button + title) -------------------------------- */
.fx-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}
.fx-head-back {
    width: 38px;
    height: 38px;
    border-radius: var(--fx-radius-sm);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
}
.fx-head-back:hover {
    background: hsl(var(--accent));
    border-color: hsl(var(--ring) / 0.4);
}
.fx-head-back ion-icon { font-size: 18px; }
.fx-head-title {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.2;
    color: hsl(var(--foreground));
}
.fx-head-sub {
    font-size: 12px;
    color: hsl(var(--muted-foreground));
    margin-top: 2px;
}

/* -- Card -------------------------------------------------------------- */
.fx-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--fx-radius);
    padding: 16px;
    box-shadow: var(--fx-shadow);
}
.fx-card + .fx-card { margin-top: 12px; }
.fx-card-tight { padding: 12px; }
.fx-card-flush { padding: 0; overflow: hidden; }

/* -- Stat (balance) header card ---------------------------------------- */
.fx-stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.fx-stat-label {
    font-size: 11px;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.fx-stat-value {
    font-size: 28px;
    font-weight: 800;
    color: hsl(var(--foreground));
    letter-spacing: -0.5px;
    line-height: 1.1;
}
.fx-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--fx-radius-sm);
    background: hsl(var(--primary) / 0.12);
    color: hsl(var(--primary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.fx-stat-icon ion-icon { font-size: 22px; }

/* -- Section title (above a list / form) ------------------------------ */
.fx-section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    font-weight: 700;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 2px;
    margin: 14px 0 8px;
}

/* -- Inputs ----------------------------------------------------------- */
.fx-input,
.fx-select {
    width: 100%;
    padding: 12px 14px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--fx-radius-sm);
    color: hsl(var(--foreground));
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.fx-input:focus,
.fx-select:focus {
    border-color: hsl(var(--ring));
    box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}
.fx-input::placeholder { color: hsl(var(--muted-foreground)); }
.fx-input[readonly] { background: hsl(var(--muted)); cursor: default; }

.fx-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    margin-bottom: 6px;
}

/* -- Buttons ---------------------------------------------------------- */
.fx-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: 1px solid transparent;
    border-radius: var(--fx-radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s, background 0.15s, transform 0.1s;
}
.fx-btn:active { transform: scale(0.98); }
.fx-btn-primary {
    background: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}
.fx-btn-primary:hover { filter: brightness(1.08); }
.fx-btn-outline {
    background: hsl(var(--card));
    border-color: hsl(var(--border));
    color: hsl(var(--foreground));
}
.fx-btn-outline:hover {
    background: hsl(var(--accent));
    border-color: hsl(var(--ring) / 0.4);
}
.fx-btn-ghost {
    background: transparent;
    color: hsl(var(--muted-foreground));
}
.fx-btn-ghost:hover {
    background: hsl(var(--accent));
    color: hsl(var(--foreground));
}
.fx-btn-danger {
    background: hsl(var(--destructive));
    color: hsl(var(--destructive-foreground));
}
.fx-btn-block { width: 100%; }
.fx-btn-lg { padding: 14px 18px; font-size: 15px; }

/* -- Pill / chip -------------------------------------------------------- */
.fx-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: hsl(var(--muted));
    color: hsl(var(--muted-foreground));
    border: 1px solid hsl(var(--border));
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.fx-chip.is-success { background: rgb(22 163 74 / 0.12); color: var(--fx-rise); border-color: rgb(22 163 74 / 0.3); }
.fx-chip.is-danger  { background: rgb(220 38 38 / 0.12); color: var(--fx-fall); border-color: rgb(220 38 38 / 0.3); }
.fx-chip.is-warning { background: rgb(234 179 8 / 0.14); color: #ca8a04; border-color: rgb(234 179 8 / 0.3); }
.fx-chip.is-pending { background: rgb(99 102 241 / 0.12); color: hsl(var(--primary)); border-color: hsl(var(--primary) / 0.3); }

/* -- List rows (history items) ----------------------------------------- */
.fx-list { display: flex; flex-direction: column; gap: 6px; }
.fx-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--fx-radius-sm);
    text-decoration: none;
    color: hsl(var(--foreground));
    transition: background 0.15s, border-color 0.15s;
}
.fx-list-item:hover {
    background: hsl(var(--accent));
    border-color: hsl(var(--ring) / 0.3);
}
.fx-list-item-l { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.fx-list-item-icon {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: hsl(var(--muted));
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.fx-list-item-icon ion-icon { font-size: 18px; color: hsl(var(--muted-foreground)); }
.fx-list-item-title { font-size: 13px; font-weight: 600; line-height: 1.2; }
.fx-list-item-sub   { font-size: 11px; color: hsl(var(--muted-foreground)); margin-top: 2px; }
.fx-list-item-r {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    flex-shrink: 0;
    text-align: right;
}
.fx-list-item-amt { font-size: 13px; font-weight: 700; }
.fx-list-item-sub2 { font-size: 11px; color: hsl(var(--muted-foreground)); }

/* -- Method selector cards (deposit/withdraw method picker) ----------- */
.fx-method-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.fx-method {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 14px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--fx-radius);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
    color: hsl(var(--foreground));
}
.fx-method:hover {
    border-color: hsl(var(--ring) / 0.4);
    background: hsl(var(--accent));
}
.fx-method.active {
    border-color: hsl(var(--primary));
    background: hsl(var(--primary) / 0.08);
    box-shadow: 0 0 0 1px hsl(var(--primary) / 0.4) inset;
}
.fx-method-icon {
    width: 40px; height: 40px;
    border-radius: var(--fx-radius-sm);
    background: hsl(var(--primary) / 0.14);
    color: hsl(var(--primary));
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.fx-method-icon ion-icon { font-size: 22px; }
.fx-method-name { font-size: 14px; font-weight: 700; }
.fx-method-desc { font-size: 11px; color: hsl(var(--muted-foreground)); line-height: 1.3; }

/* -- Quick-amount chips (deposit) ------------------------------------- */
.fx-amt-chips {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 10px;
}
@media (min-width: 480px) { .fx-amt-chips { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.fx-amt-chip {
    padding: 8px 4px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.fx-amt-chip:hover { border-color: hsl(var(--ring) / 0.4); color: hsl(var(--foreground)); }
.fx-amt-chip.active {
    background: hsl(var(--primary));
    border-color: hsl(var(--primary));
    color: hsl(var(--primary-foreground));
}

/* -- Empty state ------------------------------------------------------ */
.fx-empty {
    padding: 32px 16px;
    text-align: center;
    color: hsl(var(--muted-foreground));
    font-size: 13px;
}
.fx-empty ion-icon {
    display: block;
    margin: 0 auto 8px;
    font-size: 32px;
    color: hsl(var(--muted-foreground) / 0.7);
}

/* -- Alert -------------------------------------------------------------- */
.fx-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: var(--fx-radius-sm);
    border: 1px solid hsl(var(--border));
    background: hsl(var(--muted));
    font-size: 13px;
    color: hsl(var(--foreground));
}
.fx-alert ion-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.fx-alert.is-info    { background: hsl(var(--primary) / 0.08);  border-color: hsl(var(--primary) / 0.3);  color: hsl(var(--primary)); }
.fx-alert.is-warning { background: rgb(234 179 8 / 0.10); border-color: rgb(234 179 8 / 0.3);  color: #a16207; }
.fx-alert.is-success { background: rgb(22 163 74 / 0.10); border-color: rgb(22 163 74 / 0.3);  color: var(--fx-rise); }
.fx-alert.is-danger  { background: rgb(220 38 38 / 0.10); border-color: rgb(220 38 38 / 0.3);  color: var(--fx-fall); }

/* -- Dark mode tweaks for warning text ------------------------------- */
html.dark .fx-alert.is-warning { color: #facc15; }
html.dark .fx-chip.is-warning  { color: #facc15; }

/* -- Forms layout ----------------------------------------------------- */
.fx-form-row { display: flex; flex-direction: column; gap: 14px; }
.fx-form-group { display: flex; flex-direction: column; gap: 6px; }
.fx-input-suffix { position: relative; }
.fx-input-suffix .fx-input { padding-right: 56px; }
.fx-input-suffix-text {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 700;
    color: hsl(var(--muted-foreground));
    letter-spacing: 0.3px;
    pointer-events: none;
}
.fx-input-prefix { position: relative; }
.fx-input-prefix .fx-input { padding-left: 48px; }
.fx-input-prefix-text {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    pointer-events: none;
}

/* -- Tab strip --------------------------------------------------------- */
.fx-tabs {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: hsl(var(--muted));
    border: 1px solid hsl(var(--border));
    border-radius: var(--fx-radius-sm);
    margin-bottom: 12px;
}
.fx-tab {
    flex: 1;
    padding: 8px 10px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}
.fx-tab.active {
    background: hsl(var(--card));
    color: hsl(var(--foreground));
    box-shadow: var(--fx-shadow);
}

/* -- Avatar / circle ---------------------------------------------------- */
.fx-avatar {
    width: 64px; height: 64px;
    border-radius: 50%;
    background: hsl(var(--muted));
    border: 2px solid hsl(var(--border));
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: hsl(var(--muted-foreground));
    flex-shrink: 0;
}
.fx-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* -- Table ------------------------------------------------------------- */
.fx-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.fx-table thead th {
    text-align: left;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 700;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.4px;
    background: hsl(var(--muted));
    border-bottom: 1px solid hsl(var(--border));
}
.fx-table tbody tr { border-bottom: 1px solid hsl(var(--border)); }
.fx-table tbody tr:last-child { border-bottom: 0; }
.fx-table tbody tr:hover { background: hsl(var(--accent)); }
.fx-table tbody td { padding: 12px; vertical-align: middle; }

/* -- Divider ---------------------------------------------------------- */
.fx-divider {
    height: 1px;
    background: hsl(var(--border));
    margin: 12px 0;
}

/* =============================================================================
   ANIMATIONS & MICRO-INTERACTIONS
   ========================================================================= */

/* -- Keyframe Animations ------------------------------------------------ */
@keyframes fxSlideInRight {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fxSlideInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fxSlideInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fxFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes fxSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes fxPriceFlashGreen {
    0% { background: transparent; }
    50% { background: rgba(0, 220, 129, 0.15); }
    100% { background: transparent; }
}

@keyframes fxPriceFlashRed {
    0% { background: transparent; }
    50% { background: rgba(246, 70, 93, 0.15); }
    100% { background: transparent; }
}

@keyframes fxSkeletonShimmer {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}

@keyframes fxBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* -- Animation Utility Classes ------------------------------------------- */
.fx-animate-slide-in { animation: fxSlideInRight 0.25s ease-out; }
.fx-animate-slide-up { animation: fxSlideInUp 0.25s ease-out; }
.fx-animate-slide-down { animation: fxSlideInDown 0.3s ease-out; }
.fx-animate-fade-in { animation: fxFadeIn 0.2s ease-out; }
.fx-animate-pulse { animation: fxPulse 2s ease-in-out infinite; }
.fx-animate-spin { animation: fxSpin 1s linear infinite; }
.fx-animate-bounce { animation: fxBounce 0.5s ease-in-out; }

/* Price flash animations for trading */
.fx-price-up { animation: fxPriceFlashGreen 0.6s ease-out; }
.fx-price-down { animation: fxPriceFlashRed 0.6s ease-out; }

/* -- Skeleton Loaders --------------------------------------------------- */
.fx-skeleton {
    background: linear-gradient(
        90deg,
        hsl(var(--muted)) 0px,
        hsl(var(--accent)) 40px,
        hsl(var(--muted)) 80px
    );
    background-size: 200px 100%;
    animation: fxSkeletonShimmer 1.5s ease-in-out infinite;
    border-radius: var(--fx-radius-sm);
}

.fx-skeleton-text {
    height: 14px;
    margin-bottom: 8px;
}

.fx-skeleton-text:last-child {
    width: 70%;
}

.fx-skeleton-title {
    height: 24px;
    width: 50%;
    margin-bottom: 12px;
}

.fx-skeleton-circle {
    border-radius: 50%;
}

.fx-skeleton-btn {
    height: 40px;
    width: 120px;
}

.fx-skeleton-card {
    height: 120px;
    width: 100%;
}

/* -- Toast Notifications ------------------------------------------------ */
.fx-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}

.fx-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--fx-radius);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    animation: fxSlideInRight 0.3s ease-out;
    font-size: 13px;
    color: hsl(var(--foreground));
    min-width: 280px;
}

.fx-toast.fx-toast-exit {
    animation: fxSlideOutRight 0.3s ease-in forwards;
}

@keyframes fxSlideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

.fx-toast-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.fx-toast.is-success {
    border-left: 3px solid var(--fx-rise);
}

.fx-toast.is-success .fx-toast-icon {
    color: var(--fx-rise);
}

.fx-toast.is-error,
.fx-toast.is-danger {
    border-left: 3px solid var(--fx-fall);
}

.fx-toast.is-error .fx-toast-icon,
.fx-toast.is-danger .fx-toast-icon {
    color: var(--fx-fall);
}

.fx-toast.is-warning {
    border-left: 3px solid #f59e0b;
}

.fx-toast.is-warning .fx-toast-icon {
    color: #f59e0b;
}

.fx-toast.is-info {
    border-left: 3px solid hsl(var(--primary));
}

.fx-toast.is-info .fx-toast-icon {
    color: hsl(var(--primary));
}

.fx-toast-close {
    margin-left: auto;
    background: none;
    border: none;
    color: hsl(var(--muted-foreground));
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fx-toast-close:hover {
    color: hsl(var(--foreground));
}

/* -- Button Micro-interactions ------------------------------------------- */
.fx-btn {
    transition: all 0.15s ease;
}

.fx-btn:active {
    transform: scale(0.97);
}

.fx-btn:focus-visible {
    outline: 2px solid hsl(var(--ring));
    outline-offset: 2px;
}

.fx-btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.fx-btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: fxSpin 0.8s linear infinite;
    margin-left: 8px;
}

/* -- Input Micro-interactions ------------------------------------------- */
.fx-input,
.fx-select {
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.fx-input:focus,
.fx-select:focus {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

/* -- Card Hover Effects ------------------------------------------------- */
.fx-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.fx-card:hover {
    border-color: hsl(var(--ring) / 0.3);
}

/* -- Tab Transitions ---------------------------------------------------- */
.fx-tab {
    transition: all 0.15s ease;
}

/* =============================================================================
   PRICE TYPOGRAPHY (JetBrains Mono for numbers)
   ========================================================================= */

/* Import JetBrains Mono for tabular numbers */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&display=swap');

.fx-price,
.fx-number,
.fx-amount {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
}

.fx-price-lg {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.1;
}

.fx-price-md {
    font-size: 18px;
    font-weight: 700;
}

.fx-price-sm {
    font-size: 14px;
    font-weight: 600;
}

.fx-change-up {
    color: var(--fx-rise);
}

.fx-change-down {
    color: var(--fx-fall);
}

/* =============================================================================
   ENHANCED ORDER BOOK STYLES
   ========================================================================= */

.fx-ob-row {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.1s ease;
    position: relative;
}

.fx-ob-row:hover {
    background: hsl(var(--accent));
}

.fx-ob-depth-bar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    opacity: 0.15;
    transition: width 0.3s ease;
}

.fx-ob-depth-bar.buy {
    background: var(--fx-rise);
}

.fx-ob-depth-bar.sell {
    background: var(--fx-fall);
}

.fx-ob-price {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    z-index: 1;
}

.fx-ob-price.buy {
    color: var(--fx-rise);
}

.fx-ob-price.sell {
    color: var(--fx-fall);
}

.fx-ob-amount {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    color: hsl(var(--muted-foreground));
    z-index: 1;
}

.fx-ob-spread {
    text-align: center;
    padding: 4px;
    font-size: 11px;
    color: hsl(var(--muted-foreground));
    border-top: 1px solid hsl(var(--border));
    border-bottom: 1px solid hsl(var(--border));
}

.fx-ob-spread-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--fx-yellow);
}

/* =============================================================================
   ENHANCED POSITION CARDS
   ========================================================================= */

.fx-position-card {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--fx-radius);
    padding: 14px;
    margin-bottom: 8px;
    transition: border-color 0.2s ease;
}

.fx-position-card:hover {
    border-color: hsl(var(--ring) / 0.3);
}

.fx-position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.fx-position-pair {
    font-size: 15px;
    font-weight: 700;
    color: hsl(var(--foreground));
}

.fx-position-direction {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fx-position-direction.long {
    background: var(--fx-rise-bg);
    color: var(--fx-rise);
}

.fx-position-direction.short {
    background: var(--fx-fall-bg);
    color: var(--fx-fall);
}

.fx-position-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.fx-position-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fx-position-detail-label {
    font-size: 10px;
    color: hsl(var(--muted-foreground));
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.fx-position-detail-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: hsl(var(--foreground));
}

.fx-position-pnl {
    font-size: 16px;
    font-weight: 800;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid hsl(var(--border));
}

.fx-position-pnl.profit {
    color: var(--fx-rise);
}

.fx-position-pnl.loss {
    color: var(--fx-fall);
}

/* Time progress bar for positions */
.fx-position-progress {
    height: 3px;
    background: hsl(var(--muted));
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.fx-position-progress-bar {
    height: 100%;
    background: hsl(var(--primary));
    border-radius: 2px;
    transition: width 1s linear;
}

.fx-position-close-btn {
    background: none;
    border: 1px solid hsl(var(--border));
    color: hsl(var(--muted-foreground));
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fx-position-close-btn:hover {
    border-color: var(--fx-fall);
    color: var(--fx-fall);
    background: var(--fx-fall-bg);
}

/* =============================================================================
   MODAL ENHANCEMENTS
   ========================================================================= */

.fx-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fxFadeIn 0.2s ease;
}

.fx-modal-overlay.hidden {
    display: none;
}

.fx-modal-sheet {
    background: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: var(--fx-radius) var(--fx-radius) 0 0;
    padding: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
    animation: fxSlideInUp 0.3s ease-out;
}

.fx-modal-sheet-close {
    width: 32px;
    height: 4px;
    background: hsl(var(--muted-foreground));
    border-radius: 2px;
    margin: 0 auto 16px;
    opacity: 0.5;
}

.fx-modal-title {
    font-size: 18px;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-bottom: 16px;
    text-align: center;
}

/* Desktop modal (centered) */
@media (min-width: 768px) {
    .fx-modal-overlay {
        align-items: center;
    }
    
    .fx-modal-sheet {
        border-radius: var(--fx-radius);
        margin: 16px;
        animation: fxSlideInDown 0.3s ease-out;
    }
}

/* =============================================================================
   BADGE & STATUS INDICATORS
   ========================================================================= */

.fx-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 999px;
}

.fx-badge-live {
    background: rgba(0, 220, 129, 0.12);
    color: var(--fx-rise);
}

.fx-badge-live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--fx-rise);
    animation: fxPulse 2s ease-in-out infinite;
}

.fx-badge-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.fx-badge-completed {
    background: hsl(var(--primary) / 0.12);
    color: hsl(var(--primary));
}

.fx-badge-cancelled {
    background: rgba(246, 70, 93, 0.12);
    color: var(--fx-fall);
}

/* =============================================================================
   RESPONSIVE UTILITIES
   ========================================================================= */

@media (max-width: 480px) {
    .fx-hide-mobile { display: none !important; }
    .fx-container { padding: 12px; }
}

@media (min-width: 481px) {
    .fx-hide-desktop { display: none !important; }
}

/* =============================================================================
   SCROLLBAR STYLING
   ========================================================================= */

.fx-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: hsl(var(--muted)) transparent;
}

.fx-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

.fx-scrollbar::-webkit-scrollbar-thumb {
    background: hsl(var(--muted));
    border-radius: 3px;
}

.fx-scrollbar::-webkit-scrollbar-thumb:hover {
    background: hsl(var(--muted-foreground));
}
