/* =========================
🎯 BASE
========================= */
body {
    background: #0a0e13;
    color: #d6dde5;
    font-family: "Segoe UI", Arial, sans-serif;
    margin: 0;
}

/* =========================
⚡ HEADER
========================= */
h2 {
    margin: 15px;
    color: #4da3ff;
    font-weight: 600;
    letter-spacing: 0.5px;
}



/* 🔥 LAYOUT LADO A LADO (SEM QUEBRAR NADA) */
.main-flex {
    display: flex;
    gap: 10px;
    padding: 10px;
}

/* BOOK (ESQUERDA) */
.left-panel {
    width: 360px;
}

/* CHART (DIREITA) */
.right-panel {
    flex: 1;
}

/* FAZ O GRÁFICO OCUPAR ALTURA TOTAL */
.right-panel .chart-box {
    height: calc(100vh - 90px);
}



/* =========================
📦 LAYOUT
========================= */
.container {
    display: flex;
    gap: 20px;
    padding: 15px;
}

/* =========================
🧱 CARD
========================= */
.card {
    background: #131a22;
    padding: 16px;
    border-radius: 14px;
    width: 340px;
    box-shadow: 
        0 0 0 1px rgba(255,255,255,0.03),
        0 10px 25px rgba(0,0,0,0.6);
    transition: 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 0 0 1px rgba(255,255,255,0.05),
        0 15px 30px rgba(0,0,0,0.8);
}

/* =========================
💰 PREÇO
========================= */
.price {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 5px;
    transition: 0.15s;
}

.flash-up {
    color: #00ff9c;
    text-shadow: 0 0 8px rgba(0,255,156,0.6);
}

.flash-down {
    color: #ff4d4d;
    text-shadow: 0 0 8px rgba(255,77,77,0.6);
}

/* =========================
📊 BARRAS
========================= */
.bar {
    height: 6px;
    border-radius: 4px;
    margin: 4px 0;
    transition: width 0.2s ease;
}

.bid-bar {
    background: linear-gradient(90deg, #00ff9c, transparent);
}

.ask-bar {
    background: linear-gradient(90deg, #ff4d4d, transparent);
}

/* =========================
⚖ IMBALANCE
========================= */
#imb-XMR\/USD,
#imb-BTC\/USD {
    font-size: 13px;
    margin: 6px 0;
    opacity: 0.85;
}

/* =========================
📚 BOOK (DOM)
========================= */
.book {
    margin-top: 10px;
    font-size: 12px;
    height: 530px;
    overflow-y: auto;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* SCROLL BONITO */
.book::-webkit-scrollbar {
    width: 4px;
}
.book::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

/* =========================
📈 LINHAS
========================= */
.row {
    display: flex;
    justify-content: space-between;
    padding: 2px 6px;
    position: relative;
    transition: 0.1s;
}

.row:hover {
    background: rgba(255,255,255,0.03);
}

/* =========================
🔥 HEATMAP
========================= */
.row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--size, 0%);
    opacity: 0.15;
    pointer-events: none;
}

