/* ============================================================
   Mekong Wallet — Shared Dark Theme
   Design system : styles.md v1.0  (matches index.html / trade.html)
   ============================================================ */
:root {
    --bg-primary: #0B0F1A;
    --bg-secondary: #121826;
    --bg-tertiary: #1A2236;
    --bg-nav: #0D1320;
    --green-primary: #00E676;
    --green-soft: #00C853;
    --green-glow: rgba(0, 230, 118, 0.25);
    --green-muted: #1B5E20;
    --red-primary: #FF3D57;
    --red-soft: #E53935;
    --red-glow: rgba(255, 61, 87, 0.25);
    --text-primary: #FFFFFF;
    --text-secondary: #A0AEC0;
    --text-tertiary: #718096;
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.15);
    --border-green: rgba(0, 230, 118, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.35);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Kantumruy Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    width: 100%;
    max-width: 450px;
    min-height: 100vh;
    background: var(--bg-primary);
    position: relative;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 16px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tab Bar */
.tab-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 74px;
    background: var(--bg-nav);
    border-top: 1px solid var(--border);
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    z-index: 100;
    padding-top: 6px;
}

.tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-tertiary);
    font-size: 11px;
}

.tab-item svg {
    width: 26px;
    height: 26px;
}

.tab-item img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.tab-item.active {
    color: var(--green-primary);
}

.tab-item span {
    font-size: 14px;
    font-weight: 400;
}

.nav-underline {
    width: 40px;
    height: 3px;
    background: var(--green-primary);
    border-radius: 2px;
    margin-top: 2px;
}

.tab-item:not(.active) .nav-underline {
    display: none;
}

/* Main content area (adds padding for fixed tab bar) */
.main-content {
    padding-bottom: 70px;
}

/* Page */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-size: 14px;
    border-radius: 12px;
    transition: opacity 0.2s, transform 0.15s ease;
}

.btn:active {
    opacity: 0.85;
    transform: scale(0.97);
}

.btn-primary {
    background: linear-gradient(135deg, var(--green-soft), var(--green-primary));
    color: #0B0F1A;
    font-weight: 600;
}

.btn-blue {
    background: linear-gradient(135deg, var(--green-soft), var(--green-primary));
    color: #0B0F1A;
    font-weight: 600;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
}

/* Quote Card (legacy) */
.quote-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0;
    position: relative;
    width: 100%;
    height: 108px;
    cursor: pointer;
}

.quote-card .coin-icon {
    position: absolute;
    left: 10px;
    top: 13px;
    width: 22px;
    height: 22px;
}

.quote-card .coin-row {
    position: absolute;
    left: 40px;
    top: 10px;
    display: flex;
    align-items: baseline;
    gap: 2px;
    max-width: calc(100% - 50px);
}

.quote-card .coin-name {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-primary);
    line-height: 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.quote-card .coin-pair {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 20px;
    white-space: nowrap;
    flex-shrink: 0;
}

.quote-card .coin-price {
    position: absolute;
    left: 10px;
    top: 58px;
    font-size: 13.9px;
    color: var(--text-primary);
    line-height: 20px;
}

.quote-card .coin-usd {
    position: absolute;
    left: 10px;
    top: 82px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 16px;
}

.quote-card .change-badge {
    position: absolute;
    right: 10px;
    top: 58px;
    width: 83.16px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #fff;
}

.change-badge.negative {
    background: var(--red-primary);
}

.change-badge.positive {
    background: var(--green-primary);
    color: #0B0F1A;
}

.change-badge.zero {
    background: var(--green-muted);
}

.quote-card .divider {
    position: absolute;
    left: 10px;
    right: 10px;
    top: 47.25px;
    height: 0.5px;
    background: var(--border-strong);
}

/* Scrollbar hidden */
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
