/* Estilos para a Calculadora de Frações */

.cf-fracoes, .cf-fracoes * {
  box-sizing: border-box;
}

/* Normaliza heranças problemáticas de outros plugins */
.cf-fracoes button {
  all: unset;               /* zera heranças agressivas */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  line-height: 1;           /* evita “texto descendo” */
  letter-spacing: normal;
  text-align: center;
}

/* Botão principal: medidas fixas e legibilidade */
.cf-fracoes .btn-calcular {
  min-width: 140px;
  height: 42px;             /* altura consistente */
  padding: 0 18px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #0b77b6;
  border: 1px solid #0a6aa3;
  border-radius: 6px;
  transition: transform .05s ease, background .15s ease;
}

.cf-fracoes .btn-calcular:hover { background: #095f92; }
.cf-fracoes .btn-calcular:active { transform: translateY(1px); }

/* Botões auxiliares (inverter, setas, etc.) */
.cf-fracoes .btn-aux {
  width: 40px;
  height: 36px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #0b77b6;
  border: 1px solid #0a6aa3;
  border-radius: 6px;
}

/* Inputs numéricos alinhados */
.cf-fracoes input[type="number"],
.cf-fracoes input[type="text"],
.cf-fracoes select {
  height: 36px;
  padding: 6px 10px;
  font-size: 15px;
  text-align: center;
  border: 1px solid #cfd6de;
  border-radius: 6px;
  background: #fff;
}

/* Remove “setinhas” dos number (evita desalinhamento) */
.cf-fracoes input[type="number"]::-webkit-outer-spin-button,
.cf-fracoes input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; appearance: none; margin: 0; }
.cf-fracoes input[type="number"] { -moz-appearance: textfield; appearance: none; }

/* Layout responsivo */
@media (max-width: 640px) {
  .cf-fracoes .btn-calcular { min-width: 100%; }
}

/* Additional styles for the calculator container */
.cf-fracoes {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.cf-fracoes form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  row-gap: 10px;
}

.cf-fracoes h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.cf-fracoes p {
  font-size: 12px;
  max-width: 520px;
  margin: 0 auto 15px;
  line-height: 1.5;
}

/* Result and other elements */
.cf-fracoes #cf-resultado-container {
  margin-top: 20px;
  padding: 15px;
  background-color: #eef7ff;
  border: 1px solid #bce8f1;
  border-radius: 4px;
  text-align: center;
}

.cf-fracoes #cf-resultado {
  font-weight: bold;
  font-size: 22px;
  color: #31708f;
}

.cf-fracoes .cf-info-extra {
  font-size: 14px;
  color: #555;
  margin: 5px 0;
}

.cf-fracoes #cf-mensagem-erro {
  margin-top: 15px;
  text-align: center;
  color: red;
}

.cf-fracoes .cf-historico-container {
  margin-top: 20px;
  padding: 15px;
  border-top: 1px solid #ccc;
  font-size: 14px;
  text-align: left;
}

.cf-fracoes select option {
  font-size: 18px;
}

.cf-fracoes #cf-passo-a-passo {
  margin-top: 15px;
  padding: 10px;
  border: 1px dashed #ccc;
  text-align: left;
  font-size: 13px;
}

/* Linha dos botões principais */
.cf-fracoes .cf-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 12px 0 6px;
}

/* Normaliza botões contra heranças de outros plugins */
.cf-fracoes .cf-actions button {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  line-height: 1;
  border-radius: 6px;
  padding: 0 18px;
  height: 42px;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid transparent;
}

/* Calcular */
.cf-fracoes .btn-calcular {
  color: #fff;
  background: #0b77b6;
  border-color: #0a6aa3;
}
.cf-fracoes .btn-calcular:hover { background: #095f92; }
.cf-fracoes .btn-calcular:active { transform: translateY(1px); }

/* Limpar */
.cf-fracoes .btn-limpar {
  color: #0b77b6;
  background: #e9f4fb;
  border-color: #0a6aa3;
}
.cf-fracoes .btn-limpar:hover { background: #d8ecf8; }
.cf-fracoes .btn-limpar:active { transform: translateY(1px); }

/* Mobile: deixar lado a lado ou empilhar conforme preferir */
@media (max-width: 640px) {
  .cf-fracoes .cf-actions { flex-wrap: wrap; }
  .cf-fracoes .cf-actions button { min-width: 140px; }
}
