/* style.css */

/* Estilos Globais e Reset Básico */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 30px auto;
    padding: 25px 30px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
}

h1, h2 {
    color: #333;
    margin-bottom: 20px;
    font-weight: 600;
}

p.instructions {
    color: #666;
    font-size: 0.95em;
    margin-bottom: 20px;
    line-height: 1.5;
}

hr {
    border: 0;
    height: 1px;
    background: #e0e0e0;
    margin: 30px 0;
}

/* Estilos para Botões */
.buttons {
    margin-top: 25px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px; /* Espaçamento entre os botões */
}

.buttons button,
.buttons a button { /* Para links que agem como botões */
    background-color: #007bff;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.05em;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 3px 6px rgba(0, 123, 255, 0.2);
    text-decoration: none; /* Remover sublinhado para links */
    display: inline-block; /* Para garantir padding e margem corretos em links */
}

.buttons button:hover,
.buttons a button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.buttons button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Estilos para a Grelha de Dígitos */
.grid-container {
    display: grid;
    /* Ajuste aqui para 20 colunas, cada uma com 25px */
    grid-template-columns: repeat(20, 12px);
    border: 2px solid #555;
    margin: 20px auto;
    width: fit-content; /* Ajusta a largura ao conteúdo */
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    background-color: #eee; /* Cor de fundo da grelha */
}

.grid-cell {
    width: 12px;
    height: 12px;
    border: 1px solid #ccc; /* Linhas da grelha */
    background-color: #fff; /* Célula vazia branca */
    cursor: pointer;
    box-sizing: border-box; /* Incluir borda no tamanho */
    transition: background-color 0.2s ease;
}

.grid-cell.filled {
    background-color: #000; /* Célula preenchida de preto */
}

/* Estilos para o Canvas de Desenho (se aplicável, do criar_exemplo.html) */
.canvas-container {
    border: 2px solid #333;
    margin: 0 auto 20px auto;
    width: fit-content;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #fff; /* Fundo branco para o canvas */
}

#drawingCanvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

/* Estilos para Mensagens (usadas em ver_exemplos.html e criar_exemplo.html) */
.info-message {
    margin-top: 20px;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 1.1em;
    color: #555;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
    text-align: left;
}

.info-message.error {
    color: #dc3545;
    background-color: #f8d7da;
    border-color: #f5c6cb;
    font-weight: bold;
}

.info-message.success {
    color: #28a745;
    background-color: #d4edda;
    border-color: #c3e6cb;
    font-weight: bold;
}

/* Estilos para Inputs e Selects */
.digit-input {
    margin-top: 20px;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.digit-input label {
    margin-right: 10px;
    font-weight: 500;
}

.digit-input input[type="number"],
select {
    padding: 8px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
    text-align: center;
    -moz-appearance: textfield; /* Remove setas em Firefox */
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Estilos específicos para ver_exemplos.html */
.filter-options, .batch-actions {
    margin-bottom: 15px;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center; /* Centralizar os itens em ver_exemplos */
}

.filter-options label, .batch-actions label {
    font-weight: 500;
}

.filter-options select, .filter-options button,
.batch-actions select, .batch-actions button {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ccc;
    font-size: 1em;
    cursor: pointer;
}

.filter-options button, .batch-actions button {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}
.filter-options button:hover, .batch-actions button:hover {
    background-color: #0056b3;
}
.batch-actions #selectDigitValue {
    width: 80px;
}

/* Lista de Exemplos em ver_exemplos.html */
.examples-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    max-height: 600px;
    overflow-y: auto;
    background-color: #f9f9f9;
}
.example-item {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.2s ease-in-out;
    position: relative;
}
.example-item.selected {
    border-color: #007bff;
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
    background-color: #e6f2ff;
}
.example-item.trained {
    background-color: #f0f0f0;
    opacity: 0.8;
}
.example-item img {
    max-width: 100px;
    max-height: 100px;
    border: 1px solid #ddd;
    margin-bottom: 10px;
    background-color: #fff;
}
.example-item p {
    margin: 5px 0;
    font-size: 0.9em;
    color: #555;
}
.example-item .checkbox {
    position: absolute;
    top: 5px;
    right: 5px;
    margin: 0;
    z-index: 10;
}
.example-item .checkbox input[type="checkbox"] {
    transform: scale(1.3);
    cursor: pointer;
}
.digit-editor {
    margin-top: 5px;
}
.digit-editor select {
    padding: 5px;
    border-radius: 3px;
    border: 1px solid #ccc;
    font-size: 0.9em;
}

/* Responsividade Básica */
@media (max-width: 600px) {
    .container {
        margin: 20px 15px;
        padding: 20px;
    }
    .buttons {
        flex-direction: column;
        align-items: center;
    }
    .buttons button,
    .buttons a button {
        width: 100%;
        max-width: 250px;
    }
    .filter-options, .batch-actions {
        flex-direction: column;
        align-items: flex-start;
    }
}
.info-message {
    transition: opacity 0.5s ease-out;
    /* outros estilos que você já tenha */
}
.digit-dropdown {
  padding: 8px 12px;
  border-radius: 4px;
  border: 1px solid #ccc;
  font-size: 16px;
  background-color: white;
  cursor: pointer;
  margin-left: 10px;
}

.digit-dropdown:hover {
  border-color: #888;
}

.digit-dropdown:focus {
  outline: none;
  border-color: #4a90e2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}