/* Estilos Gerais */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Ubuntu', sans-serif;
}

body {
    background-color: #f5f5f5;
    color: #333;
    padding: 3px;
    line-height: 1.6; /* Melhora a legibilidade do texto */
}

/* Cabeçalho */
header {
    background-color: #080F29;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Sutil sombra para profundidade */
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo img {
    height: 50px;
}

nav button {
    background-color: #0168c6;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease; /* Transição suave */
}

nav button:hover {
    background-color: #014a8c;
}

/* Barra de Pesquisa (index.php) */
.search-container {
    padding: 1rem 2rem;
    background-color: #e9e9e9;
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid #ddd; /* Linha de separação */
}

.search-container input {
    flex: 1;
    padding: 0.75rem; /* Aumenta o padding */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.search-container button {
    background-color: #28a745;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem; /* Aumenta o padding */
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.search-container button:hover {
    background-color: #218838;
}

/* Botões de Status (index.php) */
.status-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding: 1rem 2rem;
    background-color: #f0f0f0;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap; /* Permite quebrar linha em telas menores */
}

.status-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease; /* Adiciona transição de transform */
    flex-shrink: 0; /* Impede o encolhimento excessivo */
}

.status-btn:hover {
    transform: translateY(-2px); /* Efeito sutil de levantar */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.status-btn.black { background-color: #343a40; }
.status-btn.black:hover { background-color: #1d2124; }

.status-btn.red { background-color: #dc3545; }
.status-btn.red:hover { background-color: #c82333; }

.status-btn.orange { background-color: #fd7e14; } /* Cor mais vibrante */
.status-btn.orange:hover { background-color: #e06c00; }

.status-btn.green { background-color: #28a745; }
.status-btn.green:hover { background-color: #218838; }

.status-btn.blue { background-color: #007bff; }
.status-btn.blue:hover { background-color: #0056b3; }


/* Tabela de Processos (index.php) */
.processos-table {
    padding: 1rem; /*antes 2*/
    background-color: #fff;
    margin: 10px; /*antes 20*/
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto; /* Permite rolagem horizontal em tabelas grandes */
}

.processos-table table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.processos-table th, .processos-table td {
    padding:1px 5px; /*antes 12 15*/
    border: 1px solid #ddd;
    text-align: left;
}

.processos-table th {
    background-color: #080F29;
    color: white;
    font-weight: 500;
    text-transform: uppercase;
}

.processos-table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

.processos-table tbody tr:hover {
    background-color: #e9e9e9;
}

.processos-table td a {
    color: #0168c6;
    text-decoration: none;
    font-weight: bold;
}

.processos-table td a:hover {
    text-decoration: underline;
}

/* Container Principal (histórico.php) */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.1);
}

.container h2 {
    text-align: center;
    color: #080F29;
    margin-bottom: 25px;
    font-size: 2em;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
}

/* Mensagens (Sucesso/Erro) */
.message {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    opacity: 0.95;
    animation: fadeOut 5s forwards; /* Adiciona uma animação para sumir */
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

@keyframes fadeOut {
    0% { opacity: 0.95; }
    80% { opacity: 0.95; }
    100% { opacity: 0; display: none; }
}


/* Seções do Formulário (historico.php) */
section {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); /* Sombra mais suave */
}

section h3 {
    color: #0168c6;
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 18px; /* Espaçamento uniforme */
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: calc(100% - 20px); /* Ajusta a largura para não transbordar com padding */
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #0168c6;
    box-shadow: 0 0 5px rgba(1, 104, 198, 0.3);
    outline: none;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Botões de Ação do Formulário */
input[type="submit"],
.save-btn,
.input_docs {
    background-color: #0168c6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 15px;
    display: inline-block; /* Para que o input_docs aceite padding e margin */
}

input[type="submit"]:hover,
.save-btn:hover,
.input_docs:hover {
    background-color: #014a8c;
    transform: translateY(-1px);
}

.form-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

/* Histórico de Andamentos */
.historico-list, .documentos-list {
    margin-top: 20px;
    border-top: 1px dashed #ddd; /* Adiciona um separador visual */
    padding-top: 20px;
}

.historico-item, .documento-item {
    background-color: #f3f7fa; /* Cor de fundo suave */
    border: 1px solid #e0e6eb;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.historico-item p, .documento-item p {
    margin-bottom: 5px;
    color: #444;
}

.historico-item small, .documento-item small {
    color: #777;
    font-size: 0.85em;
    display: block; /* Garante que a data fique em uma nova linha */
    margin-top: 5px;
}

.documento-item a {
    color: #0168c6;
    text-decoration: none;
    font-weight: bold;
    display: inline-block; /* Permite margin-bottom */
    margin-bottom: 5px;
}

.documento-item a:hover {
    text-decoration: underline;
}

/* Seção de Fotos/Imagens e Localização */
.fotos-container, .localizacao-prints {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsivo para 280px mínimo */
    gap: 20px;
    margin-bottom: 20px;
    padding: 10px; /* Padding interno para os boxes */
    border-radius: 8px;
    background-color: #eff3f7; /* Um fundo sutil para a área de imagens */
}

.foto-box {
    border: 1px solid #cce0f0; /* Borda mais clara */
    padding: 15px;
    border-radius: 8px; /* Bordas mais arredondadas */
    background: #ffffff; /* Fundo branco para cada box */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Sombra mais pronunciada */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.foto-box h4 {
    color: #080F29;
    margin-bottom: 15px;
    font-size: 1.1em;
}

.img-preview {
    width: 100%;
    height: 250px; /* Altura fixa para pré-visualização */
    border: 1px dashed #aaa; /* Borda tracejada para indicar área de drop/colar */
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Garante que a imagem não transborde */
    background-color: #e9eff4; /* Cor de fundo para a área vazia */
    border-radius: 5px;
    margin-bottom: 15px;
}

.img-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Garante que a imagem se ajuste sem cortar */
    display: none; /* Por padrão, oculto, só aparece se houver src */
    border-radius: 4px; /* Pequenas bordas arredondadas na imagem */
}

.foto-actions {
    display: flex;
    flex-wrap: wrap; /* Permite quebrar linha se os botões forem muitos */
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.btn-colar, .btn-remover {
    padding: 8px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); /* Sombra para botões */
}

.btn-colar {
    background-color: #28a745; /* Verde para colar */
    color: white;
}

.btn-colar:hover {
    background-color: #218838;
    transform: translateY(-1px);
}

.btn-remover {
    background-color: #dc3545; /* Vermelho para remover */
    color: white;
}

.btn-remover:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

/* Botão "Limpar Pré-visualizações de Localização" */
.localizacao .button { /* Especificidade para este botão */
    background-color: #6c757d; /* Cinza para limpeza */
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 20px;
    display: block; /* Ocupa a largura total */
    width: fit-content; /* Ajusta à largura do conteúdo */
    margin-left: auto;
    margin-right: auto;
}

.localizacao .button:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}


/* Botão voltar ao topo */
.back-to-top {
    display: none; /* Hidden by default */
    position: fixed; /* Fixed/sticky position */
    bottom: 20px; /* Place the button at the bottom of the page */
    right: 30px; /* Place the button 30px from the right */
    z-index: 99; /* Make sure it does not overlap */
    border: none; /* Remove borders */
    outline: none; /* Remove outline */
    background-color: #0168c6; /* Set a background color */
    color: white; /* Text color */
    cursor: pointer; /* Add a mouse pointer on hover */
    padding: 12px 18px; /* Some padding */
    border-radius: 10px; /* Rounded corners */
    font-size: 1.1em; /* Increase font size */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); /* Sombra para o botão */
    transition: background-color 0.3s ease, transform 0.2s ease;
}

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

/* Responsividade Básica */
@media (max-width: 768px) {
    header, .search-container, .status-buttons {
        flex-direction: column;
        align-items: center;
        padding: 1rem;
    }

    .logo {
        margin-bottom: 1rem;
    }

    nav button {
        width: 100%;
        margin-top: 10px;
    }

    .search-container input, .search-container button {
        width: 100%;
    }

    .status-buttons {
        padding: 0.5rem;
    }

    .status-btn {
        width: calc(50% - 10px); /* Dois botões por linha em telas menores */
        margin-bottom: 10px;
    }

    .container {
        margin: 10px;
        padding: 15px;
    }

    .processos-table {
        padding: 10px;
    }

    .fotos-container, .localizacao-prints {
        grid-template-columns: 1fr; /* Uma coluna em telas muito pequenas */
    }
}

@media (max-width: 480px) {
    .status-btn {
        width: 100%; /* Um botão por linha em telas muito pequenas */
    }
}