/* Estilos gerais */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue:wght@300&display=swap&family=Montserrat:wght@400;700&display=swap');

body {
  font-family: 'Montserrat', sans-serif;
  margin: 0;
  padding: 0;
  height: 100%;
}

/* Elementos de logo e background */
.logo-back {
  background-image: url(../../uploads/logo/1.png);
  background-position: top right;
  background-repeat: no-repeat;
  background-size: auto;
  width: 50vw;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  position: absolute;
  padding-right: 150px;
  min-height: 100px;
  height: 40vw;
}

/* Container dos formulários de login e recuperação */
#login-container, #recover-container {
  text-align: center;
  background: #fff;
  padding: 20px;
  width: 30vw;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

#login-container input, 
#recover-container input,
#login-container button,
#recover-container button {
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 15px;
}

/* Estilos para inputs e controles de formulário */
input {
  display: block;
  width: 80%;
  margin-bottom: 10px;
  padding: 8px;
  box-sizing: border-box;
}

input.error {
  border-color: #ff4444;
}

textarea.form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
}

/* Grupos de formulário e grids */
.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: var(--text-color);
  font-weight: 500;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

/* Estilos para mensagens de erro */
.error-message {
  color: #ff4444;
  font-size: 12px;
  margin-top: 4px;
}

.error {
  color: #f44336;
}

/* Estilos de botões */
button,
.btn {
  font-family: 'Montserrat', sans-serif;
  padding: 10px 20px;
  background-color: var(--primary-color);
  color: var(--highlight-color);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

button:hover,
.btn:hover {
  background-color: var(--secondary-color);
  transform: translateY(-1px);
}

/* Botão secundário */
button.btn-secondary,
.btn-secondary {
  background-color: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

button.btn-secondary:hover,
.btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--highlight-color);
}

/* Botão pequeno */
button.btn-sm,
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

/* Botão com ícone */
button i.material-icons,
.btn i.material-icons {
  font-size: 18px;
}

/* Botão de salvar */
button.btn-save,
.btn-save {
  display: block;
  width: 100%;
  background-color: var(--primary-color);
  color: var(--highlight-color);
  padding: 12px 24px;
  font-weight: 500;
  font-size: 16px;
  border-radius: 5px;
  margin-top: 20px;
}

button.btn-save:hover,
.btn-save:hover {
  background-color: var(--secondary-color);
}

/* Botões de ação para laudos */
.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.btn-view {
  background: var(--primary-color);
  color: white;
}

.btn-download {
  background: transparent;
  border: 1px solid var(--primary-color);
  color: var(--primary-color);
}

/* Container de botões com espaçamento */
.button-group {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Botão compartilhar */
#btn-share {
  margin-right: 15px;
}

/* Links */
a {
  display: inline-block;
  margin-top: 10px;
  text-decoration: none;
  color: #007BFF;
}

/* Layout principal */
#main-content {
  margin-left: 250px;
  margin-top: 60px;
  padding: 20px;
  background-color: #ffffff;
  color: var(--secondary-color);
  min-height: 100vh;
  transition: margin-left 0.3s;
}

/* Header e barra de navegação */
#top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1001;
  background: var(--primary-color);
  color: var(--highlight-color);
  padding: 10px;
  text-align: right;
}

/* Layout dos Laudos - Cabeçalho e busca */
.page-header {
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

.add_bt {
  margin-bottom: 25px;
  margin-left: 15px;
}

.search-section {
  padding: 0 1rem;
}

.search-box {
  position: relative;
  width: 500px;
  margin-left: 30px;
  margin-top: 10px;
}

.search-box input {
  width: 100%;
  padding: 1rem 3rem;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.search-box input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(var(--primary-color-rgb), 0.1);
  outline: none;
}

.search-box i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted, #666);
}

/* Resultados de busca */
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin-top: 5px;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 1000;
}

.search-result-item {
  padding: 10px 15px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s;
}

.search-result-item:hover {
  background-color: #f5f5f5;
}

.search-result-item:last-child {
  border-bottom: none;
}

.search-result-title {
  font-weight: 500;
  color: var(--primary-color);
}

.search-result-subtitle {
  font-size: 0.875rem;
  color: #666;
  margin-top: 2px;
}

/* Grid de laudos */
.laudos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 0 1rem;
}

.laudos-list {
  background: white;
  border-radius: 8px;
  overflow: hidden;
}

.laudo-card {
  background: #f8f9fa;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.laudo-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.laudo-content {
  padding: 1.5rem;
}

.laudo-date {
  color: var(--primary-color);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.laudo-client, .laudo-cliente {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 1rem;
  color: var(--text-color);
}

.laudo-actions {
  display: flex;
  gap: 0.5rem;
  padding: 1rem 1.5rem;
  background: var(--bg-light, #f8f9fa);
  border-top: 1px solid var(--border-color, #eee);
}

.laudo-info {
  flex: 1;
}

.laudo-details {
  font-size: 14px;
  color: #666;
}

/* Notificações para o usuário */
#notification-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
}

.notification {
  background: #444;
  color: #fff;
  padding: 15px 20px;
  margin-top: 10px;
  border-radius: 5px;
  opacity: 0;
  animation: slideUp 0.5s forwards, fadeOut 0.5s forwards 3.5s;
  font-size: 14px;
  min-width: 200px;
  text-align: center;
}

.notification.success {
  background: #4caf50;
}

.notification.error {
  background: #f44336;
}

/* Animações */
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Debug Footer */
#debug-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #222;
  color: #ddd;
  font-size: 12px;
  max-height: 200px;
  overflow-y: auto;
  padding: 10px;
  z-index: 999;
  transition: transform 0.3s ease;
}

#debug-footer.hidden {
  transform: translateY(100%);
}

