/* 🔥 Fundo principal atualizado */
body {
    background: linear-gradient(to bottom, #111827, #000);
    color: white;
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100vh;
    margin: 0;
    padding: 10px;
    box-sizing: border-box;
}

/* 🔹 Cabeçalho aprimorado */
.header {
    width: 100%;
    max-width: 350px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(31, 41, 55, 0.85); /* Cinza escuro */
    padding: 10px;
    border-radius: 10px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 🔹 Ajuste da logo */
.logo-container img {
    width: 80px;
    height: auto;
}

/* 🔹 Estilização do saldo */
.balance {
    font-size: 15px;
    font-weight: bold;
    color: #60a5fa; /* Azul */
    display: flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid rgba(96, 165, 250, 0.7);
    background: rgba(31, 41, 55, 0.8);
}

/* 🔥 Indicador de IA atualizado */
.ai-status {
    font-size: 14px;
    font-weight: bold;
    color: #34d399; /* Verde */
    background: rgba(34, 211, 153, 0.2);
    padding: 7px;
    border-radius: 6px;
    margin-bottom: 5px;
    text-align: center;
    width: 100%;
    max-width: 360px;
}

/* 🔥 Container do gráfico */
.trading-container {
    background-color: #1f2937;
    border: 1.5px solid #374151;
    border-radius: 12px;
    padding: 15px;
    width: 100%;
    max-width: 378px;
    height: 400px;
    box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* 🔥 Ajuste do gráfico */
.chart-container {
    flex-grow: 1;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

canvas {
    width: 100% !important;
    height: 100% !important;
}

/* 🔥 Painel de operações */
.trade-panel {
    background-color: #1E293B;
    border-radius: 12px;
    padding: 15px;
    width: 100%;
    max-width: 350px;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 🔥 Informação da moeda */
.currency-info {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: center;
}

.currency-icon {
    width: 25px;
    height: 25px;
    margin-right: 8px;
}

.currency-name {
    font-size: 16px;
    font-weight: bold;
}

/* 🔥 Container principal de saldo e lucro */
.trade-info {
    display: flex;
    justify-content: space-between; /* Mantém os elementos lado a lado */
    gap: 10px; /* Adiciona espaçamento entre os containers */
    background: transparent; /* Remove o fundo para que o espaço entre eles fique escuro */
    padding: 0;
    border-radius: 8px;
    margin-bottom: 10px;
}

/* 🔹 Container individual do saldo */
#balance-container,
#profit-container {
    display: flex;
    flex-direction: column; /* Coloca o título acima do valor */
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1); /* Fundo sutil */
    padding: 5px 5px; /* Adiciona espaçamento interno */
    border-radius: 6px;
    width: 50%; /* Mantém os dois containers lado a lado */
    text-align: center;
    border: 0.2px solid rgba(255, 255, 255, 0.2);
}

/* 🔹 Estilização do título acima do valor */
.balance-label,
.profit-label {
    font-size: 12px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7); /* Cor mais clara para o título */
    margin-bottom: 1px; /* Espaçamento entre o título e o valor */
    text-transform: uppercase;
}

/* 🔹 Estilização dos valores */
#balance {
    font-size: 18px;
    font-weight: bold;
    color: #FFD700; /* Dourado para destaque */
}

#profit {
    font-size: 18px;
    font-weight: bold;
    color: #34d399; /* Verde para lucro */
}



/* 🔥 Campo de Seleção de Valor */
.entry-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 10px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    width: 100%;
}

.entry-container label {
    font-size: 14px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 5px;
}


/* 🔥 Caixa do valor de entrada */
/* 🔥 Caixa do valor de entrada (Corrigida para crescer proporcionalmente) */
.entry-box {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1); /* Fundo combinando com os outros elementos */
    border-radius: 5px;
    padding: 10px 15px; /* Espaçamento interno ajustado */
    font-size: 16px; /* Tamanho do texto consistente */
    font-weight: bold;
    color: #ffffff;
    width: 100%; /* Garante que ocupe toda a largura do contêiner pai */
    max-width: 100%; /* Mantém a largura total do contêiner pai */
    height: 45px; /* Altura ajustada para manter proporção */
    text-align: center;
    border: 0.2px solid rgba(255, 255, 255, 0.3);
    box-sizing: border-box; /* Garante que padding e borda não aumentem o tamanho total */
    margin: 0 auto; /* Garante centralização total */
}

/* 🔥 Ajustando a largura do contêiner pai para manter alinhamento */
.entry-container {
    display: flex;
    flex-direction: column;
    align-items: center; /* Garante alinhamento central */
    justify-content: center;
    width: 100%;
    max-width: 350px; /* Agora ele terá a mesma largura dos outros elementos */
    text-align: center;
    margin: 0 auto; /* Centraliza no contêiner pai */
    box-sizing: border-box; /* Mantém dimensões consistentes */
}


