/* trading.css — Binance-style Spot Trading */

:root {
    /* Binance-style core colors — Light Mode */
    --primary: #fcd535;
    --primary-light: rgba(252, 213, 53, 0.1);
    --primary-dark: #f0b90b;
    --primary-gradient: linear-gradient(135deg, #fcd535 0%, #f0b90b 100%);

    --success: #0ecb81;
    --success-light: rgba(14, 203, 129, 0.1);
    --success-dark: #0b9e65;
    --success-gradient: linear-gradient(135deg, #0ecb81 0%, #0b9e65 100%);

    --danger: #f6465d;
    --danger-light: rgba(246, 70, 93, 0.1);
    --danger-dark: #c9364a;
    --danger-gradient: linear-gradient(135deg, #f6465d 0%, #c9364a 100%);

    --warning: #fcd535;
    --info: #71777e;

    --text-primary: #1e2329;
    --text-secondary: #474d57;
    --text-muted: #848e9c;

    --border-light: #eaecef;
    --border-medium: #e6e8ea;
    --border-dark: #b7bdc6;

    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f0f1f3;

    --hover-bg: rgba(0, 0, 0, 0.04);
    --active-bg: rgba(252, 213, 53, 0.08);

    --orderbook-ask: rgba(246, 70, 93, 0.06);
    --orderbook-bid: rgba(14, 203, 129, 0.06);

    --chart-bg: #ffffff;
    --chart-grid: rgba(0, 0, 0, 0.04);
    --chart-tooltip-bg: #ffffff;
    --chart-tooltip-border: #eaecef;
    --chart-line: #f0b90b;
    --chart-fill: rgba(240, 185, 11, 0.08);

    --skeleton-base: #e6e8ea;
    --skeleton-shine: #f0f1f3;

    --transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08);

    --radius-sm: 2px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-xl: 8px;
    --radius-2xl: 12px;
    --radius-full: 9999px;

    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(0, 0, 0, 0.06);
    --primary-glow: rgba(252, 213, 53, 0.2);
}

.connection-status {
    display: none;
    /* Hide by default */
}

/* Only show when we explicitly set a state */
.connection-status.connected,
.connection-status.polling,
.connection-status.disconnected {
    display: flex;
}

.connection-status {
    position: fixed;
    top: 10px;
    right: 10px;
    padding: 8px 14px;
    border-radius: var(--radius-lg);
    font-size: 12px;
    font-weight: 600;
    z-index: 1000;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 300px;
}

.connection-status.connected {
    background-color: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.connection-status.disconnected {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.reconnect-btn {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.reconnect-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .connection-status {
        top: 5px;
        right: 5px;
        left: 5px;
        max-width: none;
        justify-content: center;
    }
}

/* Hide mobile order forms on desktop */
.order-forms-container-mobile {
    display: none;
}

.dark-mode {
    --primary: #fcd535;
    --primary-light: rgba(252, 213, 53, 0.12);
    --primary-dark: #f0b90b;
    --primary-gradient: linear-gradient(135deg, #fcd535 0%, #f0b90b 100%);

    --success: #0ecb81;
    --success-light: rgba(14, 203, 129, 0.12);
    --success-dark: #0b9e65;

    --danger: #f6465d;
    --danger-light: rgba(246, 70, 93, 0.12);
    --danger-dark: #c9364a;

    --warning: #fcd535;
    --info: #2b3139;

    --text-primary: #eaecef;
    --text-secondary: #b7bdc6;
    --text-muted: #848e9c;

    --border-light: #2b3139;
    --border-medium: #363c46;
    --border-dark: #5e6673;

    --bg-primary: #181a20;
    --bg-secondary: #1e2329;
    --bg-tertiary: #0b0e11;

    --hover-bg: rgba(255, 255, 255, 0.04);
    --active-bg: rgba(252, 213, 53, 0.08);

    --orderbook-ask: rgba(246, 70, 93, 0.08);
    --orderbook-bid: rgba(14, 203, 129, 0.08);

    --chart-bg: #181a20;
    --chart-grid: rgba(255, 255, 255, 0.04);
    --chart-tooltip-bg: #1e2329;
    --chart-tooltip-border: #2b3139;
    --chart-line: #f0b90b;
    --chart-fill: rgba(240, 185, 11, 0.08);

    --skeleton-base: #2b3139;
    --skeleton-shine: #363c46;

    --glass-bg: #181a20;
    --glass-border: #2b3139;
    --primary-glow: rgba(252, 213, 53, 0.12);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    line-height: 1.5;
    transition: var(--transition);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Order update animations */
tr.highlight {
    animation: orderHighlight 1.5s ease-out;
}

@keyframes orderHighlight {
    0% {
        background-color: rgba(99, 102, 241, 0.2);
    }

    100% {
        background-color: transparent;
    }
}

tr.highlight td {
    font-weight: bold;
    transition: font-weight 1.5s ease-out;
}

/* Progress bar animation */
.progress-bar {
    transition: width 0.5s ease;
}

/* Show market icon only on desktop */
.market-icon.desktop-only {
    display: flex;
}

/* Hide market icon on mobile */
@media only screen and (max-width: 768px) {
    .market-icon.desktop-only {
        display: none !important;
    }

    /* Adjust the market pair container to account for missing icon */
    .market-pair-container {
        gap: 0.5rem;
    }
}

.market-link-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    text-decoration: none !important;
    /* This removes the underline */
}

.market-link-logo img {
    height: 100%;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.market-link-logo:hover img,
.market-link-logo:hover i {
    opacity: 1;
}

.market-link-logo i {
    font-size: 16px;
    color: var(--text-secondary);
    transition: color 0.2s;
    text-decoration: none !important;
    /* Ensures no underline on the icon */
}

.market-link-logo:hover i {
    color: var(--primary);
    text-decoration: none !important;
}

.market-links.desktop-only {
    display: flex;
}

/* Hide market links on mobile */
@media only screen and (max-width: 768px) {
    .market-links.desktop-only {
        display: none !important;
    }

    /* Adjust the market pair container to account for missing links */
    .market-pair-container {
        gap: 0.5rem;
    }
}

.market-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--bg-tertiary);
}

.market-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.market-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: bold;
    font-size: 0.75rem;
}

.dark-mode .market-icon {
    background-color: var(--bg-secondary);
}

.dark-mode .market-icon-fallback {
    background-color: var(--primary-dark);
    color: white;
}

/* Mobile adjustments */
@media only screen and (max-width: 768px) {
    .market-icon {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    .market-icon-fallback {
        font-size: 0.65rem;
    }
}

@media only screen and (max-width: 480px) {
    .market-icon {
        width: 18px;
        height: 18px;
        margin-right: 4px;
    }
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 0;
    padding-bottom: 2rem;
    /* Space for footer */
}

/* Header Styles */
.dashboard-header {
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--glass-border);
    transition: box-shadow 0.3s ease;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 1.25rem;
    color: var(--primary);
}

.header-left h1 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.header-left h1 span {
    color: var(--primary);
}

.breadcrumb {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.breadcrumb i {
    margin: 0 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Header Navigation */
.header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: 8px;
}

.header-nav .nav-link {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.header-nav .nav-link:hover {
    color: var(--text-primary);
    background-color: var(--hover-bg);
}

.header-nav .nav-link.active {
    color: var(--primary);
    background-color: var(--primary-light);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Favorite Button Styles */
.favorite-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.5rem;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    position: relative;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.favorite-btn:hover {
    background-color: rgba(var(--warning-rgb), 0.1);
}

.favorite-btn .fa-star {
    color: var(--warning);
}

.favorite-btn .far.fa-star {
    color: var(--text-secondary);
}

.favorite-btn:hover .far.fa-star {
    color: var(--warning);
}

.favorite-btn::before {
    content: attr(aria-label);
    position: absolute;
    top: -2.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--tooltip-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.favorite-btn:hover::before {
    opacity: 1;
}

/* Adjust market item layout */
.market-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
    position: relative;
}

.market-item:last-child {
    border-bottom: none;
}

.market-item:hover {
    background-color: var(--hover-bg);
}

.market-item.active {
    background-color: var(--active-bg);
    border-left: 2px solid var(--primary);
}

.market-name {
    flex: 1;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 0.5rem;
}

.market-price {
    width: 6rem;
    text-align: left;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    padding-left: 0.5rem;
}

.market-changeB {
    width: 5rem;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    margin-left: 0.2rem;
    font-family: 'Roboto Mono', monospace, 'Inter', sans-serif;
}

.market-change {
    width: 5rem;
    text-align: right;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-full);
    margin-left: 2.0rem !important;
}

.dark-mode .favorite-btn {
    color: var(--text-muted);
}

.dark-mode .favorite-btn:hover {
    background-color: rgba(var(--warning-rgb), 0.2);
}

/* Button Styles */
.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    outline: none;
    line-height: 1;
    white-space: nowrap;
}

.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: auto;
    border: 3px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
    from {
        transform: rotate(0turn);
    }

    to {
        transform: rotate(1turn);
    }
}

.btn-primary {
    background: var(--primary-gradient);
    color: #1e2329;
    box-shadow: var(--shadow-sm);
    font-weight: 600;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background-color: var(--primary-light);
    border-color: var(--primary-dark);
}

.btn-icon {
    padding: 0.5rem;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius-full);
    background-color: var(--primary-light);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ─── Binance-style Ticker Bar ─── */
.spot-ticker-bar {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 10px 20px;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border-light);
    font-size: 13px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 56px;
}

.spot-ticker-bar::-webkit-scrollbar {
    display: none;
}

.ticker-item.main-ticker {
    display: flex;
    align-items: center;
    gap: 14px;
    border-right: 1px solid var(--border-light);
    padding-right: 24px;
    flex-shrink: 0;
}

.pair-with-icon {
    display: flex;
    align-items: center;
    gap: 10px;
}

.market-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.market-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: #1e2329;
    font-weight: 700;
    font-size: 13px;
    border-radius: 50%;
}

.ticker-pair {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.ticker-price {
    font-size: 20px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    transition: color 0.3s ease;
}

.ticker-price.up {
    color: var(--success);
}

.ticker-price.down {
    color: var(--danger);
}

.ticker-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.ticker-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.stat-label {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}

.stat-value {
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
    font-size: 13px;
    color: var(--text-primary);
}

.stat-value.text-up,
.stat-value.positive {
    color: var(--success);
}

.stat-value.text-down,
.stat-value.negative {
    color: var(--danger);
}

/* ─── Trading Content Layout ─── */
.trading-content {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 1px;
    height: calc(100vh - 48px - 45px);
    /* Adjusted for ticker bar */
    background-color: var(--bg-tertiary);
}

.left-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    grid-column: 1;
    background-color: var(--bg-primary);
    border-right: 1px solid var(--border-light);
    overflow: hidden;
}

.chart-area {
    display: flex;
    flex-direction: column;
    min-width: 0;
    grid-column: 2;
    background-color: var(--bg-primary);
    overflow: hidden;
}

.right-column {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    grid-column: 3;
    background-color: var(--bg-primary);
    border-left: 1px solid var(--border-light);
    overflow-y: auto;
    /* Keep main column scrollable */
}

/* Left Column Tabbed UI */
.left-tabs-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Order Book Column Headers */
.order-book-columns {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background-color: var(--bg-primary);
}

.order-book-columns span:last-child {
    text-align: right;
}

.tabs-header {
    display: flex;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
    padding: 2px 4px 0;
}

.tab-btn {
    padding: 10px 16px;
    border: none;
    background: none;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-content {
    display: none;
    flex: 1;
    overflow: hidden;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
}

/* ─── Tabbed Order Forms ─── */
.trading-forms-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Tab Buttons */
.form-tabs {
    display: flex;
    padding: 0;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-light);
}

.form-tab {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-tab::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: transparent;
    border-radius: 2px 2px 0 0;
    transition: all 0.2s ease;
}

.form-tab[data-form-tab="buy"]:hover {
    color: var(--success);
    background: rgba(14, 203, 129, 0.04);
}

.form-tab[data-form-tab="sell"]:hover {
    color: var(--danger);
    background: rgba(246, 70, 93, 0.04);
}

.form-tab[data-form-tab="buy"].active {
    color: var(--success);
    background: rgba(14, 203, 129, 0.06);
}

.form-tab[data-form-tab="buy"].active::after {
    background: var(--success);
    left: 10%;
    right: 10%;
}

.form-tab[data-form-tab="sell"].active {
    color: var(--danger);
    background: rgba(246, 70, 93, 0.06);
}

.form-tab[data-form-tab="sell"].active::after {
    background: var(--danger);
    left: 10%;
    right: 10%;
}

/* Form Panels */
.trading-form-container {
    display: none;
    flex-direction: column;
    background-color: var(--bg-primary);
    padding: 14px;
}

.trading-form-container.active {
    display: flex;
}

.form-body {
    display: flex;
    flex-direction: column;
    overflow: visible;
    gap: 2px;
}

/* ─── Balance Display ─── */
.balance-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding: 7px 10px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
}

