:root {
    --primary: #6366f1;
    --primary-light: rgba(99, 102, 241, 0.1);
    --primary-dark: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    
    --success: #10b981;
    --success-light: rgba(16, 185, 129, 0.1);
    --success-dark: #0e9f7a;
    --success-gradient: linear-gradient(135deg, #10b981 0%, #14b8a6 100%);
    
    --danger: #ef4444;
    --danger-light: rgba(239, 68, 68, 0.1);
    --danger-dark: #d13b3b;
    --danger-gradient: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    
    --warning: #f59e0b;
    --info: #3b82f6;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    
    --border-light: #e5e7eb;
    --border-medium: #d1d5db;
    --border-dark: #9ca3af;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    --hover-bg: rgba(0, 0, 0, 0.02);
    --active-bg: rgba(99, 102, 241, 0.1);
    
    --orderbook-ask: rgba(239, 68, 68, 0.08);
    --orderbook-bid: rgba(16, 185, 129, 0.08);
    
    --chart-bg: #ffffff;
    --chart-grid: rgba(0, 0, 0, 0.05);
    --chart-tooltip-bg: #ffffff;
    --chart-tooltip-border: #e5e7eb;
    --chart-line: #6366f1;
    --chart-fill: rgba(99, 102, 241, 0.1);
    
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    --radius-sm: 0.25rem;
    --radius-md: 0.375rem;
    --radius-lg: 0.5rem;
    --radius-xl: 0.75rem;
    --radius-full: 9999px;
}

.dark-mode {
    --primary: #818cf8;
    --primary-light: rgba(129, 140, 248, 0.1);
    --primary-dark: #6366f1;
    --primary-gradient: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
    
    --success: #34d399;
    --success-light: rgba(52, 211, 153, 0.1);
    --success-dark: #10b981;
    
    --danger: #f87171;
    --danger-light: rgba(248, 113, 113, 0.1);
    --danger-dark: #ef4444;
    
    --warning: #fbbf24;
    --info: #60a5fa;
    
    --text-primary: #f8fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #94a3b8;
    
    --border-light: #334155;
    --border-medium: #475569;
    --border-dark: #64748b;
    
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #020617;
    
    --hover-bg: rgba(255, 255, 255, 0.05);
    --active-bg: rgba(129, 140, 248, 0.2);
    
    --orderbook-ask: rgba(248, 113, 113, 0.1);
    --orderbook-bid: rgba(52, 211, 153, 0.1);
    
    --chart-bg: #1e293b;
    --chart-grid: rgba(255, 255, 255, 0.05);
    --chart-tooltip-bg: #1e293b;
    --chart-tooltip-border: #334155;
    --chart-line: #818cf8;
    --chart-fill: rgba(129, 140, 248, 0.1);
}

* {
    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;
}

/* Monospace font for numbers */
.order-book-price,
.order-book-amount,
.order-book-total,
.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;
}

.dashboard-container {
    display: block;
    min-height: 100vh;
}

.main-content {
    padding: 0;
}

.modalO .error-message {
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modalO .error-message i {
    font-size: 18px;
}

/* Header Styles */
.dashboard-header {
    padding: 0.75rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--bg-primary);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-light);
}

.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);
}

.loading {
    padding: 10px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.loading-trades td {
    text-align: center;
    color: #999;
    font-style: italic;
}

.header-left h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.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-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 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: white;
    box-shadow: var(--shadow-sm);
}

.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;
}

.btn-icon:hover {
    background-color: var(--primary);
    color: white;
}

.trading-content {
    display: grid;
    grid-template-columns: 18rem 1fr 18rem;
    grid-template-rows: 1fr;
    gap: 1rem;
    height: calc(100vh - 4rem);
    padding: 1rem;
    transition: var(--transition);
}

.left-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    grid-column: 1;
}

.chart-area {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
    grid-column: 2;
}

.right-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    grid-column: 3;
}

/* Card Styles */
.market-selector,
.order-book,
.recent-trades,
.open-orders,
.open-orders-mobile,
.chart-container,
.buy-order-form,
.sell-order-form {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

/* Market Selector */
.market-selector {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.market-selector-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.market-selector-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 2rem 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-light);
}

.search-box i {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.875rem;
}

.market-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.market-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 1px solid var(--border-light);
}

.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;
}

.market-price {
    width: 6rem;
    text-align: right;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--text-primary);
    padding-left: 0.5rem;
}

.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: 0.5rem;
}

.market-change.positive {
    background-color: var(--success-light);
    color: var(--success);
}

.market-change.negative {
    background-color: var(--danger-light);
    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 */
.order-book-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 400px; /* Minimum height */
    max-height: 550px; /* Maximum height */
    overflow: hidden;
}

.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.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.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; /* Equal space for asks, spread, and bids */
    height: 100%;
    overflow: hidden;
}

.order-book-asks,
.order-book-bids {
    overflow-y: auto;
    min-height: 0; /* Important for grid items to respect the grid sizing */
}

.order-book-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 0.35rem 0.5rem;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    gap: 0.5rem;
    transition: var(--transition);
}

.order-book-asks .order-book-row {
    background-color: var(--orderbook-ask);
}

.order-book-asks .order-book-row:hover {
    background-color: rgba(239, 68, 68, 0.15);
}

.order-book-bids .order-book-row {
    background-color: var(--orderbook-bid);
}

.order-book-bids .order-book-row:hover {
    background-color: rgba(16, 185, 129, 0.15);
}

.order-book-price {
    font-weight: 500;
    text-align: left;
}

.order-book-amount {
    color: var(--text-muted);
    text-align: center;
}

