/* ============================================
   PainelAgro — Estilos das Páginas de Gráficos
   ============================================ */

/* Variáveis locais */
:root {
    --cm-cor-fundo: #f7f9fc;
    --cm-cor-card: #ffffff;
    --cm-cor-borda: #e5e9f0;
    --cm-cor-texto: #1f2937;
    --cm-cor-texto-suave: #6b7280;
    --cm-cor-primaria: #2f855a;
    --cm-sombra: 0 4px 12px rgba(0, 0, 0, 0.05);
    --cm-raio: 16px;
}

/* ===== HEADER DE PREÇO (TOP) ===== */
.price-header {
    margin-bottom: 2rem;
    display: flex;
    align-items: flex-end;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.price-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--cm-cor-texto);
    line-height: 1;
    margin: 0;
}

.price-header .price-atual {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--cm-cor-texto);
    line-height: 1;
}

.price-header .variacao {
    font-size: 1rem;
    font-weight: 600;
    padding: 0.2rem 0.6rem;
    border-radius: 8px;
    margin-bottom: 0.2rem;
}

.price-header .variacao.alta { color: var(--cm-cor-primaria); background: #e6f4ea; }
.price-header .variacao.baixa { color: #c53030; background: #fde8e8; }
.price-header .variacao.neutra { color: var(--cm-cor-texto-suave); background: #f3f4f6; }

.voltar-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: var(--cm-cor-primaria);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

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

/* ===== CHIPS DE PERÍODO ===== */
.chart-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto; /* Permite rolar no celular */
    padding-bottom: 0.5rem;
}

.chip {
    background: #f3f4f6;
    color: var(--cm-cor-texto-suave);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.chip:hover {
    background: #e5e7eb;
    color: var(--cm-cor-texto);
}

.chip.active {
    background: var(--cm-cor-card);
    color: var(--cm-cor-texto);
    box-shadow: 0 2px 5px rgba(0,0,0,0.08);
    border: 1px solid var(--cm-cor-borda);
}

/* ===== CAIXA DO GRÁFICO ===== */
.chart-container {
    background: var(--cm-cor-card);
    padding: 1.5rem;
    border-radius: var(--cm-raio);
    border: 1px solid var(--cm-cor-borda);
    box-shadow: var(--cm-sombra);
    margin-bottom: 2rem;
    position: relative;
    height: 400px; /* Altura fixa para o Chart.js renderizar */
}

.chart-container canvas {
    width: 100% !important;
    height: 100% !important;
}

@media (max-width: 768px) {
    .price-header { gap: 1rem; }
    .price-header .price-atual { font-size: 2rem; }
    .chart-container { height: 300px; padding: 1rem; }
}
/* ===== CONTROLES DE INDICADORES ===== */
.indicator-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    align-items: center;
    background: #ffffff;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    border: 1px solid var(--cm-cor-borda);
}

.indicator-controls label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cm-cor-texto-suave);
    cursor: pointer;
    transition: color 0.2s;
}

.indicator-controls label:hover {
    color: var(--cm-cor-texto);
}

.indicator-controls input[type="checkbox"] {
    accent-color: var(--cm-cor-primaria); /* Cor verde do check */
    width: 16px;
    height: 16px;
    cursor: pointer;
}
/* Adicione ao final do seu commodities.css */

/* Customização do checkbox para parecer um botão de rádio */
.indicator-controls label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--cm-cor-texto-suave);
    cursor: pointer;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.indicator-controls label:hover {
    background: #f3f4f6;
}

.indicator-controls label.active-indicator {
    background: #e6f4ea;
    color: var(--cm-cor-primaria);
    border-color: rgba(47, 133, 90, 0.2);
}

/* Esconde o checkbox real */
.indicator-controls input[type="checkbox"] {
    display: none;
}