/*
  estilo.css - CSS para o sistema de Gestão de Serviços
*/

/* --- Reset e Configurações Básicas --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Arial", sans-serif;
  background-color: #f4f7f9;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

/* --- Títulos --- */
h1 {
  text-align: center;
  color: #007bff;
  margin-bottom: 30px;
  font-size: 2.2em;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
}

h2 {
  color: #007bff;
  text-align: center;
  border-bottom: 2px solid #007bff;
  padding-bottom: 5px;
  margin-top: 25px;
  margin-bottom: 15px;
  font-size: 1.5em;
}

/* --- Formulário Principal --- */
#form-registro-servico {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-width: 800px;
  margin: 0 auto 40px auto;
}

/* --- Campos na Mesma Linha --- */
.linha-campos {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 15px;
}

.campo {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 180px;
}

.campo label {
  margin-top: 0;
}

/* --- Elementos de Formulário --- */
label {
  display: block;
  margin-top: 15px;
  margin-bottom: 5px;
  font-weight: bold;
  color: #555;
}

input[type="text"],
input[type="number"],
input[type="tel"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  transition: border-color 0.3s;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #007bff;
  outline: none;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}

textarea {
  resize: vertical;
}

/* --- Componentes Específicos --- */
.anexo-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.btn-anexar {
  padding: 10px 15px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  flex-shrink: 0;
}

#nome-arquivo-selecionado {
  font-style: italic;
  color: #555;
  font-size: 0.9em;
}

#alertas-veiculo-container {
  background-color: #fff8e1;
  border: 1px solid #ffecb3;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
}

#alertas-veiculo-container h3 {
  color: #f57f17;
  margin: 0 0 10px;
  text-align: center;
  border-bottom: 1px solid #ffecb3;
  padding-bottom: 10px;
}

#lista-alertas {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.alerta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px;
}

.alerta-info {
  display: flex;
  flex-direction: column;
}

.alerta-info span:first-child {
  font-weight: bold;
  color: #333;
}

.alerta-info span:last-child {
  font-size: 0.9em;
}

.btn-add-service {
  padding: 5px 10px;
  font-size: 0.9em;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

#servicos-adicionados-container {
  background-color: #e9f7ef;
  border: 1px solid #b2dfdb;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
}

#servicos-adicionados-container h4 {
  color: #004d40;
  margin: 0 0 10px;
  text-align: center;
}

#servicos-adicionados-lista {
  list-style-type: none;
  padding-left: 0;
}

#servicos-adicionados-lista li {
  background-color: #fff;
  padding: 8px;
  border-radius: 4px;
  margin-bottom: 5px;
}

.btn-add-outro-servico {
  width: 100%;
  padding: 10px;
  margin: 15px 0;
  background-color: transparent;
  color: #007bff;
  border: 2px dashed #007bff;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

button[type="submit"] {
  display: block;
  width: 100%;
  padding: 12px 20px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 20px;
}

#filtro-container {
  display: flex;
  justify-content: center;
  gap: 10px;
  align-items: center;
  background-color: #e9ecef;
  padding: 15px;
  border-radius: 4px;
  max-width: 800px;
  margin: 0 auto 20px;
}

#filtro-container label {
  margin: 0;
  font-weight: normal;
}

#filtro-container input[type="text"] {
  width: auto;
  flex-grow: 1;
  max-width: 250px;
  margin: 0;
}

#filtro-container button {
  padding: 10px 15px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
}

#historico-servicos {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  max-width: 800px;
  margin: 0 auto;
  min-height: 100px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.servico-item {
  background-color: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  border: 1px solid #dee2e6;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.placa {
  font-weight: bold;
  color: #007bff;
}

.btn-ver-detalhes {
  padding: 8px 12px;
  background-color: #28a745;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

/* --- MODAIS --- */
.modal-backdrop {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
}

.modal-content,
.modal-content-info {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  position: relative;
}

.modal-content-info {
  max-width: 400px;
  text-align: center;
}

.modal-header h3 {
  color: #007bff;
  border-bottom: 2px solid #007bff;
  padding-bottom: 10px;
  margin-bottom: 15px;
  text-align: center;
}

.modal-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid #ccc;
}

.modal-footer button {
  padding: 10px 15px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  flex: 1;
  margin: 0 5px;
}

.btn-voltar,
#btn-cancelar-confirm {
  background-color: #6c757d;
  color: white;
}

.btn-editar {
  background-color: #ffc107;
  color: #333;
}

.btn-salvar {
  background-color: #28a745;
  color: white;
}

.btn-excluir {
  background-color: #dc3545;
  color: white;
}

#info-modal .modal-footer {
  justify-content: center;
}

#btn-fechar-info-modal {
  flex: none;
  width: 100px;
  background-color: #007bff;
}

#confirm-modal .modal-footer button {
  flex: 0;
  width: 45%;
}

.modal-body {
  max-height: 60vh;
  overflow-y: auto;
}

.modal-body img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 4px;
  cursor: pointer;
}

#filtro-servico-container {
  margin-bottom: 15px;
}

#filtro-servico-modal {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
}

.historico-paginado-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.servico-detalhe-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-ver-servico-detalhado {
  padding: 5px 10px;
  font-size: 0.9em;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
}

.paginacao-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
}

.paginacao-controls button {
  flex: 0;
  width: auto;
  padding: 8px 16px;
  background-color: #6c757d;
}

.paginacao-controls button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.modal-header .modal-close {
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 28px;
  font-weight: bold;
  color: #aaa;
  cursor: pointer;
}

#lista-veiculos-cliente {
  margin-top: 20px;
  max-height: 250px;
  overflow-y: auto;
}

.veiculo-item-selecao {
  padding: 15px;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  margin-bottom: 10px;
  cursor: pointer;
}

.btn-novo-veiculo {
  background-color: #28a745;
  color: white;
  font-size: 1em;
}

.modal-footer-camera {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.modal-footer-camera button {
  width: 100%;
  padding: 12px;
  font-size: 1em;
  color: white;
  border: none;
  border-radius: 4px;
}

#btn-abrir-camera {
  background-color: #007bff;
}

#btn-escolher-arquivo {
  background-color: #17a2b8;
}

.image-viewer-backdrop {
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1002;
}

.image-viewer-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

.image-viewer-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 90vh;
}

.form-quick-service {
  text-align: left;
}

.form-quick-service label {
  margin-top: 10px;
}

.alerta-ok {
  color: #28a745;
}

.alerta-amarelo {
  color: #ffc107;
  font-weight: bold;
}

.alerta-vermelho {
  color: #dc3545;
  font-weight: bold;
}

.hidden {
  display: none;
}

.btn-remover-servico-adicionado {
  background-color: #e74c3c;
  color: white;
  border: none;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  margin-left: 10px;
  transition: background-color 0.2s ease;
  vertical-align: middle;
}

.btn-remover-servico-adicionado:hover {
  background-color: #c0392b;
}

@media (max-width: 600px) {
  #filtro-container {
    flex-direction: column;
    align-items: stretch;
  }

  #filtro-container input[type="text"] {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .linha-campos {
    flex-direction: column;
  }

  .campo {
    min-width: 100%;
  }
}