/* 🔹 Símbolo de moeda */
.currency-symbol {
    font-size: 14px;
    font-weight: bold;
    color:  rgb(255, 230, 0);
    margin-right: 5px;
}

/* 🔹 Valor fixo da entrada */
.entry-value {
    font-size: 20px;
    font-weight: bold;
    color: #ffffff;
}




/* 🔹 Botão de operação (Moderno e mais baixo) */
.trade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px; /* Reduzido para deixar mais baixo */
    font-size: 14px; /* Tamanho menor para mais modernidade */
    font-weight: bold;
    text-transform: uppercase;
    background: linear-gradient(90deg, #2563eb, #1d4ed8); /* Mantendo o azul vibrante */
    border: none;
    border-radius: 6px; /* Bordas mais arredondadas e suaves */
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    position: relative;
    overflow: hidden;
    margin-top: 10px; /* 🔥 Adiciona espaço na parte superior */
}


/* 🔥 Botão animado quando IA está operando */
.trade-btn.operating {
    background: linear-gradient(90deg, #ff5733, #ff8c42);
    cursor: not-allowed;
    animation: pulse 1.5s infinite;
}


/* 🔹 Animação de entrada */
@keyframes fadeIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* 🔹 Botão de saque */
#withdraw-btn {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    background: linear-gradient(90deg, #FFD700, #FFA500);
    border: none;
    border-radius: 8px;
    color: white;
    margin-top: 15px;
    cursor: pointer;
    transition: 0.3s;
}

#withdraw-btn:hover {
    background: linear-gradient(90deg, #FFC107, #FF8C00);
}

/* 🔥 Popup pequeno de ganho */
.small-popup {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(34, 211, 153, 0.95);
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
    padding: 12px 25px;
    border-radius: 10px;
    opacity: 1;
    transition: opacity 0.8s ease-out, transform 0.5s ease-out;
    z-index: 9999;
}

/* 🔥 Animação de saída do popup */
.small-popup.fade-out {
    opacity: 0;
    transform: translateY(-20px);
}




/* 🔹 Informações de saldo e lucro */
.trade-info {
    display: flex;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
}

.label {
    font-size: 14px;
    font-weight: bold;
    color: #ccc;
}

#balance {
    font-size: 16px;
    font-weight: bold;
    color: #FFD700;
}

#profit {
    font-size: 16px;
    font-weight: bold;
    color: #34d399;
}

/* 🔹 Container do histórico */
.history {
    margin-top: 10px; /* Adiciona espaço entre seções */
    background: rgba(31, 41, 55, 0.9); /* Fundo escuro para melhor contraste */
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3); /* Leve sombra para destaque */
}

/* 🔹 Título do histórico */
.history h3 {
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 5px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* 🔹 Tabela estilizada */
.history-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05); /* Fundo sutil para diferenciar */
    border-radius: 6px;
    overflow: hidden;
}

/* 🔹 Cabeçalho da tabela */
.history-table thead {
    background: rgba(255, 255, 255, 0.15); /* Fundo mais visível */
}

.history-table th {
    font-size: 12px;
    color: white;
    padding: 8px;
    text-transform: center;
    font-weight: bold;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

/* 🔹 Corpo da tabela */
.history-table tbody tr {
    transition: background 0.3s ease-in-out;
}

/* 🔹 Alternância de cores nas linhas */
.history-table tbody tr:nth-child(odd) {
    background: rgba(255, 255, 255, 0.03);
}

.history-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.06);
}

/* 🔹 Efeito hover */
.history-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* 🔹 Células da tabela */
.history-table td {
    font-size: 13px;
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* 🔹 Última linha sem borda */
.history-table tbody tr:last-child td {
    border-bottom: none;
}

/* 🔹 Estilização de ganhos/perdas */
.win {
    color: #34d399; /* Verde para lucro */
    font-weight: bold;
}

.loss {
    color: #ef4444; /* Vermelho para perda */
    font-weight: bold;
}


/* Estilos do Pop-up de saque */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    transition: opacity 0.3s ease-in-out;
}

/* Classe para ativar o pop-up */
.popup.active {
    display: flex;
    opacity: 1;
}

/* Conteúdo do Pop-up */
.popup-content {
    background-color: #1f2937;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    width: 90%;
    max-width: 300px; /* Para não ficar muito grande */
    animation: slideIn 0.3s ease-in-out;
}

/* Botão de fechar */
.popup-close {
    background: red;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.popup-close:hover {
    background: darkred;
}


/* Botão de saque */
#withdraw-btn {
    background-color: #059669; /* Verde */
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

/* Responsividade */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
    }
}

/* 🔥 Deixa o preço completamente invisível */
#current-price {
    opacity: 0;
    pointer-events: none; /* Impede interações do mouse */
    transition: opacity 0.3s ease-in-out; /* Suaviza mudanças */
}