.balance-display .label {
    font-weight: 500;
    margin-right: auto;
}

.balance-display .value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 12px;
}

.balance-display .currency {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    background: var(--bg-primary);
    padding: 1px 5px;
    border-radius: 3px;
}

/* ─── Input Fields ─── */
.input-field {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 9px 12px;
    display: flex;
    align-items: center;
    margin-bottom: 0;
    border: 1px solid transparent;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.input-field:hover {
    border-color: var(--border-medium);
    background-color: color-mix(in srgb, var(--bg-tertiary) 90%, var(--bg-primary));
}

.input-field:focus-within {
    border-color: var(--primary);
    background-color: var(--bg-primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.buy-side .input-field:focus-within {
    border-color: var(--success);
    box-shadow: 0 0 0 2px rgba(14, 203, 129, 0.1);
}

.sell-side .input-field:focus-within {
    border-color: var(--danger);
    box-shadow: 0 0 0 2px rgba(246, 70, 93, 0.1);
}

.field-label {
    font-size: 11px;
    color: var(--text-muted);
    width: 48px;
    flex-shrink: 0;
    font-weight: 500;
}

.input-field input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
    outline: none;
    width: 0;
    min-width: 0;
}

.input-field input::placeholder {
    color: var(--text-muted);
    font-family: 'Roboto Mono', monospace;
    font-weight: 400;
    opacity: 0.6;
}

/* Hide number input spinners */
.input-field input[type="number"]::-webkit-outer-spin-button,
.input-field input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-field input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}

.field-suffix {
    font-size: 10px;
    color: var(--text-secondary);
    margin-left: 8px;
    min-width: 36px;
    text-align: right;
    font-weight: 700;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ─── Percent Selector ─── */
.percent-selector {
    display: flex;
    gap: 4px;
    margin: 8px 0;
    position: relative;
}

.percent-btn {
    flex: 1;
    padding: 5px 2px;
    font-size: 11px;
    font-weight: 600;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}

.percent-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background-color: var(--primary-light);
}

.buy-side .percent-btn:hover {
    border-color: var(--success);
    color: var(--success);
    background-color: rgba(14, 203, 129, 0.08);
}

.sell-side .percent-btn:hover {
    border-color: var(--danger);
    color: var(--danger);
    background-color: rgba(246, 70, 93, 0.08);
}

.percent-btn:active {
    transform: scale(0.95);
}

.percent-btn.active {
    background-color: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ─── Total Display ─── */
.total-display {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    margin-bottom: 10px;
    padding: 7px 10px;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    font-weight: 500;
}

.total-display .label {
    font-weight: 500;
    color: var(--text-muted);
    margin-right: auto;
}

.total-display .value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    color: var(--text-primary);
    font-size: 13px;
}

.total-display .currency {
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
}

/* ─── Execute Buttons ─── */
.btn-execute {
    width: 100%;
    padding: 11px 12px;
    border-radius: var(--radius-md);
    border: none;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
    margin-top: 2px;
}

.btn-execute.buy {
    background: linear-gradient(135deg, #0ecb81 0%, #0aa86b 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(14, 203, 129, 0.2);
}

.btn-execute.sell {
    background: linear-gradient(135deg, #f6465d 0%, #d63a4f 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(246, 70, 93, 0.2);
}

.btn-execute:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}

.btn-execute.buy:hover {
    box-shadow: 0 4px 20px rgba(14, 203, 129, 0.4);
}

.btn-execute.sell:hover {
    box-shadow: 0 4px 20px rgba(246, 70, 93, 0.4);
}

.btn-execute:active {
    transform: translateY(0);
    filter: brightness(0.95);
    box-shadow: none;
}

/* Mobile Bottom Nav — Premium */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
    z-index: 1000;
    justify-content: space-around;
    align-items: center;
    padding: 0 8px;
    padding-bottom: env(safe-area-inset-bottom);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    flex: 1;
    padding: 6px 0;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-item::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-item i {
    font-size: 1.1rem;
    transition: transform 0.2s ease;
}

.nav-item span {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.nav-item.active {
    color: var(--primary-dark);
}

.nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
}

.nav-item.active i {
    transform: translateY(-1px);
}

.nav-item:active {
    background: var(--hover-bg);
}

@media (max-width: 768px) {
    .trading-content {
        grid-template-columns: 1fr;
        height: calc(100vh - 120px);
        /* Header + Nav */
    }

    .left-column,
    .right-column {
        display: none;
    }

    .chart-area {
        grid-column: 1;
    }

    .mobile-nav {
        display: flex;
    }

    .main-content.view-trade .right-column {
        display: flex;
        grid-column: 1;
    }

    .main-content.view-trade .chart-area,
    .main-content.view-trade .left-column {
        display: none;
    }

    .main-content.view-book .left-column {
        display: flex;
        grid-column: 1;
    }

    .main-content.view-book .chart-area,
    .main-content.view-book .right-column {
        display: none;
    }

    .main-content.view-orders .left-column {
        display: flex;
        grid-column: 1;
    }

    .main-content.view-orders .chart-area,
    .main-content.view-orders .right-column {
        display: none;
    }
}

/* Card Styles */
.market-selector,
.order-book,
.recent-trades,
.open-orders,
.open-orders-mobile,
.chart-container {
    background-color: var(--bg-primary);
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid var(--border-light);
    transition: var(--transition);
}

.market-selector:hover,
.order-book:hover,
.recent-trades:hover,
.chart-container:hover {
    box-shadow: none;
}

/* ─── Market Selector ─── */
.market-selector {
    display: flex;
    flex-direction: column;
    max-height: 280px;
    overflow: hidden;
}

.market-selector-header {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-light);
}

.market-selector-header h3 {
    display: none;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 7px 30px 7px 10px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 12px;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
    background-color: var(--bg-primary);
}

.search-box input::placeholder {
    color: var(--text-muted);
    font-size: 12px;
}

.search-box i {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 12px;
}



/* Add this to your CSS */
.order-book-row.latest-update {
    animation: highlightUpdate 1s ease-out;
}

@keyframes highlightUpdate {
    0% {
        background-color: rgba(99, 102, 241, 0.3);
    }

    100% {
        background-color: transparent;
    }
}

.order-book-asks .order-book-row.latest-update {
    animation-name: highlightAskUpdate;
}

.order-book-bids .order-book-row.latest-update {
    animation-name: highlightBidUpdate;
}

@keyframes highlightAskUpdate {
    0% {
        background-color: rgba(239, 68, 68, 0.3);
    }

    100% {
        background-color: var(--orderbook-ask);
    }
}

@keyframes highlightBidUpdate {
    0% {
        background-color: rgba(16, 185, 129, 0.3);
    }

    100% {
        background-color: var(--orderbook-bid);
    }
}

.order-book .loading {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-style: italic;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin: 1rem;
}

/* Order book new order highlights */
.order-book-row.bid.new-order {
    background-color: rgba(5, 150, 105, 0.3) !important;
    animation: bidHighlight 3s ease-out forwards;
}

.order-book-row.ask.new-order {
    background-color: rgba(220, 38, 38, 0.3) !important;
    animation: askHighlight 3s ease-out forwards;
}

@keyframes bidHighlight {
    0% {
        background-color: rgba(5, 150, 105, 0.6);
    }

    100% {
        background-color: transparent;
    }
}

@keyframes askHighlight {
    0% {
        background-color: rgba(220, 38, 38, 0.6);
    }

    100% {
        background-color: transparent;
    }
}

/* Make loading message more visible */
.order-book .loading {
    text-align: center;
    padding: 1rem;
    color: var(--text-muted);
    font-style: italic;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin: 1rem;
}

.order-book-row.latest-update {
    animation: debugHighlight 2s ease-out;
}

/* ─── Market List ─── */
.market-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

.market-list::-webkit-scrollbar {
    width: 3px;
}

.market-list::-webkit-scrollbar-track {
    background: transparent;
}

.market-list::-webkit-scrollbar-thumb {
    background-color: var(--border-light);
    border-radius: 3px;
}

.market-item {
    display: flex;
    align-items: center;
    padding: 6px 12px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    gap: 8px;
}

.market-item:hover {
    background-color: var(--hover-bg);
}

.market-item.active {
    background-color: var(--active-bg);
    border-left: 2px solid var(--primary);
    padding-left: 10px;
}

.market-item .favorite-btn {
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    font-size: 11px;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s ease;
}

.market-item:hover .favorite-btn,
.market-item .favorite-btn:hover {
    opacity: 1;
}

.market-item .market-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.market-item .market-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.market-item .market-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: #fff;
    font-weight: 700;
    font-size: 10px;
    border-radius: 50%;
}

