:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: #1a1f2e;
    --bg-elevated: #242b3d;
    --accent-primary: #00d4aa;
    --accent-secondary: #6366f1;
    --color-positive: #22c55e;
    --color-negative: #ef4444;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-color: #2d3748;
    --border-light: #374151;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;
    --transition: 200ms ease-out;
    --font-main: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'IBM Plex Mono', monospace;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    min-height: 100vh;
    min-height: 100dvh;
}

#app {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    position: relative;
}

.hidden {
    display: none !important;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--color-positive);
    border-radius: var(--radius-md);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.3s ease-out;
}

.toast i {
    color: var(--color-positive);
    font-size: 1.25rem;
}

.toast span {
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-weight: 500;
}

.toast.error {
    border-color: var(--color-negative);
}

.toast.error i {
    color: var(--color-negative);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

.toast.hiding {
    animation: slideUp 0.3s ease-out forwards;
}

/* ===== AUTH STYLES ===== */
.page-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 212, 170, 0.1) 0%, transparent 50%),
        var(--bg-primary);
}

.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 32px;
}

.auth-logo i {
    font-size: 2rem;
    color: var(--accent-primary);
}

.auth-logo span {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-form h2 {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-group input,
.input-group select {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9375rem;
    transition: var(--transition);
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

.input-group input::placeholder {
    color: var(--text-muted);
}

.input-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-primary);
}

.terms {
    margin-bottom: 20px;
}

.forgot-link {
    font-size: 0.8125rem;
    color: var(--accent-primary);
    text-decoration: none;
}

.forgot-link:hover {
    text-decoration: underline;
}

.btn-primary {
    width: 100%;
    height: 48px;
    background: var(--accent-primary);
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #00e6b8;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    width: 100%;
    height: 44px;
    background: transparent;
    color: var(--accent-primary);
    border: 1px solid var(--accent-primary);
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: rgba(0, 212, 170, 0.1);
}

.btn-lg {
    height: 52px;
    font-size: 1rem;
    padding: 0 28px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-switch a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* ===== MAIN APP LAYOUT ===== */
#main-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.top-nav {
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 100;
}

.nav-left {
    display: flex;
    align-items: center;
}

.nav-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-right {
    display: flex;
    align-items: center;
}

.nav-left .logo,
.nav-center .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
}

.nav-left .logo i,
.nav-center .logo i {
    color: var(--accent-primary);
}

