/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 18px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f7f7f7;
  color: #333;
  line-height: 1.6;
}

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}

.logo img {
  width: 64px;
  height: auto;
}

.logo h1 {
  font-size: 2rem;
}

.logo .leitor {
  font-weight: bold;
  color: #333;
}

.logo .visual {
  font-weight: bold;
  color: #0078D4;
}

/* Configurações */
.configuracao {
  margin-bottom: 20px;
  border: 1px solid #ccc;
  padding: 10px;
  background-color: #fff;
  border-radius: 8px;
}

.configuracao summary {
  font-weight: bold;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 5px;
}

.configuracao summary:hover {
  background-color: #f0f0f0;
  border-radius: 4px;
}

.config-row {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 10px;
}

.config-row label.cor{
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

input[type="color"] {
  width: 50px;
  height: 25px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.config-row label {
  display: flex;
  flex-direction: column;
  font-size: 0.9rem;
}

.exportSelect {
  height: 25px;
  padding: 2px;
  border-radius: 4px;
  border: 1px solid #ccc;
}

/* Botões */
.button-row {
  position: sticky;
  bottom: 0;
  background: #ffffff;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.2rem;
  padding-top: 0.5rem;
  border-top: 1px solid #ccc;
  margin-top: 1rem;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.config-row, .button-row {
  flex-direction: column;
}

.coluna {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 7px;
}

.coluna button {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.coluna button:hover {
  transform: scale(1.1);
}

button {
  padding: 8px;
  font-size: 1rem;
  border: none;
  border-radius: 6px;
  background-color: #0078D4;
  color: white;
  cursor: pointer;
  transition: background 0.3s;
}

button:hover {
  background-color: #005a9e;
}

button:active {
  transform: scale(0.95);
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropbtn {
  background-color: #333;
  margin-bottom: 1rem;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 38px;
  left: 0;
  background-color: #fff;
  border: 1px solid #ccc;
  min-width: 160px;
  z-index: 1;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.dropdown-content button {
  width: 100%;
  background-color: transparent;
  color: #333;
  padding: 8px;
  text-align: left;
  border-radius: 0;
}

.dropdown-content button:hover {
  background-color: #f0f0f0;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Text editor */
#text-container {
  margin-top: 20px;
  background-color: #fff;
  padding: 15px;
  border-radius: 8px;
  border: 1px solid #ccc;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

#text {
  min-height: 200px;
  outline: none;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.8;
}

#text p {
  margin-bottom: 0.5em;
}

#text p:empty {
  margin-bottom: 0;
  height: 0;
}

.progress-wrapper {
  margin-top: 10px;
}

progress {
  width: 100%;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
}

progress::-webkit-progress-bar {
  background-color: #f0f0f0;
  border-radius: 10px;
}

progress::-webkit-progress-value {
  background-color: #0078D4;
  border-radius: 10px;
}

/* Controle da fonte */
.controle-fonte {
    bottom: 0;
    padding: 10px 0 0 0;
    right: 50px;
    margin-top: -14px;
}

.controle-fonte button {
    background-color: #535353;
    width: 30px;
    height: 30px;
    font-size: 18px;
    margin: 0 2px;
    padding: 3px;
    border-radius: 4px;
}

.controle-fonte button:hover {
    background-color: #444444;  
}

/* Placeholder visual para contenteditable */
#text:empty:before {
  content: attr(data-placeholder);
  color: #888;
  pointer-events: none;
}

/* Estilo do botão de colar */
#pasteBtn {
  margin-top: 10px;
  padding: 8px 14px;
  background-color: #4CAF50;
  color: white;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
}

#pasteBtn:hover {
  background-color: #45a049;
}

/* Botão voltar ao topo */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  background-color: #0078D4;
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1000;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background-color: #005a9e;
  transform: translateY(-2px);
}

/* Melhorias de acessibilidade */
input[type="number"] {
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

select {
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
}

input[type="checkbox"] {
  margin-right: 5px;
}

input[type="file"] {
  padding: 4px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
}

/* Animações suaves */
.highlighted {
  transition: all 0.3s ease;
}

/* Responsividade */
@media (max-width: 768px) {
  .logo {
    margin: 0.5rem;
    padding: 0;
  }

  .logo h1 {
    font-size: 1.3rem;
  } 
  
  details.configuracao h2 {
    font-size: .9rem;
    margin-top: 0.5rem;
  }

  .back-to-top {
    bottom: 80px;
    right: 15px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }

  main {
    padding: 15px;
  }
}

@media (max-width: 500px) {
  .hide-on-mobile {
    display: none;
  }
}

/* Melhorias visuais para destaque */
.sentence-highlight {
  border-radius: 3px;
  padding: 2px 4px;
  transition: all 0.2s ease;
}

.word-highlight {
  border-radius: 2px;
  padding: 1px 2px;
  transition: all 0.2s ease;
}