.market-name {
    flex: 1;
    font-weight: 600;
    font-size: 12px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.01em;
}

.market-changeB {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 52px;
    text-align: center;
    font-family: 'Roboto Mono', monospace;
    flex-shrink: 0;
}

.market-changeB.positive {
    background-color: rgba(14, 203, 129, 0.12);
    color: var(--success);
}

.market-changeB.negative {
    background-color: rgba(246, 70, 93, 0.12);
    color: var(--danger);
}

.loading-markets {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-muted);
    gap: 0.5rem;
}

.loading-markets i {
    font-size: 1.25rem;
    animation: spin 1s linear infinite;
}

.order-book-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 400px;
    max-height: 550px;
    overflow: hidden;
    position: relative;
}

.order-book {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.order-book-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.order-book-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.order-book-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.order-book-depth {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.75rem;
    outline: none;
    transition: var(--transition);
}

.order-book-depth:focus {
    border-color: var(--primary);
}

.order-book-content {
    display: grid;
    grid-template-rows: 1fr auto 1fr;
    height: 100%;
    overflow: hidden;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.order-book-content::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}

.order-book-asks {
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column-reverse;
}

.order-book-asks,
.order-book-bids {
    overflow-y: scroll;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
    padding-right: 10px;
    /* Add some padding to prevent content clipping */
    margin-right: -10px;
    /* Counteract the padding */
}

.order-book-asks::-webkit-scrollbar,
.order-book-bids::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and*/
}