.ask::before {
    background: linear-gradient(90deg, #ff3b3b, transparent);
}

.bid::before {
    background: linear-gradient(90deg, #00ff9c, transparent);
}

/* CORES TEXTO */
.ask {
    color: #ff7b7b;
}

.bid {
    color: #00ff9c;
}

/* =========================
💣 PAREDES
========================= */
.wall {
    font-weight: 700;
    text-shadow: 0 0 6px rgba(255,255,255,0.15);
}

/* =========================
🎯 PREÇO CENTRAL
========================= */
.mid {
    text-align: center;
    font-weight: 700;
    margin: 6px 0;
    color: #4da3ff;
    letter-spacing: 0.5px;
}

/* =========================
📜 EVENTOS (LOG)
========================= */
.events-box {
    height: 730px;
    overflow-y: auto;
    margin-top: 10px;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 5px;
    font-size: 11px;
}

/* SCROLL */
.events-box::-webkit-scrollbar {
    width: 4px;
}
.events-box::-webkit-scrollbar-thumb {
    background: #333;
}

/* LINHA */
.event-line {
    padding: 2px 5px;
    margin-bottom: 2px;
    border-radius: 4px;
    font-family: monospace;
    opacity: 0.9;
}

/* HORA */
.event-time {
    color: #6b7785;
    margin-right: 6px;
}

/* TIPOS */
.event-strong {
    background: rgba(255, 60, 60, 0.2);
    color: #ff4d4d;
}

.event-buy {
    background: rgba(0, 255, 156, 0.2);
    color: #00ff9c;
}

/* =========================
✨ MICRO DETALHES
========================= */
.card h3 {
    margin-bottom: 8px;
    font-weight: 600;
    color: #c9d1d9;
}



/* =========================
📊 BOOK PROFISSIONAL (DUAL LAYER)
========================= */

.book-header {
    display: flex;
    justify-content: center;
    gap: 40px;
    font-size: 11px;
    padding: 6px;
    opacity: 0.6;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.book-body {
    font-size: 12px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

/* =========================
📈 LINHA
========================= */
.book-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 2px 4px;
}

/* =========================
🎯 LADOS BASE
========================= */
.book-ask,
.book-bid {
    position: relative;
    padding: 2px 6px;
    z-index: 2;
    font-weight: 500;
}

/* alinhamento */
.book-ask {
    text-align: right;
    color: #ff8080;
}

.book-bid {
    text-align: left;
    color: #00ffb3;
}

/* =========================
🔥 CAMADA 1 (BASE HEAT)
========================= */
.book-ask::before,
.book-bid::before {
    content: "";
    position: absolute;
    top: 0;
    height: 100%;
    width: var(--size, 0%);
    opacity: 0.15;
    z-index: 0;
}

/* ASK (cresce do centro pra esquerda) */
.book-ask::before {
    right: 0;
    left: auto;
    background: linear-gradient(270deg, #ff3b3b, #ff3b3b);
}

/* BID (cresce do centro pra direita) */
.book-bid::before {
    left: 0;
    right: auto;
    background: linear-gradient(90deg, #00ff9c, #00ff9c);
}

/* =========================
💣 CAMADA 2 (OVERLAY FORTE)
========================= */
.book-ask::after,
.book-bid::after {
    content: "";
    position: absolute;
    top: 0;
    height: 100%;
    width: var(--size-strong, 0%);
    opacity: 0.45;
    z-index: 1;
    transition: 0.15s;
}

/* ASK overlay */
.book-ask::after {
    right: 0;
    left: auto;
    background: linear-gradient(270deg, #ff0000, transparent);
}

.book-bid::after {
    left: 0;
    right: auto;
    background: linear-gradient(90deg, #00ff9c, transparent);
}

/* =========================
💎 DESTAQUE DE PAREDE
========================= */
.wall {
    font-weight: 700;
    text-shadow: 0 0 6px rgba(255,255,255,0.2);
}

/* =========================
✨ HOVER (leitura)
========================= */
.book-row:hover {
    background: rgba(255,255,255,0.04);
}

/* =========================
📊 GRÁFICO
========================= */
.chart-box {
    height: 730px;
    margin-bottom: 10px;
    background: #0d141c;
    border-radius: 10px;
    padding: 8px;
}

/* FORÇA O GRÁFICO A OCUPAR TODO O ESPAÇO */
.chart-box canvas {
    width: 100% !important;
    height: 100% !important;
}

/* =========================
🎯 SINAL 
========================= */
.signal-box {
    margin-top: 5px;
    padding: 6px;
    font-weight: bold;
    text-align: center;
    border-radius: 4px;
    background: #111;
}

.signal-buy {
    color: #00ff9c;
}

.signal-sell {
    color: #ff4d4d;
}

.right-panel .chart-box {
    height: calc(80vh - 200px) !important;
}



/* =========================
🚀 TOPBAR NOVA (SALDO + BOT)
========================= */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #0d141c;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* esquerda */
.top-left {
    display: flex;
    flex-direction: column;
    align-items: center;
}


/* =========================
🚀 LOGO + BRAND BOT
========================= */

.top-left {
    display: flex;
    align-items: center;
}

/* logo */
.logo {
    width: auto;
    height: 70px;
    object-fit: contain;
}

/* texto ao lado */
.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    align-items: center;
}

/* nome do bot */
.brand-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;

    background: linear-gradient(90deg, #00ff9c, #4da3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* subtítulo */
.subtitle {
    font-size: 10px;
    opacity: 0.65;
    letter-spacing: 1px;
}


/* centro (saldo) */
.top-center {
    font-size: 16px;
    font-weight: 600;
    color: #00ff9c;
    background: rgba(0,255,156,0.08);
    padding: 6px 14px;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,255,156,0.08);
}

/* direita (bot) */
.top-right {
    display: flex;
    align-items: center;
}

/* botão bot */
.bot-btn {
    background: #1a222c;
    border: 1px solid rgba(255,255,255,0.08);
    color: #d6dde5;
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.2s;
    font-weight: 500;
}

/* hover */
.bot-btn:hover {
    background: #243140;
    border-color: rgba(255,255,255,0.15);
}

/* ativo */
.bot-active {
    background: #00ff9c;
    color: #000;
    border: none;
    box-shadow: 0 0 10px rgba(0,255,156,0.4);
}


/* =========================
💰 SALDO
========================= */
#balance {
    font-size: 18px;
    font-weight: 700;
    margin-left: 6px;
}


/* =========================
📐 AJUSTE GLOBAL
========================= */
.main-flex {
    margin-top: 5px;
}


/* =========================
🤖 CONTROLES DO BOT
========================= */
.bot-controls {
    margin-top: 10px;
    padding: 10px;
    background: #0d141c;
    border-radius: 10px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.bot-controls input {
    width: 120px;
    padding: 5px;
    background: #000;
    color: #fff;
    border: 1px solid #222;
}

#bot-status {
    font-size: 12px;
    opacity: 0.7;
}


/* =========================
📚 HISTÓRICO DE TRADES 
========================= */
.bot-history {
    margin-top: 10px;
    background: #0d141c;
    border-radius: 10px;
    padding: 10px;
}

.history-header {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 6px;
    color: #4da3ff;
}

.history-body {
    max-height: 600px;
    overflow-y: auto;
    font-size: 12px;
}

/* scroll bonito */
.history-body::-webkit-scrollbar {
    width: 4px;
}
.history-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}

/* linha */
.trade-line {
    padding: 4px 6px;
    margin-bottom: 3px;
    border-radius: 4px;
    font-family: monospace;
    display: flex;
    justify-content: space-between;
}

/* compra */
.trade-buy {
    background: rgba(0,255,156,0.15);
    color: #00ff9c;
}

/* venda */
.trade-sell {
    background: rgba(255,77,77,0.15);
    color: #ff4d4d;
}

/* tempo */
.trade-time {
    color: #777;
    font-size: 10px;
}



/* =========================
🎯 SEPARAÇÃO QTD x PREÇO
========================= */

.book-bid .qty,
.book-ask .qty {
    color: #ffffff; /* branco */
    opacity: 0.9;
}

.book-bid .price {
    color: var(--darkreader-text-00ff9c, #1affa6); /* verde compra */
    /* width: 32px; */
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.book-ask .price {
    color: var(--darkreader-text-ff4d4d, #ff4f4f);
    /* width: 32px; */
    font-size: 15px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}


/* =========================
🚫 COLUNA VAZIA (ANTI BUG)
========================= */

.book-ask.empty,
.book-bid.empty {
    opacity: 0;
    pointer-events: none;
}



/* =========================
🔐 MODAL LOGIN
========================= */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.7);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 9999;
}

.modal-box {
    background: #131a22;
    padding: 20px;
    border-radius: 10px;
    width: 300px;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hidden {
    display: none;
}


/* =========================
👤 USUÁRIO LOGADO
========================= */
.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* logado */
.user-logged {
    border: 1px solid #00ff9c;
    box-shadow: 0 0 8px rgba(0,255,156,0.3);
}

/* hover melhor */
.user-btn:hover {
    transform: translateY(-1px);
}

/* =========================
🔑 STATUS DA API
========================= */
.api-btn {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* sem API */
.api-warning {
    border: 1px solid #ffaa00;
    color: #ffaa00;
}

/* com API */
.api-ok {
    border: 1px solid #00ff9c;
    color: #00ff9c;
    box-shadow: 0 0 8px rgba(0,255,156,0.3);
}


