/* Estilos customizados para o Sistema de Consulta */

/* Variáveis CSS */
:root {
  --primary-color: #667eea;
  --secondary-color: #764ba2;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #17a2b8;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
}

/* Estilos gerais */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--light-color);
}

/* Sidebar fixo */
.sidebar-fixed {
  position: fixed;
  top: 0;
  left: 0;
  width: 280px;
  height: 100vh;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  box-shadow: 2px 0 20px rgba(0,0,0,0.1);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-brand {
  color: white;
  font-size: 1.25rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.sidebar-brand i {
  font-size: 1.5rem;
  margin-right: 0.75rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.sidebar-toggle:hover {
  background-color: rgba(255,255,255,0.1);
}

.sidebar-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1rem 0;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
}

.sidebar-item {
  margin: 0.25rem 1rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  padding: 0.875rem 1.25rem;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: white;
  background-color: rgba(255,255,255,0.15);
  transform: translateX(8px);
  text-decoration: none;
}

.sidebar-link i {
  width: 20px;
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

.sidebar-link span {
  font-size: 0.95rem;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  background-color: rgba(0,0,0,0.1);
}

.user-info {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background-color: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 0.75rem;
}

.user-avatar i {
  color: white;
  font-size: 1.25rem;
}

.user-details {
  flex: 1;
}

.user-name {
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.25rem;
}

.user-credits,
.user-role {
  color: rgba(255,255,255,0.7);
  font-size: 0.8rem;
  display: flex;
  align-items: center;
}

.user-credits i {
  margin-right: 0.25rem;
  font-size: 0.75rem;
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.75rem;
  background-color: rgba(220, 53, 69, 0.2);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-weight: 500;
}

.logout-btn:hover {
  background-color: rgba(220, 53, 69, 0.3);
  color: white;
  text-decoration: none;
  transform: translateY(-1px);
}

/* Main content fixo */
.main-content-fixed {
  margin-left: 280px;
  min-height: 100vh;
  background-color: var(--light-color);
  transition: margin-left 0.3s ease;
}

/* Top navbar */
.top-navbar {
  background: white;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

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

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--dark-color);
  margin: 0;
}

.navbar-right {
  display: flex;
  align-items: center;
}

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

.credits-display {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-weight: 600;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.page-content {
  padding: 2rem;
}

/* Main content */
.main-content {
  background-color: var(--light-color);
  min-height: 100vh;
}

/* Cards customizados */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border-radius: 0.75rem;
  transition: all 0.3s ease;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-radius: 0.75rem 0.75rem 0 0 !important;
  border: none;
}

/* Botões customizados */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border: none;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.btn-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
  border: none;
  border-radius: 8px;
}

.btn-info {
  background: linear-gradient(135deg, var(--info-color) 0%, #6f42c1 100%);
  border: none;
  border-radius: 8px;
}

/* Badges customizados */
.credits-badge {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
}

/* Navbar customizada */
.navbar {
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
  font-weight: bold;
  color: var(--primary-color) !important;
}

/* Alertas customizados */
.alert {
  border: none;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.alert-success {
  background: linear-gradient(135deg, var(--success-color) 0%, #20c997 100%);
  color: white;
}

.alert-danger {
  background: linear-gradient(135deg, var(--danger-color) 0%, #e74c3c 100%);
  color: white;
}

.alert-warning {
  background: linear-gradient(135deg, var(--warning-color) 0%, #f39c12 100%);
  color: #212529;
}

.alert-info {
  background: linear-gradient(135deg, var(--info-color) 0%, #6f42c1 100%);
  color: white;
}

/* Tabelas customizadas */
.table {
  border-radius: 8px;
  overflow: hidden;
}

.table thead th {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border: none;
  font-weight: 600;
}

.table tbody tr:hover {
  background-color: rgba(102, 126, 234, 0.1);
}

/* Formulários customizados */
.form-control, .form-select {
  border-radius: 8px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Modal customizado */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-radius: 12px 12px 0 0;
}

/* Cards de estatísticas */
.border-start {
  border-left-width: 4px !important;
}

.border-start.border-primary {
  border-left-color: var(--primary-color) !important;
}

.border-start.border-success {
  border-left-color: var(--success-color) !important;
}

.border-start.border-info {
  border-left-color: var(--info-color) !important;
}

.border-start.border-warning {
  border-left-color: var(--warning-color) !important;
}

/* Responsividade */
@media (max-width: 1024px) {
  .sidebar-fixed {
    transform: translateX(-100%);
  }
  
  .sidebar-fixed.show {
    transform: translateX(0);
  }
  
  .main-content-fixed {
    margin-left: 0;
  }
  
  .sidebar-toggle {
    display: block !important;
  }
}

@media (min-width: 1025px) {
  .sidebar-toggle {
    display: none !important;
  }
}

/* Overlay para mobile */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.show {
  opacity: 1;
  visibility: visible;
}

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

.card {
  animation: fadeIn 0.5s ease;
}

/* Loading spinner */
.spinner-border {
  color: var(--primary-color);
}

/* Scrollbar customizada */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* Estilos específicos para o painel admin */
.admin-dashboard .card {
  transition: all 0.3s ease;
}

.admin-dashboard .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.admin-dashboard .stats-card {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  border: 1px solid #e9ecef;
}

.admin-dashboard .stats-card .icon {
  opacity: 0.7;
  transition: all 0.3s ease;
}

.admin-dashboard .stats-card:hover .icon {
  opacity: 1;
  transform: scale(1.1);
}

/* Melhorias para tabelas */
.table-hover tbody tr:hover {
  background-color: rgba(102, 126, 234, 0.1) !important;
  transform: scale(1.01);
  transition: all 0.2s ease;
}

.table thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

/* Badges melhorados */
.badge {
  font-weight: 500;
  letter-spacing: 0.3px;
}

.badge i {
  font-size: 0.75em;
}

/* Botões de ação */
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.875rem;
  border-radius: 0.375rem;
}

/* Modal melhorado */
.modal-content {
  border: none;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  border-bottom: none;
  padding: 1.5rem 1.5rem 1rem;
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  border-top: none;
  padding: 1rem 1.5rem 1.5rem;
}

/* Estados vazios melhorados */
.empty-state {
  padding: 3rem 1rem;
  text-align: center;
}

.empty-state i {
  opacity: 0.3;
  margin-bottom: 1rem;
}

.empty-state h5 {
  color: #6c757d;
  margin-bottom: 0.5rem;
}

.empty-state p {
  color: #adb5bd;
  margin-bottom: 1.5rem;
}

/* Estilos específicos para a página de login */
body.login-page {
  font-family: 'Inter', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

body.login-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
}

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.login-card {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 500px;
  width: 100%;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%);
}

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-logo {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.login-logo i {
  font-size: 2rem;
  color: white;
}

.login-title {
  font-size: 2rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: #718096;
  font-size: 1rem;
  font-weight: 400;
}

.login-card .form-group {
  margin-bottom: 1.5rem;
}

.login-card .form-label {
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.login-card .form-label i {
  color: #667eea;
  font-size: 0.9rem;
}

.login-card .form-control {
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f7fafc;
}

.login-card .form-control:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  background: white;
}

.login-card .form-control::placeholder {
  color: #a0aec0;
}

.btn-login {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 12px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: white;
  width: 100%;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-login::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;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-login:disabled {
  opacity: 0.7;
  transform: none;
}

.login-card .alert {
  border-radius: 12px;
  border: none;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  font-weight: 500;
}

.login-card .alert-danger {
  background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
  color: #c53030;
  border-left: 4px solid #e53e3e;
}

.login-card .alert i {
  margin-right: 0.5rem;
}

.login-footer {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e2e8f0;
}

.login-footer small {
  color: #718096;
  font-size: 0.875rem;
}

/* Animações para login */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-card {
  animation: fadeInUp 0.6s ease-out;
}

/* Estados de loading para login */
.btn-loading {
  position: relative;
  color: transparent;
}

.btn-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Responsividade para login */
@media (max-width: 576px) {
  .login-card {
    padding: 2rem 1.5rem;
    margin: 1rem;
  }
  
  .login-title {
    font-size: 1.75rem;
  }
  
  .login-logo {
    width: 60px;
    height: 60px;
  }
  
  .login-logo i {
    font-size: 1.5rem;
  }
} 