/* ============================================
   ESTILOS PARA DOCUMENTOS MÉDICOS - VERSÃO MELHORADA
   Design profissional e moderno
   ============================================ */

/* Categoria de Documentos (Acordeão) */
.doc-category {
  margin-bottom: 1.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
}

.doc-category:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* Header da Categoria (Botão Clicável) */
.category-header {
  width: 100%;
  padding: 1.25rem 1.5rem;
  background: linear-gradient(135deg, #6b65c1 0%, #8b7fd9 100%);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: left;
  position: relative;
  overflow: hidden;
}

.category-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.category-header:hover::before {
  left: 100%;
}

.category-header:hover {
  background: linear-gradient(135deg, #5a54a8 0%, #7a6fc0 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(107, 101, 193, 0.3);
}

.category-header:active {
  transform: translateY(0);
}

.category-icon {
  font-size: 1.75rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.category-title {
  flex: 1;
  font-size: 1.1rem;
  letter-spacing: 0.3px;
}

.category-arrow {
  font-size: 1rem;
  transition: transform 0.3s ease;
  flex-shrink: 0;
  opacity: 0.9;
}

.category-header.active .category-arrow {
  transform: rotate(180deg);
}

/* Conteúdo da Categoria */
.category-content {
  padding: 2rem 1.5rem;
  background: linear-gradient(to bottom, #fafbfc 0%, #ffffff 100%);
  border-top: 1px solid #e5e7eb;
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 2000px;
  }
}

/* Grid de Documentos */
.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .doc-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
}

/* Item de Upload de Documento */
.doc-upload-item {
  position: relative;
}

.upload-area-small {
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.75rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #ffffff;
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  position: relative;
  overflow: hidden;
}

.upload-area-small::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(107, 101, 193, 0.05) 0%, rgba(139, 127, 217, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 0;
}

.upload-area-small:hover::before {
  opacity: 1;
}

.upload-area-small:hover {
  border-color: #6b65c1;
  border-style: solid;
  background: #ffffff;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(107, 101, 193, 0.2);
}

.upload-area-small:active {
  transform: translateY(-2px);
}

.upload-icon-small {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.upload-area-small:hover .upload-icon-small {
  transform: scale(1.1);
}

.upload-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  display: block;
  position: relative;
  z-index: 1;
  line-height: 1.4;
}

.upload-area-small small {
  font-size: 0.8rem;
  color: #64748b;
  display: block;
  position: relative;
  z-index: 1;
  font-weight: 500;
}

/* Preview de Arquivo */
.file-preview-small {
  margin-top: 0.75rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border: 2px solid #86efac;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #166534;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.15);
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.file-preview-small::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: white;
  border-radius: 50%;
  font-size: 0.875rem;
  font-weight: bold;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(34, 197, 94, 0.3);
}

/* Upload Múltiplo (Atestados) */
.doc-upload-multiple .upload-area-small {
  border-style: solid;
  border-width: 2px;
  border-color: #c084fc;
  background: linear-gradient(135deg, #faf5ff 0%, #ffffff 100%);
}

.doc-upload-multiple .upload-area-small::before {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
}

.doc-upload-multiple .upload-area-small:hover {
  border-color: #a855f7;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.25);
}

.doc-upload-multiple .upload-label {
  color: #7c3aed;
}

.doc-upload-multiple .upload-icon-small {
  filter: drop-shadow(0 2px 4px rgba(168, 85, 247, 0.3));
}

/* Hint Text */
.hint {
  font-size: 0.95rem;
  color: #475569;
  margin-bottom: 1.75rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  border-left: 4px solid #6b65c1;
  border-radius: 8px;
  line-height: 1.6;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* Responsividade para Tablet */
@media (max-width: 1024px) {
  .doc-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Responsividade para Mobile */
@media (max-width: 480px) {
  .category-header {
    padding: 1rem 1.25rem;
    font-size: 1rem;
  }
  
  .category-icon {
    font-size: 1.5rem;
  }
  
  .category-title {
    font-size: 1rem;
  }
  
  .category-content {
    padding: 1.5rem 1rem;
  }
  
  .doc-grid {
    grid-template-columns: 1fr;
  }
  
  .upload-area-small {
    min-height: 140px;
    padding: 1.5rem 1rem;
  }
  
  .upload-icon-small {
    font-size: 2rem;
  }
  
  .upload-label {
    font-size: 0.9rem;
  }
  
  .hint {
    font-size: 0.875rem;
    padding: 0.875rem 1rem;
  }
}

/* Animação de Sucesso ao Fazer Upload */
@keyframes successPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

.file-preview-small.success {
  animation: successPulse 0.6s ease, fadeInUp 0.4s ease;
  border-color: #22c55e;
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

/* Efeito de Loading ao Processar Upload */
.upload-area-small.uploading {
  pointer-events: none;
  opacity: 0.7;
  border-color: #6b65c1;
  border-style: solid;
}

.upload-area-small.uploading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border: 3px solid #e5e7eb;
  border-top-color: #6b65c1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  z-index: 2;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Melhorias de Acessibilidade */
.category-header:focus {
  outline: 3px solid #6b65c1;
  outline-offset: 2px;
}

.upload-area-small:focus-within {
  outline: 3px solid #6b65c1;
  outline-offset: 2px;
  border-color: #6b65c1;
}

/* Badge de Obrigatório */
.required-badge {
  display: inline-block;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-left: 0.5rem;
  font-weight: 600;
  vertical-align: middle;
}

/* Tooltip de Ajuda */
.upload-tooltip {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 20px;
  height: 20px;
  background: #6b65c1;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: help;
  z-index: 2;
  transition: all 0.3s ease;
}

.upload-tooltip:hover {
  background: #5a54a8;
  transform: scale(1.1);
}
