/* =====================================================
   PATOLOGIAS COND - Custom Styles
   ===================================================== */

/* Animações */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}
@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fade-in { animation: fadeIn 0.3s ease-out; }
.slide-in { animation: slideInRight 0.3s ease-out; }

/* Loading spinner */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin-slow 0.8s linear infinite;
}

/* Cards */
.card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }
.card-interactive:hover { transform: translateY(-2px); cursor: pointer; }

/* Badges de gravidade */
.badge-baixa { background: #dcfce7; color: #166534; border: 1px solid #bbf7d0; }
.badge-media { background: #fef9c3; color: #854d0e; border: 1px solid #fde68a; }
.badge-alta { background: #ffedd5; color: #9a3412; border: 1px solid #fdba74; }
.badge-critica { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.badge-estetico { background: #e0f2fe; color: #075985; }
.badge-funcional { background: #f3e8ff; color: #6b21a8; }
.badge-estrutural { background: #fee2e2; color: #991b1b; }

.badge-aberto { background: #dbeafe; color: #1e40af; }
.badge-em_analise { background: #fef9c3; color: #92400e; }
.badge-resolvido { background: #dcfce7; color: #166534; }
.badge-arquivado { background: #f1f5f9; color: #475569; }

/* Sidebar */
.sidebar { 
  width: 260px; min-height: 100vh;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
}
.sidebar-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; border-radius: 10px;
  color: #94a3b8; font-size: 0.9rem;
  transition: all 0.15s; cursor: pointer; margin: 2px 8px;
}
.sidebar-item:hover { background: rgba(255,255,255,0.08); color: #e2e8f0; }
.sidebar-item.active { background: #3b82f6; color: white; }
.sidebar-item .icon { width: 20px; text-align: center; font-size: 1rem; }

/* Formulários */
.form-label { display: block; font-size: 0.8rem; font-weight: 600; color: #374151; margin-bottom: 4px; }
.form-input {
  width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 2px solid #e5e7eb; font-size: 0.9rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none; background: white;
}
.form-input:focus { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
.form-input.error { border-color: #ef4444; }
.form-error { font-size: 0.75rem; color: #ef4444; margin-top: 4px; }
.form-select { appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; }

/* Botões */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 10px; font-weight: 600; font-size: 0.875rem;
  border: none; cursor: pointer; transition: all 0.15s; text-decoration: none;
}
.btn:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary { background: #3b82f6; color: white; }
.btn-primary:hover:not(:disabled) { background: #2563eb; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,246,0.4); }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover:not(:disabled) { background: #dc2626; }
.btn-success { background: #22c55e; color: white; }
.btn-success:hover:not(:disabled) { background: #16a34a; }
.btn-outline { background: transparent; border: 2px solid #e5e7eb; color: #374151; }
.btn-outline:hover:not(:disabled) { border-color: #3b82f6; color: #3b82f6; }
.btn-ghost { background: transparent; color: #6b7280; }
.btn-ghost:hover:not(:disabled) { background: #f1f5f9; color: #374151; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-full { width: 100%; }

/* Checkbox customizado */
.checkbox-custom {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 12px;
  border: 2px solid #e5e7eb; border-radius: 10px; transition: all 0.15s;
}
.checkbox-custom:hover { border-color: #3b82f6; background: #eff6ff; }
.checkbox-custom input[type="checkbox"] { 
  width: 18px; height: 18px; accent-color: #3b82f6;
  cursor: pointer; margin-top: 2px; flex-shrink: 0;
}
.checkbox-custom.checked { border-color: #3b82f6; background: #eff6ff; }

/* Toast notifications */
.toast {
  padding: 14px 18px; border-radius: 12px;
  max-width: 360px; font-size: 0.875rem; font-weight: 500;
  animation: slideInRight 0.3s ease-out;
  display: flex; align-items: flex-start; gap: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.toast-success { background: #dcfce7; color: #166534; border-left: 4px solid #22c55e; }
.toast-error { background: #fee2e2; color: #991b1b; border-left: 4px solid #ef4444; }
.toast-info { background: #dbeafe; color: #1e40af; border-left: 4px solid #3b82f6; }
.toast-warning { background: #fef9c3; color: #92400e; border-left: 4px solid #eab308; }

/* Upload zone */
.upload-zone {
  border: 2px dashed #d1d5db; border-radius: 12px;
  padding: 32px; text-align: center; cursor: pointer;
  transition: all 0.2s; background: #f9fafb;
}
.upload-zone:hover, .upload-zone.drag-over { 
  border-color: #3b82f6; background: #eff6ff; 
}

/* Tabela */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { 
  padding: 12px 16px; font-size: 0.75rem; font-weight: 700; 
  text-transform: uppercase; letter-spacing: 0.05em;
  color: #6b7280; background: #f9fafb; text-align: left;
  border-bottom: 2px solid #e5e7eb;
}
.data-table td { 
  padding: 14px 16px; font-size: 0.875rem; color: #374151;
  border-bottom: 1px solid #f1f5f9; vertical-align: middle;
}
.data-table tr:hover td { background: #f8fafc; }
.data-table tr:last-child td { border-bottom: none; }

/* Modal */
.modal-backdrop { 
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px; backdrop-filter: blur(4px);
}
.modal-content {
  background: white; border-radius: 20px;
  box-shadow: 0 25px 50px rgba(0,0,0,0.25);
  max-height: 90vh; overflow-y: auto;
  animation: fadeIn 0.2s ease-out;
}

/* Stepper */
.step-dot {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.875rem; transition: all 0.3s;
}
.step-dot.active { background: #3b82f6; color: white; }
.step-dot.completed { background: #22c55e; color: white; }
.step-dot.pending { background: #e5e7eb; color: #9ca3af; }
.step-line { height: 2px; flex: 1; transition: background 0.3s; }
.step-line.completed { background: #22c55e; }
.step-line.pending { background: #e5e7eb; }

/* Stat cards */
.stat-card {
  background: white; border-radius: 16px; padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  border-left: 4px solid transparent;
}
.stat-card.blue { border-left-color: #3b82f6; }
.stat-card.green { border-left-color: #22c55e; }
.stat-card.orange { border-left-color: #f97316; }
.stat-card.red { border-left-color: #ef4444; }
.stat-card.purple { border-left-color: #a855f7; }

/* Progress bar */
.progress-bar { height: 8px; background: #e5e7eb; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; transition: width 0.5s ease; }

/* Gravidade colors para charts */
.grav-baixa { color: #22c55e; }
.grav-media { color: #eab308; }
.grav-alta { color: #f97316; }
.grav-critica { color: #ef4444; }

/* Mapa calor */
.heat-cell {
  width: 36px; height: 36px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.65rem; font-weight: 600; cursor: pointer;
  transition: transform 0.15s;
}
.heat-cell:hover { transform: scale(1.2); z-index: 10; }
.heat-0 { background: #f1f5f9; color: #94a3b8; }
.heat-1 { background: #dcfce7; color: #166534; }
.heat-2 { background: #fef9c3; color: #854d0e; }
.heat-3 { background: #ffedd5; color: #9a3412; }
.heat-4 { background: #fee2e2; color: #991b1b; }
.heat-5 { background: #dc2626; color: white; }

/* Photo grid */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.photo-thumb {
  aspect-ratio: 1; border-radius: 10px; overflow: hidden;
  position: relative; cursor: pointer; background: #f1f5f9;
  border: 2px solid transparent; transition: border-color 0.15s;
}
.photo-thumb:hover { border-color: #3b82f6; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; }
.photo-thumb .remove-btn {
  position: absolute; top: 4px; right: 4px;
  background: rgba(239,68,68,0.9); color: white;
  border-radius: 50%; width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; opacity: 0; transition: opacity 0.15s;
}
.photo-thumb:hover .remove-btn { opacity: 1; }

/* Scrollbar customizado */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* Responsive helpers */
@media (max-width: 768px) {
  .sidebar { width: 100%; min-height: auto; }
  .hide-mobile { display: none !important; }
}

/* Print styles para relatórios */
@media print {
  .no-print { display: none !important; }
  .card { box-shadow: none; border: 1px solid #e5e7eb; }
  body { background: white; }
}