/* ─── Order Book Rows with Depth Bars ─── */
.order-book-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 2px 12px;
    font-size: 12px;
    position: relative;
    cursor: pointer;
    line-height: 18px;
    font-family: 'Roboto Mono', monospace;
}

.order-book-row:hover {
    background-color: var(--hover-bg);
}

.depth-bar {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 0;
    opacity: 0.15;
    transition: width 0.3s ease;
}

.ask .depth-bar {
    background-color: var(--danger);
}

.bid .depth-bar {
    background-color: var(--success);
}

.order-book-price,
.order-book-amount,
.order-book-total {
    position: relative;
    z-index: 1;
}

.ask .order-book-price {
    color: var(--danger);
}

.bid .order-book-price {
    color: var(--success);
}

.order-book-total {
    text-align: right;
    color: var(--text-secondary);
}

.order-book-bids .order-book-row:hover {
    background-color: var(--hover-bg);
}

.order-book-price {
    font-weight: 500;
    text-align: left;
}

.order-book-asks .order-book-price {
    color: var(--danger);
}

.order-book-bids .order-book-price {
    color: var(--success);
}

.order-book-amount {
    color: var(--text-muted);
    text-align: center;
}

.order-book-total {
    text-align: right;
}

.order-book-spread {
    text-align: center;
    padding: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin: 0;
    flex-shrink: 0;
}

