/* Estilos Globais */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #343a40;
    line-height: 1.6;
    margin: 0;
    padding: 20px;
}

/* Container Principal */
.container {
    max-width: 900px;
    margin: 20px auto;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

/* Títulos */
h1, h2, h3 {
    color: #0056b3;
    margin-top: 0;
}

h1 {
    font-size: 2.2em;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

h3 {
    font-size: 1.4em;
    margin-top: 30px;
}

/* Parágrafos e Links */
p {
    margin-bottom: 15px;
}

a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Botões */
button, a.button {
    display: inline-block;
    background-color: #007bff;
    color: #ffffff;
    padding: 12px 20px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    margin: 5px 5px 5px 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:hover, a.button:hover {
    background-color: #0056b3;
    text-decoration: none;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Outros */
hr {
    border: 0;
    border-top: 1px solid #dee2e6;
    margin: 30px 0;
}

/* Estilos de Formulário */
form {
    margin-top: 20px;
}

form label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #495057;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    box-sizing: border-box; /* Garante que o padding não afete a largura total */
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Mensagens de Feedback */
.flash-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.flash-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* Estilos de Tabela (para Painel Admin) */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th, table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

table th {
    background-color: #f8f9fa;
    font-weight: bold;
    color: #495057;
}

table tr:hover {
    background-color: #f1f3f5;
}

/* Abas de Navegação */
.nav-tabs {
  display: flex;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 25px;
}

.nav-tabs a {
  padding: 14px 22px;
  text-decoration: none;
  color: #495057;
  font-weight: 500;
  border: none;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease-in-out;
}

.nav-tabs a.active,
.nav-tabs a:hover {
  color: #0056b3;
  border-bottom: 3px solid #007bff;
  text-decoration: none;
}

/* Estilo para Input de Arquivo */
.file-upload-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  margin-bottom: 20px;
}

.file-upload-wrapper input[type=file] {
  font-size: 100px;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
}

.file-upload-btn {
  display: inline-block;
  background-color: #6c757d;
  color: white;
  padding: 12px 20px;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
}

.file-upload-wrapper:hover .file-upload-btn {
    background-color: #5a6268;
}

/* Estilos para resultados da validação */
.validation-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* Estilo para a caixa de pré-visualização do template */
.template-preview {
    border: 1px solid #dee2e6;
    padding: 20px;
    min-height: 200px;
    margin-top: 10px;
    border-radius: 5px;
    background-color: #fdfdfd;
    overflow-wrap: break-word; /* Garante que o texto quebre a linha */
}

/* Estilos aprimorados para os resultados da validação */
.validation-results textarea {
    min-height: 250px;
    background-color: #f8f9fa;
    color: #343a40;
    font-family: "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
}

.validation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.download-link {
    font-size: 13px;
    font-weight: bold;
    padding: 5px 10px;
    background-color: #28a745;
    color: white;
    border-radius: 4px;
    text-decoration: none;
}

/* Estilos para botões de ação em listas (Editar/Excluir) */
.list-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    padding: 6px 12px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 5px;
    text-decoration: none;
    color: white;
    border: none;
    cursor: pointer;
}

.action-btn.edit-btn {
    background-color: #17a2b8;
}

.action-btn.delete-btn {
    background-color: #dc3545;
}

/* Estilos para Paginação */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    gap: 5px;
}

.pagination a {
    color: #007bff;
    padding: 8px 16px;
    text-decoration: none;
    border: 1px solid #dee2e6;
    border-radius: 5px;
    transition: background-color 0.2s, color 0.2s;
}

.pagination a:hover,
.pagination a.active {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

/* Layout do Painel Admin com Menu Lateral */
.admin-panel-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.admin-sidebar {
    flex: 0 0 220px; /* Largura fixa do menu */
}

.admin-content {
    flex: 1; /* Área de conteúdo ocupa o espaço restante */
}

.admin-sidebar .nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.admin-sidebar .nav-menu li a {
    display: block;
    padding: 12px 20px;
    text-decoration: none;
    color: #343a40;
    border-radius: 6px;
    font-weight: 500;
    margin-bottom: 6px;
    transition: background-color 0.2s, color 0.2s;
}

.admin-sidebar .nav-menu li a.active,
.admin-sidebar .nav-menu li a:hover {
    background-color: #007bff;
    color: white;
    text-decoration: none;
}

/* Modificador para container largo (usado no admin) */
.container.container-admin {
    max-width: 1600px;
}

/* Estilos para formulários modernos no admin */
.admin-form input,
.admin-form select,
.admin-form textarea {
    padding: 14px !important;
    font-size: 16px !important;
    border-radius: 8px !important;
}

.admin-form select {
    width: 100%;
    box-sizing: border-box;
}