/* Estilos gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f8f9fa;
}

.logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 10px;
}

.calculator {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.main-content {
    flex: 1;
    height: 100vh;
    overflow-y: auto; /* Scroll único para toda área direita */
}

.container {
    display: flex;
    height: 100vh;
    width: 100%;
    overflow: hidden;
}

.chart-container {
    height: 90vh; /* Altura fixa do gráfico */
    min-height: 400px;
    position: relative;
}

th, td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f2f2f2;
}

.chart-area .y1-axis {
    color: #666;
}

.chart-area .y1-axis line {
    stroke: #eee;
}

.chart-area .y1-axis .domain {
    stroke: #ddd;
}

.sidebar {
    width: 350px;
    min-width: 350px;
    height: 100vh;
    overflow-y: auto;
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    padding: 15px;
}

.sidebar-content::-webkit-scrollbar {
    width: 6px;
}
.sidebar-content::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 3px;
}
.sidebar::-webkit-scrollbar {
    display: none; /* Chrome, Safari e Opera */
}

.sidebar h2 {
    margin-bottom: 10px;
    color: #333;
}

.form-group {
    margin-bottom: 10px;
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: center;
    gap: 8px;
}

.form-group label {
    display: block;
    /* margin-bottom: 5px; */
    color: #666;
}

input, button,
.form-group input,
.form-group select {
    width: 100%;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
    font-size: 14px;
}

.resultados {
    margin-top: 20px;
    padding: 15px;
    background-color: #e9f7ef;
    border-radius: 5px;
}

.loading {
    display: none;
    color: #666;
    font-style: italic;

}

/* Grupo de botões */
.button-group {
    display: flex;
    gap: 5px;
    padding: 2px;
    /* margin-bottom: 0px; */
    align-content: center;
    justify-content: center;
    align-items: flex-start;
}

.button-group .btn-primary {
    margin-left: -2px;
    flex: 1;
}

.btn-primary {
    width: 100%;
    padding: 6px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    /* margin-left: 10px; */
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* Botão de voltar */
.back-button {
    color: #007bff;
    text-decoration: none;
    font-size: 1.5em;
    margin-right: 10px;
    vertical-align: middle;
}

/* Botão pequeno */
.btn-primary.small {
    text-align: center;
    padding: 6px;
    font-size: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.tabela-depuracao {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

#listaAtivos {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.ativo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.ativo-item .info {
    flex: 1;
}

.ativo-item .acoes {
    display: flex;
}

.ativo-item button {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.ativo-item .editar {
    background-color: #ffc107;
    color: #000;
    margin-left: 10px;
}

.ativo-item .excluir {
    background-color: #dc3545;
    color: white;
    margin-left: 10px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-info {
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        max-height: 50vh;
    }
    
    .main-content {
        height: auto;
    }
    
    .chart-container {
        height: 50vh;
        min-height: 300px;
    }
    
    .ativo-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ativo-item .acoes {
        width: 100%;
        justify-content: flex-end;
        margin-top: 8px;
    }
}

/* Legenda */
.legenda-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #eee;
}


.legenda-container h3 {
    margin-bottom: 15px;
    color: #333;
}

.legenda-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    background-color: white;
    border-radius: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cor-legenda {
    width: 15px;
    height: 20px;
    padding: 1px;
    border: none;
    cursor: pointer;    
    border-radius: 3px;
    margin-right: 1px;
}

.legenda-item button {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    font-size: 16px;
    padding: 0 5px;
}

.legenda-item button:hover {
    color: #c82333;
}

#shiftClickInfo {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 100;
    font-size: 14px;
}

.ativo-item .info select {
    margin-left: 5px;
    padding: 2px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 12px;
}

.ativo-item .info input[type="color"] {
    width: 18px;
    height: 22px;
    border-radius: 4px;
    padding: 0;
    border: 1px solid #ddd;
    vertical-align: top;
}

#shiftClickStatus {
    font-weight: bold;
    color: #007bff;
}

#ntnbChart {
    cursor: default;
    width: 100%;
    height: 100%;    
}

#ntnbChart:active {
    cursor: grabbing;
    opacity: 0.8; /* Efeito sutil durante o pan */
}

.shift-mode #ntnbChart {
    cursor: crosshair;
}

#ntnbChart:active:not(.shift-active) {
    cursor: grabbing;
}

.shift-active #ntnbChart {
    cursor: crosshair;
}

.ctrl-active #ntnbChart {
    cursor: crosshair;
}

/* Caixa de tutorial */
.tutorial-box {
    background: #eff9ff;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 5px;
    font-size: 14px;
    /* max-height: 300px; */
    /* overflow-y: auto; */
    margin-bottom: 10px;
}

.tutorial-box h4 {
    color: #333;
    margin: 10px 0 10px 0;
    font-size: 14px;
}

.tutorial-box ul {
    padding-left: 16px;
    margin: 5px 0;
}

.tutorial-box li {
    margin-bottom: 5px;
    line-height: 1.4;
}

.tutorial-box ul ul {
    padding-left: 15px;
    margin: 3px 0;
    font-size: 13px;
    color: #555;
}

.logs-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.logs-content {
    background: white;
    padding: 20px;
    border-radius: 5px;
    width: 80%;
    height: 80%;
    max-width: 800px;
    display: flex;
    flex-direction: column;
}

.logs-text {
    flex-grow: 1;
    overflow-y: auto;
    background: #f8f8f8;
    padding: 10px;
    border: 1px solid #ddd;
    font-family: monospace;
    white-space: pre-wrap;
    margin-bottom: 10px;
}

.logs-close {
    align-self: flex-end;
    padding: 5px 10px;
    cursor: pointer;
}

.chart-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 100;
    display: flex;
    gap: 5px;
}

.chart-controls button {
    /* background: rgba(255, 255, 255, 0.8); */
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1px 1px;
    /* cursor: pointer; */
    /* font-size: 14px; */
    width: 24px;
    /* height: 24px; */
    /* display: flex; */
    /* align-items: center; */
    /* justify-content: center; */
}

.chart-controls button:hover {
    background: #d8d7d7;
}

.fullscreen .chart-controls {
    position: fixed;
    top: 2px;
    right: 10px;
    z-index: 9999;
    background: rgb(129 129 129 / 50%);
    padding: 3px;
    border-radius: 8px;
}

/* Ajuste para os controles de recompra */
#recompraCuponsGroup {
    gap: 10px;
}

#tipoRecompraContainer {
    grid-column: span 2;
}