.spread-label {
    font-weight: 500;
}

.spread-value {
    font-weight: 600;
}

/* Chart Container */
.chart-container {
    height: 100%;
    min-height: 400px;
    max-height: 600px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.chart-header {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    border-bottom: 1px solid var(--border-light);
}

.market-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 1rem;
    flex-wrap: wrap;
}

.market-pair-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1;
}

.market-pair {
    font-weight: 700;
    font-size: 1.25rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: nowrap;
}

.market-price {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.market-change-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.market-changeB-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.market-change {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
    display: inline-block;
}

.market-change.positive {
    background-color: var(--success-light);
    color: var(--success);
}

.market-change.negative {
    background-color: var(--danger-light);
    color: var(--danger);
}

.market-changeB {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    white-space: nowrap;
    display: inline-block;
}

.market-changeB.positive {
    background-color: var(--success-light);
    color: var(--success);
}

.market-changeB.negative {
    background-color: var(--danger-light);
    color: var(--danger);
}

@keyframes flashGreen {
    0% {
        background-color: var(--success-light);
    }

    100% {
        background-color: transparent;
    }
}

@keyframes flashRed {
    0% {
        background-color: var(--danger-light);
    }

    100% {
        background-color: transparent;
    }
}

.market-change.up {
    animation: flashGreen 1s ease-in-out;
}

.market-change.down {
    animation: flashRed 1s ease-in-out;
}

.market-stats {
    width: 100%;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
}

.stat-label {
    color: var(--text-muted);
}

.stat-value {
    font-weight: 500;
    color: var(--text-primary);
}

.stat-currency {
    color: var(--text-muted);
    font-size: 0.6875rem;
}

.chart-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.chart-intervals {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.interval-btn {
    padding: 0.3rem 0.6rem;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.6875rem;
    font-weight: 500;
    transition: var(--transition);
}

.interval-btn:hover {
    background-color: var(--hover-bg);
    color: var(--text-primary);
}

.interval-btn.active {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 2px 6px var(--primary-glow);
}

.chart-actions {
    display: flex;
    gap: 0.5rem;
}

.chart-wrapper {
    flex: 1;
    position: relative;
    min-height: 300px;
    overflow: hidden;
}

.chart-action-btn {
    padding: 5px 8px;
    border: 1px solid var(--border-light);
    border-radius: 4px;
    background-color: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.chart-action-btn:hover {
    background-color: var(--hover-bg);
}

#price-chart {
    width: 100% !important;
    height: 100% !important;
}

/* Order Forms Container */
.order-forms-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}

.buy-order-form,
.sell-order-form {
    background-color: var(--bg-primary);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: none;
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.buy-order-form {
    border-top: 2px solid var(--success);
}

.buy-order-form:hover {
    border-color: var(--border-medium);
    border-top-color: var(--success);
}

.sell-order-form {
    border-top: 2px solid var(--danger);
}

.sell-order-form:hover {
    border-color: var(--border-medium);
    border-top-color: var(--danger);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.form-header h3 {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-header.buy h3 {
    color: var(--success);
}

.form-header.sell h3 {
    color: var(--danger);
}

.form-header h3 i {
    font-size: 0.9rem;
}

.balance-info {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
}

.balance-label {
    color: var(--text-muted);
}

.balance-value {
    font-weight: 500;
}

.balance-currency {
    color: var(--text-muted);
    font-weight: 500;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
    background-color: var(--bg-primary);
}

.input-currency {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.form-actions {
    margin-top: 20px;
}

.btn-buy,
.btn-sell {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
}

.btn-buy {
    background: var(--success-gradient);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

.btn-buy:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-buy:active {
    transform: translateY(0);
}

.btn-sell {
    background: var(--danger-gradient);
    color: white;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

.btn-sell:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-sell:active {
    transform: translateY(0);
}

.form-percentages {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    gap: 5px;
}

.percent-btn {
    flex: 1;
    padding: 6px;
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    background-color: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: var(--transition);
}

.percent-btn:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
}

/* Recent Trades */
.recent-trades {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.trades-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.trades-header h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.trades-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trades-table-container {
    overflow-x: auto;
    flex: 1;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.trades-table-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari and Opera */
}


.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.trades-table th {
    text-align: left;
    padding: 0.25rem 0.5rem;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.75rem;
    white-space: nowrap;
}

.trades-table td {
    padding: 0.15rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.trades-table tr:last-child td {
    border-bottom: none;
}

.no-trades {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.buy-trade td:first-child {
    color: var(--success);
}

.sell-trade td:first-child {
    color: var(--danger);
}

/* Open Orders */
.open-orders,
.open-orders-mobile {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-light);
}

.orders-header h3 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.orders-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.open-orders {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 200px;
    max-height: 250px;
    overflow: hidden;
}

.orders-table-container {
    flex: 1;
    overflow-y: auto;
    position: relative;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.orders-table-container::-webkit-scrollbar {
    display: none;
}

.order-book-content,
.trades-table-container,
.orders-table-container {
    padding: 0 10px;
    margin: 0 -10px;
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: fixed;
}

.orders-table th {
    position: sticky;
    top: 0;
    background-color: var(--bg-primary);
    z-index: 10;
    text-align: left;
    padding: 8px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.orders-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.orders-table tr:last-child td {
    border-bottom: none;
}

.no-orders {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
}

.order-action {
    color: var(--primary);
    cursor: pointer;
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.order-action:hover {
    text-decoration: underline;
}

@keyframes priceUp {
    0% {
        color: inherit;
        background-color: transparent;
    }

    50% {
        color: #10b981;
        background-color: rgba(16, 185, 129, 0.1);
    }

    100% {
        color: inherit;
        background-color: transparent;
    }
}

@keyframes priceDown {
    0% {
        color: inherit;
        background-color: transparent;
    }

    50% {
        color: #ef4444;
        background-color: rgba(239, 68, 68, 0.1);
    }

    100% {
        color: inherit;
        background-color: transparent;
    }
}

#market-price.up {
    animation: priceUp 1s ease-in-out;
}

#market-price.down {
    animation: priceDown 1s ease-in-out;
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

/* Refresh Button */
.refresh-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.refresh-btn:hover {
    background-color: var(--hover-bg);
    color: var(--primary);
}

/* Modal */
.modalO {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modalO.show {
    display: flex;
    opacity: 1;
}

.modalO-content {
    background-color: var(--bg-primary);
    border-radius: var(--radius-2xl);
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modalO.show .modalO-content {
    transform: translateY(0);
}

.modalO-header {
    padding: 15px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modalO-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
}

.modalO-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.modalO-close:hover {
    color: var(--danger);
}

.modalO-body {
    padding: 15px;
}

.order-confirm-details {
    margin-bottom: 20px;
}

.confirm-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-light);
}

.confirm-row:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.confirm-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.confirm-value {
    font-weight: 500;
    font-size: 0.95rem;
}

.modalO-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 15px 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--border-light);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 12px;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    font-size: 1.2rem;
}

.toast-icon.fa-check-circle {
    color: var(--success);
}

.toast-icon.fa-exclamation-circle {
    color: var(--danger);
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Alerts */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.alert-danger {
    background-color: var(--danger-light);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.alert-success {
    background-color: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-lg);
}

.loading-spinner {
    animation: spin 1s linear infinite;
    font-size: 2rem;
    color: var(--primary);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Skeleton loading animations */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton-text {
    display: inline-block;
    width: 60px;
    height: 14px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    vertical-align: middle;
}

.skeleton-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    gap: 8px;
}

.skeleton-row span {
    display: inline-block;
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    flex: 1;
}

.skeleton-row span:first-child {
    max-width: 70px;
}

.skeleton-row span:nth-child(2) {
    max-width: 60px;
}

.skeleton-row span:last-child {
    max-width: 80px;
}

.skeleton-trade td {
    padding: 6px 8px;
}

.skeleton-trade td span {
    display: inline-block;
    width: 50px;
    height: 12px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--skeleton-base) 25%, var(--skeleton-shine) 50%, var(--skeleton-base) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .trading-content {
        grid-template-columns: 240px 1fr 260px;
    }
}

@media (max-width: 992px) {
    .trading-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
    }

    .left-column {
        grid-row: 1;
        grid-column: 1;
        border-right: none;
    }

    .chart-area {
        grid-row: 2;
        grid-column: 1;
    }

    .right-column {
        grid-row: 3;
        grid-column: 1;
        border-left: none;
    }

    .open-orders-mobile {
        display: block;
    }

    .right-column .open-orders {
        display: none;
    }

    .chart-wrapper {
        min-height: 300px;
    }

    .market-selector {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        padding: 10px;
    }

    .header-left,
    .header-right {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }

    .chart-intervals {
        flex-wrap: wrap;
        justify-content: center;
    }

    .interval-btn {
        padding: 5px 8px;
        font-size: 12px;
    }

    .orders-table th,
    .orders-table td,
    .trades-table th,
    .trades-table td {
        padding: 6px;
        font-size: 12px;
    }

    .orders-table th:nth-child(1),
    .orders-table td:nth-child(1),
    .orders-table th:nth-child(6),
    .orders-table td:nth-child(6) {
        display: none;
    }

    .order-book-row:hover {
        background-color: rgba(0, 0, 0, 0.05);
    }

    .dark-mode .order-book-row:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }

    .form-group input {
        padding: 8px;
    }

    .percent-btn {
        padding: 4px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {

    .orders-table th:nth-child(4),
    .orders-table td:nth-child(4) {
        display: none;
    }

    .btn-buy,
    .btn-sell {
        padding: 8px;
        font-size: 14px;
    }

    .market-info {
        flex-direction: column;
        align-items: flex-start;
    }

    .market-stats {
        flex-direction: column;
        gap: 5px;
    }
}

/* Dark mode toggle animation */
.dark-mode-toggle {
    transition: var(--transition);
}

.dark-mode-toggle:hover {
    transform: rotate(30deg);
}

/* Monospace font for numbers */
.order-book-price,
.order-book-amount,
.order-book-total {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.trades-table td,
.orders-table td,
.market-price,
.market-change,
.stat-value,
.input-group input,
.confirm-value {
    font-family: 'Roboto Mono', monospace, 'Inter', sans-serif;
}

/* Market icon styles */
.market-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 8px;
    flex-shrink: 0;
    overflow: hidden;
    background-color: var(--bg-tertiary);
}

.market-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.market-icon-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--primary-light);
    color: var(--primary);
    font-weight: bold;
    font-size: 0.75rem;
}

.dark-mode .market-icon {
    background-color: var(--bg-secondary);
}

.dark-mode .market-icon-fallback {
    background-color: var(--primary-dark);
    color: white;
}

/* Mobile adjustments */
@media only screen and (max-width: 768px) {
    .market-icon {
        width: 20px;
        height: 20px;
        margin-right: 6px;
    }

    .market-icon-fallback {
        font-size: 0.65rem;
    }
}

@media only screen and (max-width: 480px) {
    .market-icon {
        width: 18px;
        height: 18px;
        margin-right: 4px;
    }
}

/* Footer Styles */
.footer {
    background-color: var(--bg-primary);
    border-top: 1px solid var(--border-light);
    padding: 2rem 1rem;
    margin-top: auto;
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    text-decoration: none;
}

.footer-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-gradient);
    color: white;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.footer-logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-logo-text span {
    color: var(--primary);
}

.footer-description {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
}

.social-link {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-link:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

.footer-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-link a:hover {
    color: var(--primary);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-legal-links {
    display: flex;
    gap: 1.5rem;
}

.footer-legal-link a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-legal-link a:hover {
    color: var(--primary);
}

.app-download p {
    margin: 1.5rem 0 0.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.app-buttons {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.app-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.8rem;
    transition: var(--transition);
}

.app-btn:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.footer-newsletter {
    max-width: 300px;
}

.newsletter-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0 1rem;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.newsletter-form input {
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.payment-methods {
    margin-top: 1.5rem;
}

.payment-methods p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.payment-icons {
    display: flex;
    gap: 0.75rem;
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Dark mode footer adjustments */
.dark-mode .footer {
    background-color: var(--bg-secondary);
    border-top-color: var(--border-medium);
}

.dark-mode .footer-description,
.dark-mode .footer-link a,
.dark-mode .footer-legal-link a,
.dark-mode .app-download p,
.dark-mode .newsletter-text,
.dark-mode .payment-methods p {
    color: var(--text-muted);
}

.dark-mode .social-link {
    background-color: var(--bg-tertiary);
}

/* Responsive footer adjustments */
@media (max-width: 1024px) {
    .footer-container {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer-about,
    .footer-newsletter {
        grid-column: span 3;
    }
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-about,
    .footer-newsletter {
        grid-column: span 2;
    }
}

@media (max-width: 480px) {
    .footer-container {
        grid-template-columns: 1fr;
    }

    .footer-about,
    .footer-newsletter {
        grid-column: span 1;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .footer-legal-links {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.order-book-row.order-update {
    animation: orderUpdateHighlight 4s ease-out;
}

@keyframes orderUpdateHighlight {
    0% {
        background-color: rgba(99, 102, 241, 0.3);
    }

    100% {
        background-color: transparent;
    }
}

.order-book-row.ask.order-update {
    animation-name: askOrderUpdateHighlight;
    animation-duration: 4s;
}


.order-book-row.bid.order-update {
    animation-name: bidOrderUpdateHighlight;
    animation-duration: 4s;
}

@keyframes askOrderUpdateHighlight {
    0% {
        background-color: rgba(239, 68, 68, 0.3);
    }

    100% {
        background-color: var(--orderbook-ask);
    }
}

@keyframes bidOrderUpdateHighlight {
    0% {
        background-color: rgba(16, 185, 129, 0.3);
    }

    100% {
        background-color: var(--orderbook-bid);
    }
}

.order-book-row.order-update .order-book-price,
.order-book-row.order-update .order-book-amount,
.order-book-row.order-update .order-book-total {
    font-weight: bold;
    transition: font-weight 3s ease-out;
}

.order-book-row.ask.order-update .order-book-price {
    color: var(--danger);
}

.order-book-row.bid.order-update .order-book-price {
    color: var(--success);
}

/* Balance Notifications */
.balance-notifications {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.balance-notification {
    padding: 12px 16px;
    border-radius: 8px;
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease-out;
    transition: opacity 0.3s;
}

.balance-notification.positive {
    border-left: 4px solid var(--success);
}

.balance-notification.negative {
    border-left: 4px solid var(--danger);
}

.balance-notification .currency {
    font-weight: bold;
    color: var(--text-primary);
}

.balance-notification .amount {
    font-family: monospace;
}

.balance-notification.positive .amount {
    color: var(--success);
}

.balance-notification.negative .amount {
    color: var(--danger);
}

.balance-notification.fade-out {
    opacity: 0;
}

/* Market volume animations */
.market-volume {
    transition: all 0.3s ease;
}

/* Market volume update */
.market-volume.volume-update {
    color: var(--primary);
    font-weight: bold;
    animation: volumePulse 0.8s ease;
}

@keyframes volumePulse {
    0% {
        transform: scale(1);
        color: inherit;
    }

    50% {
        transform: scale(1.1);
        color: var(--primary);
    }

    100% {
        transform: scale(1);
        color: inherit;
    }
}

/* ─── Auth / Login Buttons ─── */
.btn-execute.buy-login,
.btn-execute.sell-login {
    opacity: 0.85;
}

.btn-execute.buy-login:hover,
.btn-execute.sell-login:hover {
    opacity: 1;
}

.header-actions .auth-buttons .btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    border: none;
    font-weight: 600;
    font-size: 13px;
    padding: 6px 16px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    letter-spacing: 0.02em;
}

.header-actions .auth-buttons .btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.header-actions .auth-buttons .btn-primary i {
    font-size: 12px;
}

/* Ensure market items don't exceed container */
.market-item {
    max-width: 100%;
}