.order-book-total {
    text-align: right;
}

.order-book-spread {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
    margin: 0.25rem 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);
}

/* Updated Market Info Section */
.market-info {
    display: flex;
    align-items: center;
    justify-content: space-between; /* This pushes elements apart */
    width: 100%; /* Ensure it takes full width */
    gap: 1rem;
    flex-wrap: wrap;
}

.market-pair-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-grow: 1; /* Allow it to take available space */
}

.market-pair {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    white-space: nowrap;
}

.market-price {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--text-primary);
    white-space: nowrap;
}

.market-change-container {
    margin-left: auto; /* This pushes it to the far right */
    padding-left: 1rem; /* Add some spacing from price */
}

.market-change {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem; /* Slightly wider padding */
    border-radius: var(--radius-full);
    white-space: nowrap;
    display: inline-block;
}

/* Rest of your existing market-change styles... */
.market-change.positive {
    background-color: var(--success-light);
    color: var(--success);
}

.market-change.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;
}

/* Adjust market stats to not interfere */
.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.25rem 0.5rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background-color: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.6875rem;
    font-weight: 500;
    transition: var(--transition);
}

.interval-btn:hover {
    background-color: var(--hover-bg);
}

.interval-btn.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
}

.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: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.buy-order-form, 
.sell-order-form {
    background-color: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 15px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    transition: var(--transition);
}

.buy-order-form {
    border-top: 3px solid var(--success);
}

.sell-order-form {
    border-top: 3px solid var(--danger);
}

.form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.form-header h3 {
    margin: 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-header.buy h3 {
    color: var(--success);
}

.form-header.sell h3 {
    color: var(--danger);
}

.form-header h3 i {
    font-size: 1rem;
}

.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;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    background-color: var(--bg-primary);
    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 2px var(--primary-light);
}

.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-color: var(--success);
    color: white;
}

.btn-buy:hover {
    background-color: var(--success-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-sell {
    background-color: var(--danger);
    color: white;
}

.btn-sell:hover {
    background-color: var(--danger-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.form-percentages {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
    gap: 5px;
}

.percent-btn {
    flex: 1;
    padding: 6px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background-color: transparent;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.percent-btn:hover {
    background-color: var(--hover-bg);
}

/* Recent Trades */
.recent-trades {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    min-height: 200px; /* Minimum height */ 
    max-height: 575px;
}

.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.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.trades-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trades-table-container {
    overflow-x: auto;
    flex: 1;
}

.trades-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.trades-table th {
    text-align: left;
    padding: 8px;
    color: var(--text-muted);
    font-weight: 500;
    border-bottom: 1px solid var(--border-light);
    white-space: nowrap;
}

.trades-table td {
    padding: 8px;
    border-bottom: 1px solid var(--border-light);
    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: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.orders-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.orders-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.open-orders {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 200px; /* Minimum height */
    max-height: 250px; /* Maximum height or use vh units */
    overflow: hidden;
}

.orders-table-container {
    flex: 1;
    overflow-y: auto; /* Enable vertical scrolling */
    position: relative; /* For absolute positioning if needed */
}

.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    table-layout: fixed; /* Helps with consistent column widths */
}


.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;
}
@media (max-width: 768px) {
    .open-orders {
        max-height: 300px; /* Smaller max-height on mobile */
    }
    
    .orders-table th, 
    .orders-table td {
        padding: 6px;
        font-size: 12px;
    }
}

.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);
}

.buy-trade td:first-child {
    color: var(--success);
}

.sell-trade td:first-child {
    color: var(--danger);
}

.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-lg);
    width: 400px;
    max-width: 90%;
    box-shadow: var(--shadow-lg);
    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-lg);
    padding: 15px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-light);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 10px;
}

.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 15px;
    border-radius: var(--radius-md);
    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); }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .trading-content {
        grid-template-columns: 240px 1fr 240px;
    }
}

@media (max-width: 992px) {
    .trading-content {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
    }
    
    .left-column {
        grid-row: 1;
    }
    
    .chart-area {
        grid-row: 2;
    }
    
    .right-column {
        grid-row: 3;
    }
    
    /* Show mobile open orders and hide desktop version */
    .open-orders-mobile {
        display: block;
    }
    
    .right-column .open-orders {
        display: none;
    }
    
    /* Adjust chart height */
    .chart-wrapper {
        min-height: 300px;
    }
    
    /* Simplify order forms layout */
    .order-forms-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    /* Adjust market selector */
    .market-selector {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    /* Simplify header */
    .dashboard-header {
        flex-direction: column;
        padding: 10px;
    }
    
    .header-left, .header-right {
        width: 100%;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    /* Adjust chart intervals */
    .chart-intervals {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .interval-btn {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    /* Simplify tables for mobile */
    .orders-table th, 
    .orders-table td,
    .trades-table th,
    .trades-table td {
        padding: 6px;
        font-size: 12px;
    }
    
    /* Hide less important columns on mobile */
    .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;
    }
    
    /* Make order book more compact */
    .order-book-row {
        cursor: pointer;
        transition: background-color 0.2s;
    }
    
    .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);
    }
    
    /* Adjust form inputs */
    .form-group input {
        padding: 8px;
    }
    
    .percent-btn {
        padding: 4px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    /* Further simplify tables */
    .orders-table th:nth-child(4),
    .orders-table td:nth-child(4) {
        display: none;
    }
    
    /* Make buttons smaller */
    .btn-buy, .btn-sell {
        padding: 8px;
        font-size: 14px;
    }
    
    /* Adjust market info */
    .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);
}