/* ==========================
   Reset e Base
========================== */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #0a0a0a;
  color: #f2f2f2;
  transition: background-color 0.4s ease, color 0.4s ease;
}

body.light-mode {
  background-color: #f9f9f9;
  color: #111;
}

html, body {
  height: 100%;
  display: flex;
  flex-direction: column;
}

body {
  flex: 1;
}

.main {
  flex: 1;
  max-width: 1000px;
  margin: 40px auto;
  padding: 0 20px;
  text-align: center;
  animation: fadeInUp 1s ease;
}

/* ==========================
   Header e Navegação
========================== */
header {
  background-color: #000;
  color: white;
  padding: 20px 0;
  text-align: center;
  animation: fadeIn 1s ease;
  position: relative;
}

body.light-mode header {
  background-color: #fff;
  color: #111;
}

nav {
  margin-top: 10px;
}

nav a {
  color: #ff0033;
  margin: 0 15px;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

body.light-mode nav a {
  color: #cc0029;
}

nav a:hover {
  color: #cc0029;
}

body.light-mode nav a:hover {
  color: #99001f;
}

/* ==========================
   Botão de alternar tema
========================== */
#themeToggle {
  position: absolute;
  top: 15px;
  right: 20px;
  padding: 6px 12px;
  font-size: 1.2rem;
  border-radius: 6px;
  background-color: transparent;
  color: #ff0033;
  border: none;
  outline: none;
  box-shadow: none;
  cursor: pointer;
  transition: color 0.3s ease;
}

#themeToggle:focus {
  outline: none;
}

body.light-mode #themeToggle {
  color: #cc0029;
}

#themeToggle:hover {
  color: #99001f;
}

#themeToggle::after {
  content: attr(data-theme-icon);
  display: inline-block;
  transition: opacity 0.3s ease;
}

/* ==========================
   Conteúdo principal
========================== */


.main h2 {
  font-size: 1.8rem;
  margin-bottom: 10px;
  color: inherit;
}

.tools {
  display: flex;
  justify-content: center;
  align-items: start;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 5rem;
}

/* ==========================
   Cards
========================== */
.tool-card {
  background-color: #111;
  color: #eee;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(255, 0, 0, 0.15);
  padding: 20px;
  width: 280px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: fadeInUp 1s ease;
}

body.light-mode .tool-card {
  background-color: #fff;
  color: #111;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.tool-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 6px 20px rgba(255, 0, 0, 0.3);
}

.tool-card h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: #ff0033;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

body.light-mode .tool-card h3 {
  color: #cc0029;
}

.tool-card p {
  font-size: 0.95rem;
  color: #aaa;
}

body.light-mode .tool-card p {
  color: #555;
}

.tool-card button {
  margin-top: 5px;
  padding: 10px 20px;
  background-color: #ff0033;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

body.light-mode .tool-card button {
  background-color: #cc0029;
}

.tool-card button:hover {
  background-color: #cc0029;
  transform: scale(1.05);
}

body.light-mode .tool-card button:hover {
  background-color: #99001f;
}

.tool-card {
  height: auto;
  min-height: 165px; /* ajuste conforme seus outros cards */
  overflow: hidden;
  position: relative;
}

.tool-card .oculto {
  display: none;
  max-height: 0 !important;
  overflow: hidden !important;
  transition: none !important;
}

.tool-card .btn-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2px;
}

.tool-card .btn-group a button {
  padding: 0.5rem 1.2rem;
  font-size: 0.95rem;
  border: none;
  border-radius: 6px;
  background-color: var(--accent-color, #6c63ff);
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.tool-card .btn-group a button:hover {
  background-color: var(--accent-color-dark, #5146d9);
}

#conversorBox {
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 0;
}

#conversorBox:not(.oculto) {
  max-height: 600px;
}
/* ==========================
   Ocultos
========================== */
.oculto {
  display: none;
}

#geradorSenhaBox {
  margin-top: 15px;
  overflow: hidden;
  transition: max-height 0.3s ease;
  max-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#geradorSenhaBox button:last-of-type {
  margin-top: 10px;
}

#geradorSenhaBox:not(.oculto) {
  max-height: 400px;
}

.contador-caracteres {
  font-size: 0.95rem;
  color: #fff; /* branco mais forte */
  margin-top: 10px; /* empurra mais para baixo */
  margin-bottom: 10px;
  text-align: center;
}

body.light-mode .contador-caracteres {
  color: #222;
}

.senha-config {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  font-size: 0.9rem;
}

.senha-config label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.range-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 15px 0;
}

.range-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.range-container button {
  background-color: #ff0033;
  color: white;
  border: none;
  padding: 0.3rem 0.7rem;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.range-container button:hover {
  background-color: #cc0029;
}

.range-container input[type="range"] {
  width: 160px;
  height: 4px;
  appearance: none;
  background: #555;
  border-radius: 5px;
  outline: none;
}

/* Faixa que desliza */
.range-container input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #ff0033;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 2px #000;
}

/* Firefox */
.range-container input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #ff0033;
  border: 2px solid #fff;
  border-radius: 50%;
  cursor: pointer;
}

/* Botões de + e - reduzidos */
.range-btn {
  padding: 2px 6px;
  font-size: 0.9rem;
  background-color: #ff0033;
  color: #fff;
  border: 1px solid #fff;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.range-btn:hover {
  background-color: #cc002a;
}

#senhaGerada {
  font-size: 0.9rem;
  letter-spacing: 0.5px;
}

.range-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.range-container input[type="range"] {
  width: 100%;
  max-width: 250px;
}

.range-container button {
  background-color: #e60033;
  border: none;
  color: white;
  padding: 0.4rem 0.7rem;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
}