.nav-left .logo span,
.nav-center .logo span {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-icon-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.nav-icon-btn:hover {
    background: var(--bg-elevated);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}

.user-balance {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    font-size: 0.8125rem;
}

.balance-label {
    color: var(--text-secondary);
}

.balance-value {
    color: var(--accent-primary);
    font-weight: 600;
    font-family: var(--font-mono);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 16px;
    padding-bottom: 80px;
}

.page {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== BOTTOM NAVIGATION ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.75rem;
}

.nav-item i {
    font-size: 1.25rem;
}

.nav-item.active {
    color: var(--accent-primary);
}

.nav-item:hover {
    color: var(--text-secondary);
}

/* ===== HOME PAGE ===== */
.hero {
    text-align: center;
    padding: 24px 0 32px;
}

.hero-content h1 {
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}

.highlight {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 500px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: transparent;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px 24px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
}

/* Market Ticker */
.market-overview {
    margin: 32px 0;
}

.market-overview h2 {
    font-size: 1.125rem;
    margin-bottom: 16px;
}

.market-ticker {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}

.ticker-item {
    flex-shrink: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    min-width: 140px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ticker-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
}

.ticker-info {
    flex: 1;
    min-width: 0;
}

.ticker-symbol {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ticker-price {
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.ticker-change {
    font-size: 0.75rem;
    font-weight: 500;
}

.ticker-change.positive {
    color: var(--color-positive);
}

.ticker-change.negative {
    color: var(--color-negative);
}

/* News Section */
.news-section {
    margin: 32px 0;
}

.news-section h2 {
    font-size: 1.125rem;
    margin-bottom: 16px;
}

.news-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
}

.news-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.news-thumb {
    width: 100%;
    height: 140px;
    object-fit: cover;
    background: var(--bg-elevated);
}

.news-content {
    padding: 14px;
}

.news-title {
    font-size: 0.9375rem;
    font-weight: 600;
    margin-bottom: 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Features Section */
.features-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin: 40px 0;
}

.feature {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: rgba(0, 212, 170, 0.1);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.feature h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.feature p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ===== MARKET PAGE ===== */
.market-list-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.market-table-header {
    display: grid;
    grid-template-columns: 40px 1.5fr 1fr 1fr 80px 1fr;
    padding: 12px 16px;
    background: var(--bg-elevated);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.market-list {
    max-height: calc(100vh - 280px);
    overflow-y: auto;
}

.market-row {
    display: grid;
    grid-template-columns: 40px 1.5fr 1fr 1fr 80px 1fr;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.market-row:hover {
    background: var(--bg-elevated);
}

.market-row:last-child {
    border-bottom: none;
}

.coin-rank {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.coin-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.coin-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.coin-name {
    font-weight: 600;
    font-size: 0.9375rem;
}

.coin-symbol {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.coin-price {
    font-family: var(--font-mono);
    font-weight: 500;
    font-size: 0.9375rem;
}

.coin-change {
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-mono);
}

.coin-change.positive {
    color: var(--color-positive);
}

.coin-change.negative {
    color: var(--color-negative);
}

.coin-chart {
    width: 80px;
    height: 32px;
}

.coin-mcap {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* ===== TRADE PAGE ===== */
.trade-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
}

.pair-selector {
    position: relative;
}

.pair-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.pair-btn:hover {
    border-color: var(--accent-primary);
}

.pair-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 8px;
    min-width: 160px;
    z-index: 50;
    box-shadow: var(--shadow-lg);
}

.pair-option {
    display: block;
    width: 100%;
    padding: 10px 14px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    text-align: left;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.pair-option:hover {
    background: var(--bg-elevated);
}

.trade-price {
    text-align: right;
}

.price-display {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.price-change {
    font-size: 0.875rem;
    font-weight: 500;
}

.price-change.positive {
    color: var(--color-positive);
}

.price-change.negative {
    color: var(--color-negative);
}

.trade-chart-container {
    height: 300px;
    padding: 16px;
    background: var(--bg-secondary);
}

#trade-chart {
    width: 100%;
    height: 100%;
}

.trade-panel {
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.balance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 0.9375rem;
}

.balance-amount {
    font-weight: 600;
    color: var(--accent-primary);
    font-family: var(--font-mono);
}

.trade-options {
    margin-bottom: 20px;
}

.option-group {
    margin-bottom: 16px;
}

.option-group label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.leverage-options,
.lot-size-options {
    display: flex;
    gap: 8px;
}

.leverage-btn,
.lot-btn {
    flex: 1;
    height: 40px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.leverage-btn:hover,
.lot-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.leverage-btn.active,
.lot-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: #000;
    font-weight: 600;
}

.trade-calc {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 20px;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    padding: 6px 0;
}

.calc-row span:first-child {
    color: var(--text-secondary);
}

.calc-row span:last-child {
    font-weight: 500;
    font-family: var(--font-mono);
}

.trade-actions {
    display: flex;
    gap: 12px;
}

.btn-buy,
.btn-sell {
    flex: 1;
    height: 52px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-buy {
    background: var(--color-positive);
    color: #fff;
}

.btn-buy:hover {
    background: #16a34a;
}

.btn-sell {
    background: var(--color-negative);
    color: #fff;
}

.btn-sell:hover {
    background: #dc2626;
}

/* Trade History */
.trade-history-section {
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.trade-history-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
}

/* Transaction Tabs */
.transaction-container {
    margin-top: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.transaction-tabs {
    display: flex;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    padding: 14px 16px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

.transaction-content {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

/* Open Trades */
.open-trades-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.open-trade-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 14px;
    border: 1px solid var(--border-color);
}

.open-trade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.open-trade-pair {
    font-weight: 600;
    font-size: 1rem;
}

.open-trade-type {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.open-trade-type.long {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-positive);
}

.open-trade-type.short {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-negative);
}

.open-trade-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}

.open-trade-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.open-trade-detail span:first-child {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.open-trade-detail span:last-child {
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-mono);
}

.open-trade-pnl {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.pnl-label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

.pnl-value {
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font-mono);
}

.pnl-value.positive {
    color: var(--color-positive);
}

.pnl-value.negative {
    color: var(--color-negative);
}

.btn-close-position {
    padding: 8px 16px;
    background: var(--accent-primary);
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-close-position:hover {
    background: #00e6b8;
}

.no-open-trades {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.history-list {
    max-height: 250px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.history-item:last-child {
    margin-bottom: 0;
}

.history-pair {
    font-weight: 600;
}

.history-type {
    font-size: 0.8125rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.history-type.long {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-positive);
}

.history-type.short {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-negative);
}

.history-pnl {
    font-family: var(--font-mono);
    font-weight: 600;
}

.history-pnl.positive {
    color: var(--color-positive);
}

.history-pnl.negative {
    color: var(--color-negative);
}

.no-history {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== ASSETS PAGE ===== */
.assets-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.total-balance {
    text-align: center;
    margin-bottom: 20px;
}

.total-balance .balance-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.total-balance .balance-amount {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-primary);
}

.asset-actions {
    display: flex;
    gap: 12px;
}

.asset-actions .btn-primary,
.asset-actions .btn-secondary {
    flex: 1;
}

.holdings-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
}

.holdings-section h3 {
    font-size: 1rem;
    margin-bottom: 16px;
}

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

.holdings-header h3 {
    margin-bottom: 0;
}

.btn-clear-holdings {
    padding: 6px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-negative);
    border-radius: var(--radius-sm);
    color: var(--color-negative);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-clear-holdings:hover {
    background: var(--color-negative);
    color: #fff;
}

.holdings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.holding-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.holding-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.holding-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.holding-name {
    font-weight: 600;
}

.holding-symbol {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.holding-right {
    text-align: right;
}

.holding-balance {
    font-weight: 600;
    font-family: var(--font-mono);
}

.holding-value {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* ===== SETTINGS PAGE ===== */
.settings-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.settings-card h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-card h3 i {
    color: var(--accent-primary);
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9375rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row span:first-child {
    color: var(--text-secondary);
}

.info-row span:last-child {
    font-weight: 500;
}

.withdrawal-addresses {
    margin-bottom: 16px;
}

.address-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
}

.address-info {
    flex: 1;
    min-width: 0;
}

.address-label {
    font-size: 0.8125rem;
    font-weight: 500;
}

.address-value {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    width: 100%;
    height: 48px;
    margin-top: 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--color-negative);
    border-radius: var(--radius-md);
    color: var(--color-negative);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: var(--color-negative);
    color: #fff;
}

.transaction-log {
    max-height: 300px;
    overflow-y: auto;
}

.tx-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.tx-item:hover {
    background: rgba(255,255,255,0.05);
    margin: 0 -10px;
    padding: 10px;
    border-radius: 8px;
}

.tx-item:last-child {
    border-bottom: none;
}

.tx-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tx-type {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tx-type.deposit i {
    color: var(--color-positive);
}

.tx-type.withdraw i {
    color: var(--color-negative);
}

.tx-status {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
    width: fit-content;
}

.tx-status.pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.tx-status.approved {
    background: rgba(34, 197, 94, 0.2);
    color: var(--color-positive);
}

.tx-status.rejected {
    background: rgba(239, 68, 68, 0.2);
    color: var(--color-negative);
}

.tx-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.tx-amount {
    font-family: var(--font-mono);
    font-weight: 500;
}

.tx-actions {
    display: flex;
    gap: 6px;
}

.btn-approve, .btn-reject {
    padding: 4px 10px;
    font-size: 0.6875rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.btn-approve {
    background: var(--color-positive);
    color: #fff;
}

.btn-approve:hover {
    background: #16a34a;
}

.btn-reject {
    background: var(--color-negative);
    color: #fff;
}

.btn-reject:hover {
    background: #dc2626;
}

/* ===== MODALS ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    z-index: 1000;
    overflow-y: auto;
}

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

.modal {
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    max-height: 90dvh;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 1.125rem;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--bg-secondary);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

/* Coin Modal */
.coin-price-large {
    text-align: center;
    margin-bottom: 20px;
}

.coin-price-large .price {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-mono);
    margin-bottom: 4px;
}

.coin-price-large .change {
    font-size: 1rem;
    font-weight: 500;
}

.coin-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.coin-stats .stat {
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.coin-stats .stat span:first-child {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.coin-stats .stat span:last-child {
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-mono);
}

.modal-chart {
    height: 200px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.btn-block {
    width: 100%;
}

/* Trade Modal */
.trade-details {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 20px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9375rem;
}

.detail-row span:first-child {
    color: var(--text-secondary);
}

.detail-row span:last-child {
    font-weight: 600;
}

.trade-buttons {
    display: flex;
    gap: 12px;
}

.btn-cancel {
    flex: 1;
    height: 48px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-cancel:hover {
    background: var(--bg-elevated);
}

.btn-confirm {
    flex: 1;
    height: 48px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

#confirm-trade-btn.buy {
    background: var(--color-positive);
    color: #fff;
}

#confirm-trade-btn.sell {
    background: var(--color-negative);
    color: #fff;
}

/* Deposit Modal */
.deposit-coin-select {
    margin-bottom: 20px;
}

.deposit-coin-select label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.deposit-coin-select select {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.deposit-address label {
    display: block;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.address-box {
    display: flex;
    gap: 8px;
}

.address-box input {
    flex: 1;
    height: 44px;
    padding: 0 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8125rem;
}

.copy-btn {
    width: 44px;
    height: 44px;
    background: var(--accent-primary);
    border: none;
    border-radius: var(--radius-md);
    color: #000;
    cursor: pointer;
    transition: var(--transition);
}

.copy-btn:hover {
    background: #00e6b8;
}

.deposit-qr {
    text-align: center;
    margin: 20px 0;
}

#qr-code {
    width: 160px;
    height: 160px;
    background: #fff;
    margin: 0 auto 12px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

#qr-code img {
    max-width: 100%;
    height: auto;
}

.deposit-qr span {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.deposit-warning {
    display: flex;
    gap: 10px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    color: var(--color-negative);
    line-height: 1.5;
}

/* Deposit Form */
.deposit-form-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.deposit-amount-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.deposit-amount-input label {
    font-size: 0.8125rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.deposit-amount-input input {
    height: 48px;
    padding: 0 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: var(--font-mono);
}

.deposit-amount-input input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.15);
}

.deposit-summary {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
}

.summary-row span:first-child {
    color: var(--text-secondary);
}

.summary-row span:last-child {
    font-weight: 600;
    font-family: var(--font-mono);
}

.summary-row.total {
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    font-size: 1rem;
}

.summary-row.total span:last-child {
    color: var(--accent-primary);
}

/* Withdraw Modal */
.withdraw-form .input-group {
    margin-bottom: 16px;
}

#saved-address-group {
    display: none;
}

#saved-addresses {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    cursor: pointer;
}

#saved-addresses:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.withdraw-fee {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    font-size: 0.875rem;
}

.withdraw-fee span:last-child {
    font-family: var(--font-mono);
    font-weight: 500;
}

/* Address Modal */
.address-modal .input-group {
    margin-bottom: 16px;
}

/* Support Modal */
.support-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.support-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
}

.support-option:hover {
    border-color: var(--accent-primary);
    background: var(--bg-elevated);
}

.support-option i {
    font-size: 1.5rem;
    color: var(--accent-primary);
}

.support-option span {
    font-size: 0.875rem;
    font-weight: 500;
}

.support-contact {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.support-contact p {
    margin-bottom: 6px;
}

/* ===== RESPONSIVE STYLES ===== */

/* Tablet */
@media (min-width: 768px) {
    .top-nav {
        padding: 0 24px;
    }
    
    .main-content {
        padding: 24px;
        padding-bottom: 80px;
    }
    
    .hero-actions {
        gap: 16px;
    }
    
    .hero-stats {
        gap: 24px;
    }
    
    .stat-card {
        padding: 20px 32px;
    }
    
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-section {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .market-table-header,
    .market-row {
        grid-template-columns: 40px 1.5fr 1fr 1fr 100px 1.2fr;
        padding: 16px 20px;
    }
    
    .coin-icon {
        width: 36px;
        height: 36px;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .main-content {
        padding-bottom: 24px;
    }
    
    .settings-section {
        gap: 20px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .top-nav {
        padding: 0 32px;
        height: 64px;
    }
    
    .nav-left .logo {
        font-size: 1.5rem;
    }
    
    .main-content {
        padding: 32px;
    }
    
    .hero {
        padding: 40px 0;
    }
    
    .hero-content h1 {
        font-size: 3rem;
    }
    
    .hero-stats {
        gap: 32px;
    }
    
    .stat-card {
        padding: 24px 40px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .news-thumb {
        height: 180px;
    }
    
    .market-ticker {
        gap: 16px;
    }
    
    .ticker-item {
        min-width: 160px;
        padding: 14px 20px;
    }
    
    .bottom-nav {
        display: none;
    }
    
    .settings-section {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .settings-section .settings-card:last-child {
        grid-column: span 2;
    }
}

/* Large Desktop */
@media (min-width: 1400px) {
    .page {
        max-width: 1400px;
    }
}

/* Small mobile adjustments */
@media (max-width: 380px) {
    .auth-card {
        padding: 24px 16px;
    }
    
    .hero-actions {
        flex-direction: column;
    }
    
    .leverage-options,
    .lot-size-options {
        flex-wrap: wrap;
    }
    
    .leverage-btn,
    .lot-btn {
        min-width: calc(50% - 4px);
    }
    
    .trade-actions {
        flex-direction: column;
    }
}

/* Print styles */
@media print {
    .top-nav,
    .bottom-nav,
    .modal-overlay {
        display: none !important;
    }
    
    .main-content {
        overflow: visible;
    }
}
.trade-main-content {
    display: flex;
    gap: 10px;
    width: 100%;
}
.trade-chart-section {
    flex: 1;
    min-width: 0;
}
.orderbook-section {
    width: 200px;
    flex-shrink: 0;
}
/* Order Book */
.orderbook-container {
    background: #1a1f2e;
    border-radius: 8px;
    padding: 10px;
    height: 300px;
    display: flex;
    flex-direction: column;
}
.orderbook-header {
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.orderbook-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.orderbook-asks {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}
.orderbook-bids {
    flex: 1;
    overflow-y: auto;
}
.orderbook-spread {
    text-align: center;
    padding: 5px 0;
    font-size: 11px;
    color: #6b7280;
    border-top: 1px solid #2d3748;
    border-bottom: 1px solid #2d3748;
    margin: 2px 0;
}
.orderbook-row {
    display: flex;
    justify-content: space-between;
    padding: 2px 4px;
    font-size: 11px;
    font-family: 'IBM Plex Mono', monospace;
}
.orderbook-row.ask .price {
    color: #ef4444;
}
.orderbook-row.bid .price {
    color: #22c55e;
}
.orderbook-row .amount {
    color: #9ca3af;
}