#debug-footer p {
  margin: 0 0 5px;
}

#toggle-debug {
  position: fixed;
  bottom: 210px;
  right: 20px;
  padding: 5px 10px;
  background: #222;
  color: #ddd;
  border: none;
  cursor: pointer;
  z-index: 1000;
  border-radius: 4px;
}

/* Modal e tabelas */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

.modal-content {
  position: relative;
  background: white;
  width: 95%;
  max-width: 1200px;
  height: 80%;
  margin: auto;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  overflow: hidden;
  z-index: 1001;
  padding: 20px;
  margin-top:75px;
}

.fullscreen-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  overflow: hidden;
}

.fullscreen-modal.active {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: var(--primary-color);
  color: white;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.close-modal {
  background: transparent;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

.modal-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.modal-footer {
  padding: 15px 20px;
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid #eee;
}

/* Tabela de Clientes */
#clientes-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

#clientes-table,
#clientes-table th,
#clientes-table td {
  border: 1px solid #ccc;
}

#clientes-table th,
#clientes-table td {
  padding: 10px;
  text-align: left;
}

/* Estilos de laudo detalhado */
.laudo-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.laudo-block {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  padding: 20px;
  margin-bottom: 24px;
}

.laudo-headline {
  color: var(--primary-color);
  font-size: 1.5em;
  font-weight: 600;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--primary-color);
  margin-bottom: 20px;
}

.laudo-subhead, .laudo-subtitle {
  color: var(--secondary-color);
  font-size: 1.2em;
  font-weight: 500;
  margin: 20px 0 15px;
}

.laudo-subtitle {
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 5px;
  margin-bottom: 15px;
}

.laudo-section {
  margin-bottom: 15px;
}

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

.laudo-section select, .laudo-section input {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 5px;
}

.laudo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.laudo-data {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
}

.data-label {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.laudo-table {
  width: 100%;
  border-collapse: collapse;
}

.laudo-table th,
.laudo-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.laudo-table tr:nth-child(even) {
  background-color: #f8f9fa;
}

/* Itens de laudo e análise */
.laudo-item {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  transition: background 0.2s;
  justify-content: space-between;
  background: #f9f9f9;
  border-radius: 5px;
  border: 1px solid #ddd;
}

.laudo-item:nth-child(odd) {
  background: #f8f9fa;
}

.laudo-item:hover {
  background: #f0f0f0;
}

.laudo-item label {
  font-size: 14px;
  color: #333;
  flex-grow: 1;
}

.laudo-item input {
  width: 60px;
  padding: 5px;
  text-align: right;
  border: 1px solid #ccc;
  border-radius: 5px;
  margin-left: 10px;
}

.laudo-item::after {
  content: '%';
  font-size: 14px;
  color: #333;
  margin-left: 5px;
}

.ciclo-capilar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 6px;
  margin: 15px 0;
}

.itens-analise {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.item-analise {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 6px;
}

.item-analise label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
}

.item-analise input {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Assinaturas e elementos relacionados */
.laudo-signatures {
  display: flex;
  justify-content: space-around;
  margin-top: 50px;
}

.signature {
  text-align: center;
  width: 200px;
}

.signature-line {
  height: 1px;
  background: #333;
  margin-bottom: 5px;
}

.signature-role {
  font-size: 0.9rem;
  color: #666;
}

.assinatura-img {
  max-width: 200px;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* Pontos relevantes */
.pontos-relevantes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
}

.ponto-item {
  display: flex;
  border-radius: 6px;
  overflow: hidden;
}

.ponto-item.relevante {
  background: #f0f8ff;
}

.ponto-item.nao-relevante,
.ponto-item.irrelevante {
  background: #f8f8f8;
  color: #888;
}

.ponto-numero {
  background: var(--primary-color);
  color: white;
  padding: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
}

.ponto-content {
  padding: 15px;
  flex: 1;
}

.ponto-titulo {
  font-weight: bold;
  margin-bottom: 5px;
}

/* Imagens */
.laudo-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 15px;
}

.laudo-image {
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
}

.laudo-image img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.image-caption {
  padding: 8px;
  text-align: center;
  font-size: 0.9rem;
  background: #f8f9fa;
}

.no-images {
  grid-column: 1 / -1;
  text-align: center;
  color: #888;
  padding: 20px;
}

/* Estados de carregamento */
.loading {
  text-align: center;
  padding: 30px;
}

/* Elementos de Upload e Previsualização */
.preview-item .remove-button {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(255, 0, 0, 0.0) !important;
  color: #ddd;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-item .remove-button:hover {
  transform: scale(1.1);
}

/* Responsividade */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .laudos-grid {
    grid-template-columns: 1fr;
    padding: 0 0.5rem;
  }

  .search-section {
    padding: 0 0.5rem;
  }
  
  .laudo-grid {
    grid-template-columns: 1fr;
  }
  
  .laudo-signatures {
    flex-direction: column;
    align-items: center;
    gap: 30px;
  }
  
  .pontos-relevantes {
    grid-template-columns: 1fr;
  }
}