.range-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.contador {
  margin-top: 0.3rem;
  font-size: 0.9rem;
  color: #ccc;
}


/* ==========================
   Senha
========================== */
.senha-container {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 100%;
  margin-top: 10px;
}

.senha-container input {
  width: 100%;
  padding: 10px 40px 10px 10px;
  font-size: 1rem;
  border: 1px solid #ff0033;
  background-color: #1e1e1e;
  border-radius: 8px;
  box-sizing: border-box;
  text-align: center;
  color: #ffffff;
  transition: border-color 0.3s ease;
}

body.light-mode .senha-container input {
  background-color: #fff;
  color: #111;
  border-color: #cc0029;
}

.senha-container input:focus {
  outline: none;
  border-color: #ff0033;
}

.senha-container button {
  position: absolute;
  right: 10px;
  top: -5px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.3s ease;
}

body.light-mode .senha-container button {
  color: #444;
}

.senha-container button:hover {
  color: #ff0033;
}

body.light-mode .senha-container button:hover {
  color: #cc0029;
}

.opcoes-senha {
  display: flex;
  justify-content: space-around;
  margin-top: 15px;
  gap: 10px;
  flex-wrap: wrap;
}

.opcoes-senha label {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
}

.controle-tamanho {
  margin: 15px 0;
}

.controle-tamanho label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
}

.controle-range {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.controle-range input[type="range"] {
  flex: 1;
  max-width: 150px;
}

.controle-range button {
  padding: 6px 12px;
  font-size: 1rem;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  background-color: #ff0033;
  color: white;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

body.light-mode .controle-range button {
  background-color: #cc0029;
}

.controle-range button:hover {
  background-color: #cc0029;
}

body.light-mode .controle-range button:hover {
  background-color: #99001f;
}

.controle-tamanho {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 10px 0;
}

.controle-tamanho button {
  background-color: #d90429;
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 20px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.controle-tamanho button:hover {
  background-color: #a4031f;
}

/* Novo estilo do range */
.controle-tamanho input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 4px;
  background: #444;
  border-radius: 5px;
  outline: none;
}

/* Chrome/Safari thumb */
.controle-tamanho input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #ff0033;
  border: 3px solid white;
  cursor: pointer;
  margin-top: -8px;
  transition: background 0.3s;
}

.controle-tamanho input[type="range"]::-webkit-slider-thumb:hover {
  background: #cc0029;
}

/* Firefox thumb */
.controle-tamanho input[type="range"]::-moz-range-thumb {
  height: 20px;
  width: 20px;
  border-radius: 50%;
  background: #ff0033;
  border: 3px solid white;
  cursor: pointer;
  transition: background 0.3s;
}

.controle-tamanho input[type="range"]::-moz-range-thumb:hover {
  background: #cc0029;
}

.controle-tamanho input[type="range"] {
  accent-color: #d90429;
  width: 150px;
  height: 4px;
}

/* ==========================
   Conversor de Texto
========================== */
#conversorBox {
  margin-top: 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

#conversorBox:not(.oculto) {
  max-height: 600px;
}

#conversorBox textarea {
  width: 100%;
  min-height: 80px;
  resize: vertical;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.95rem;
  border: 1px solid #ff0033;
  background-color: #1e1e1e;
  color: #fff;
  box-sizing: border-box;
}

#conversorBox textarea:focus {
  border-color: #cc0029;
  outline: none;
  box-shadow: 0 0 0 2px rgba(204, 0, 41, 0.4);
}

body.light-mode #conversorBox textarea:focus {
  border-color: #a4031f;
  box-shadow: 0 0 0 2px rgba(164, 3, 31, 0.3);
}


body.light-mode #conversorBox textarea {
  background-color: #fff;
  color: #111;
  border-color: #cc0029;
}

.btn-group {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-group button {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 6px;
  background-color: #ff0033;
  color: #fff;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

body.light-mode .btn-group button {
  background-color: #cc0029;
}

.btn-group button:hover {
  background-color: #cc0029;
}

body.light-mode .btn-group button:hover {
  background-color: #99001f;
}

/* ==========================
   Editor de PDF
========================== */

/* Estilo para o Editor de PDF */
#editorPdfBox {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#editorPdfBox input[type="file"],
#editorPdfBox input[type="text"] {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 0.9rem;
}

#editorPdfBox input[type="text"]::placeholder {
  color: #999;
}

#editorPdfBox button {
  padding: 0.5rem 1rem;
  background-color: #d90429;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#editorPdfBox button:hover {
  background-color: #a4001e;
}

.tool-card.oculto {
  display: none;
}

.btn-group.editor-pdf {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 por linha */
  gap: 10px;
}
/* ==========================
   Footer
========================== */
footer {
  text-align: center;
  margin-top: auto;
  padding: 30px 20px 20px;
  font-size: 0.9rem;
  background-color: #000;
  color: #777;
  animation: fadeIn 1s ease;
}

body.light-mode footer {
  background-color: #fff;
  color: #555;
}

.footer-links {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

.footer-links a {
  color: #ff0033;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

body.light-mode .footer-links a {
  color: #cc0029;
}

.footer-links a:hover {
  color: #ff3366;
}

body.light-mode .footer-links a:hover {
  color: #99001f;
}

.footer-links span {
  color: #555;
}

/* ==========================
   Animações
========================== */
@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================
   Responsividade
========================== */
@media (max-width: 600px) {
  #themeToggle {
    position: static;
    display: block;
    margin: 10px auto 0;
  }

  .tools {
    flex-direction: column;
    align-items: center;
  }
}

header {
  padding-top: 10px;
}
