/* --------- MODO CLARO MODERNIZADO ---------- */
body {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  background-attachment: fixed;
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  scroll-behavior: smooth;
}

.card {
  margin-top: 100px !important;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(74, 85, 104, 0.1);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.form-control,
.form-select {
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  background-color: #f8fafc;
  color: #2d3748;
  font-size: 1rem;
  transition: all 0.3s ease;
  font-family: inherit;
  padding: 12px 16px;
}

.form-control:focus,
.form-select:focus {
  outline: none;
  border-color: #4a5568;
  background-color: white;
  box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.1);
  transform: translateY(-2px);
}

.btn {
  border-radius: 50px;
  font-weight: 600;
  padding: 12px 24px;
  font-size: 1rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  box-shadow: 0 8px 25px rgba(74, 85, 104, 0.3);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(74, 85, 104, 0.4);
  background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
}

.btn-outline-dark {
  background: rgba(255, 255, 255, 0.15);
  color: #2d3748;
  border: 2px solid rgba(45, 55, 72, 0.3);
  backdrop-filter: blur(10px);
}

.btn-outline-dark:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  color: #4a5568;
  border-color: #4a5568;
}

.navbar-custom {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all 0.3s ease;
  padding: 20px 0; /* Aumentado para melhor proporção */
  min-height: 90px; /* Altura aumentada */
}

.table {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.table > tbody > tr:nth-of-type(odd) {
  background-color: #f8fafc;
}

.table th, .table td {
  vertical-align: middle !important;
  font-size: 1.04rem;
  padding: 16px;
  border-color: #e2e8f0;
}

.table th {
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  color: #2d3748;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.875rem;
}

.pagination .page-link {
  border-radius: 12px !important;
  margin: 0 2px;
  border: 2px solid #e2e8f0;
  color: #2d3748;
  padding: 10px 16px;
  transition: all 0.3s ease;
}

.pagination .page-link:hover {
  background: #4a5568;
  border-color: #4a5568;
  color: white;
  transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%);
  border-color: #4a5568;
  box-shadow: 0 4px 15px rgba(74, 85, 104, 0.3);
}

.list-group-item-action {
  transition: all 0.3s ease;
  border-radius: 16px;
  margin-bottom: 8px;
  background: white;
  border: 1px solid rgba(74, 85, 104, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.list-group-item-action:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(74, 85, 104, 0.15);
  border-color: #4a5568;
  background: rgba(74, 85, 104, 0.05);
}

footer {
  color: rgba(255, 255, 255, 0.8) !important;
  font-size: 15px;
  background: linear-gradient(135deg, #2d3748 0%, #1a202c 100%);
  margin: 60px -15px 0 -15px;
  padding: 15px 15px; /* Reduzido ainda mais para equilibrar */
  border-radius: 20px 20px 0 0;
  position: relative;
  min-height: 50px; /* Altura reduzida para melhor proporção */
}

/* Footer simples para template base */
footer.text-center {
  background: none !important;
  color: inherit !important;
  margin: 20px 0 0 0 !important;
  padding: 15px 0 !important;
  border-radius: 0 !important;
  text-align: center !important;
  min-height: auto !important;
}

footer.text-center::before {
  display: none !important;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  
}

footer a {
  color: #4a5568;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 500;
}

footer a:hover {
  color: #718096;
  text-decoration: underline;
}

i.bi {
  transition: all 0.3s ease;
}

.list-group-item-action:hover i.bi {
  color: #4a5568 !important;
  transform: scale(1.1);
}

/* Adicionar espaçamento para navbar fixa */
.container {
  padding-top: 0px; /* Ajustado para navbar mais alto */
}

/* Badges modernos */
.badge {
  border-radius: 20px;
  padding: 6px 12px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.badge.bg-danger {
  background: linear-gradient(135deg, #e53e3e, #c53030) !important;
}

.badge.bg-primary {
  background: linear-gradient(135deg, #4a5568, #2d3748) !important;
}

/* Efeitos modernos adicionais */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeInUp 0.6s ease forwards;
}

/* --------- ANIMAÇÕES E EFEITOS MODERNOS ---------- */

/* Scroll suave */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
}

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

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(74, 85, 104, 0.4);
  }
  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(74, 85, 104, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(74, 85, 104, 0);
  }
}

/* Aplicar animações */
.list-group-item-action {
  animation: slideInUp 0.6s ease forwards;
}

.list-group-item-action:nth-child(1) { animation-delay: 0.1s; }
.list-group-item-action:nth-child(2) { animation-delay: 0.2s; }
.list-group-item-action:nth-child(3) { animation-delay: 0.3s; }
.list-group-item-action:nth-child(4) { animation-delay: 0.4s; }
.list-group-item-action:nth-child(5) { animation-delay: 0.5s; }
.list-group-item-action:nth-child(6) { animation-delay: 0.6s; }

.btn-primary:hover {
  animation: pulse 0.6s;
}

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

::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.5);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #4a5568, #2d3748);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #2d3748, #4a5568);
}

.dark-mode ::-webkit-scrollbar-track {
  background: rgba(45, 55, 72, 0.5);
}

/* Melhorias de acessibilidade */
.btn:focus,
.form-control:focus,
.form-select:focus {
  outline: 3px solid rgba(74, 85, 104, 0.4);
  outline-offset: 2px;
}

/* Transições suaves para mudanças de tema */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Sombras modernas */
.modern-shadow {
  box-shadow: 
    0 1px 3px rgba(0, 0, 0, 0.12),
    0 1px 2px rgba(0, 0, 0, 0.24);
}

.modern-shadow-hover:hover {
  box-shadow: 
    0 14px 28px rgba(0, 0, 0, 0.25),
    0 10px 10px rgba(0, 0, 0, 0.22);
}

/* Loading spinner para botões */
.btn .fa-spinner,
.btn .bi-arrow-clockwise {
  animation: spin 1s linear infinite;
}

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

/* Melhorar tipografia */
h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Cards com hover effect melhorado */
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 70px rgba(74, 85, 104, 0.15);
}

/* Inputs com animação de label flutuante */
.form-floating .form-control:focus ~ label,
.form-floating .form-control:not(:placeholder-shown) ~ label {
  opacity: 0.65;
  transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
}

/* Alertas modernos */
.alert {
  border-radius: 16px;
  border: none;
  padding: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.alert-success {
  background: linear-gradient(135deg, rgba(72, 187, 120, 0.1), rgba(56, 161, 105, 0.1));
  color: #2f855a;
  border: 1px solid rgba(72, 187, 120, 0.3);
}

.alert-danger {
  background: linear-gradient(135deg, rgba(229, 62, 62, 0.1), rgba(197, 48, 48, 0.1));
  color: #c53030;
  border: 1px solid rgba(229, 62, 62, 0.3);
}

.alert-info {
  background: linear-gradient(135deg, rgba(74, 85, 104, 0.1), rgba(45, 55, 72, 0.1));
  color: #4a5568;
  border: 1px solid rgba(74, 85, 104, 0.3);
}

/* --------- MELHORIAS DE PROPORÇÃO NAVBAR E FOOTER ---------- */

/* Garantir que o logo tenha tamanho proporcional */
.navbar-brand img {
  height: 45px; /* Aumentado para ficar proporcional */
  width: auto;
  margin-right: 6px;
  transition: all 0.3s ease;
}

/* Ajustar tamanho do texto da marca */
.navbar-brand {
  font-size: 1.3rem; /* Ligeiramente aumentado */
  line-height: 1.2;
}

/* Melhorar espaçamento dos botões no navbar */
.user-info {
  padding: 8px 16px; /* Aumentado para ficar proporcional */
  font-size: 1rem; /* Tamanho normal */
}

/* Ajustar altura dos botões do navbar */
.navbar .btn {
  padding: 10px 18px; /* Padding aumentado */
  font-size: 0.95rem;
}

/* Footer mais compacto e proporcional */
footer p {
  margin-bottom: 5px; /* Reduzido ainda mais */
  font-size: 0.9rem; /* Texto menor */
  line-height: 1.3; /* Line height menor */
}

footer p:last-child {
  margin-bottom: 0;
}

/* Responsividade aprimorada */
@media (max-width: 768px) {
  .navbar-custom {
    padding: 15px 0; /* Reduzido em mobile */
    min-height: 75px; /* Altura reduzida em mobile */
  }

  .navbar-brand {
    font-size: 1.1rem;
  }
  
  .navbar-brand img {
    height: 35px;
  }
  
  .user-info {
    padding: 5px 12px;
    font-size: 0.9rem;
  }
  
  .navbar .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  
  footer {
    padding: 12px 15px; /* Reduzido em mobile */
    min-height: 45px;
  }

  footer p {
    font-size: 0.9rem;
    margin-bottom: 6px;
  }

  .container {
    padding-top: 95px;
  }
}

@media (max-width: 480px) {
  .navbar-custom {
    padding: 12px 0; /* Ainda mais reduzido */
    min-height: 65px;
  }

  .navbar-brand {
    font-size: 1rem;
  }
  
  .navbar-brand img {
    height: 32px;
  }
  
  .user-info {
    padding: 4px 10px;
    font-size: 0.85rem;
  }

  footer {
    padding: 10px 15px;
    min-height: 40px;
  }

  footer p {
    font-size: 0.85rem;
    margin-bottom: 5px;
  }

  .container {
    padding-top: 5px;
  }
}

/* --------- DARK MODE MODERNIZADO ---------- */
.dark-mode {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%) !important;
  background-attachment: fixed;
  color: #e2e8f0;
}

.dark-mode body {
  background: transparent !important;
  color: inherit !important;
}

.dark-mode .card,
.dark-mode .navbar-custom {
  background: rgba(45, 55, 72, 0.95) !important;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #e2e8f0;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(226, 232, 240, 0.1) !important;
}

.dark-mode .navbar-custom {
  border-bottom: 1px solid rgba(226, 232, 240, 0.1);
  padding: 20px 0; /* Manter padding consistente */
  min-height: 90px; /* Altura consistente */
}

.dark-mode .navbar-brand,
.dark-mode .navbar-brand img,
.dark-mode .navbar .btn,
.dark-mode .navbar .btn:active,
.dark-mode .navbar .btn:focus {
  color: #e2e8f0 !important;
}

.dark-mode .btn-outline-dark {
  background: rgba(226, 232, 240, 0.15) !important;
  color: #e2e8f0 !important;
  border: 2px solid rgba(226, 232, 240, 0.3) !important;
}

.dark-mode .btn-outline-dark:hover {
  background: rgba(226, 232, 240, 0.25) !important;
  color: #4a5568 !important;
  border-color: #4a5568 !important;
}

.dark-mode .form-control,
.dark-mode .form-select {
  background: rgba(26, 32, 44, 0.8) !important;
  border: 2px solid rgba(74, 85, 104, 0.5);
  color: #e2e8f0;
}

.dark-mode .form-control:focus,
.dark-mode .form-select:focus {
  border-color: #4a5568;
  background: rgba(26, 32, 44, 0.9) !important;
  box-shadow: 0 0 0 3px rgba(74, 85, 104, 0.2);
}

.dark-mode .form-label {
  color: #e2e8f0;
}

.dark-mode .table {
  background: rgba(45, 55, 72, 0.8) !important;
  color: #e2e8f0;
}

.dark-mode .table th, 
.dark-mode .table td {
  color: #e2e8f0 !important;
  border-color: rgba(74, 85, 104, 0.3);
}

.dark-mode .table th {
  background: linear-gradient(135deg, rgba(26, 32, 44, 0.8) 0%, rgba(45, 55, 72, 0.8) 100%) !important;
  color: #e2e8f0 !important;
}

.dark-mode .table > tbody > tr:nth-of-type(odd) {
  background: rgba(26, 32, 44, 0.5) !important;
}

.dark-mode .pagination .page-link {
  background: rgba(45, 55, 72, 0.8) !important;
  color: #e2e8f0;
  border: 2px solid rgba(74, 85, 104, 0.5);
}

.dark-mode .pagination .page-link:hover {
  background: #4a5568 !important;
  border-color: #4a5568 !important;
  color: white !important;
}

.dark-mode .pagination .page-item.active .page-link {
  background: linear-gradient(135deg, #4a5568 0%, #2d3748 100%) !important;
  border-color: #4a5568 !important;
}

.dark-mode .list-group-item-action {
  background: rgba(45, 55, 72, 0.8) !important;
  color: #e2e8f0;
  border: 1px solid rgba(74, 85, 104, 0.2);
}

.dark-mode .list-group-item-action:hover {
  background: rgba(74, 85, 104, 0.2) !important;
  border-color: #4a5568 !important;
  color: #fff !important;
}

.dark-mode .alert-danger {
  background: rgba(229, 62, 62, 0.2);
  color: #fed7d7;
  border: 1px solid rgba(229, 62, 62, 0.3);
}

.dark-mode footer {
  background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%) !important;
  color: rgba(226, 232, 240, 0.8) !important;
}

.dark-mode footer.text-center {
  background: none !important;
  color: inherit !important;
}

.dark-mode .btn-secondary {
  background: rgba(74, 85, 104, 0.3) !important;
  border: 2px solid rgba(74, 85, 104, 0.5) !important;
  color: #e2e8f0 !important;
}

.dark-mode .btn-secondary:hover {
  background: rgba(74, 85, 104, 0.5) !important;
  color: #e2e8f0 !important;
}

.dark-mode a, 
.dark-mode a:visited {
  color: #cbd5e0;
}

.dark-mode .input-group .form-control {
  background: rgba(26, 32, 44, 0.8) !important;
  color: #e2e8f0;
  border: 2px solid rgba(74, 85, 104, 0.5);
}

.dark-mode .form-check-input:checked {
  background-color: #4a5568;
  border-color: #4a5568;
}

.dark-mode .badge.bg-danger {
  background: linear-gradient(135deg, #e53e3e, #c53030) !important;
}

.dark-mode .badge.bg-primary {
  background: linear-gradient(135deg, #4a5568, #2d3748) !important;
}

/* --------- ESTILOS MODERNOS PARA BOTÕES CRUD ---------- */

/* Botão Success moderno */
.btn-success {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
  border: none !important;
  box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
  color: white !important;
  border-radius: 50px;
  font-weight: 600;
  padding: 12px 24px;
  font-size: 1rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-success:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(72, 187, 120, 0.4);
  background: linear-gradient(135deg, #38a169 0%, #48bb78 100%) !important;
  color: white !important;
}

/* Botão Secondary moderno */
.btn-secondary {
  background: rgba(113, 128, 150, 0.15) !important;
  color: #4a5568 !important;
  border: 2px solid rgba(113, 128, 150, 0.3) !important;
  backdrop-filter: blur(10px);
  border-radius: 50px;
  font-weight: 600;
  padding: 12px 24px;
  font-size: 1rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-secondary:hover {
  background: rgba(113, 128, 150, 0.25) !important;
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  color: #4a5568 !important;
  border-color: #4a5568 !important;
}

/* Botões outline modernos */
.btn-outline-primary {
  background: rgba(74, 85, 104, 0.1) !important;
  color: #4a5568 !important;
  border: 2px solid rgba(74, 85, 104, 0.3) !important;
  border-radius: 12px;
  font-weight: 600;
  padding: 8px 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.btn-outline-primary:hover {
  background: #4a5568 !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(74, 85, 104, 0.3);
  border-color: #4a5568 !important;
}

.btn-outline-danger {
  background: rgba(229, 62, 62, 0.1) !important;
  color: #e53e3e !important;
  border: 2px solid rgba(229, 62, 62, 0.3) !important;
  border-radius: 12px;
  font-weight: 600;
  padding: 8px 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.btn-outline-danger:hover {
  background: #e53e3e !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(229, 62, 62, 0.3);
  border-color: #e53e3e !important;
}

.btn-outline-secondary {
  background: rgba(113, 128, 150, 0.1) !important;
  color: #718096 !important;
  border: 2px solid rgba(113, 128, 150, 0.3) !important;
  border-radius: 12px;
  font-weight: 600;
  padding: 8px 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.btn-outline-secondary:hover {
  background: #718096 !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(113, 128, 150, 0.3);
  border-color: #718096 !important;
}

/* Botões pequenos modernos */
.btn-sm {
  border-radius: 10px !important;
  padding: 6px 12px !important;
  font-size: 0.875rem !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}

.btn-sm:hover {
  transform: translateY(-2px) !important;
}

/* Grupo de botões moderno */
.btn-group {
  gap: 4px;
  display: flex;
  justify-content: center;
}

.btn-group .btn {
  border-radius: 10px !important;
  margin: 0 !important;
}

.btn-group .btn:first-child {
  border-radius: 10px 10px 10px 10px !important;
}

.btn-group .btn:last-child {
  border-radius: 10px 10px 10px 10px !important;
}

/* Botão link moderno */
.btn-link {
  color: #4a5568 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  transition: all 0.3s ease !important;
}

.btn-link:hover {
  color: #2d3748 !important;
  transform: scale(1.05) !important;
}

/* Botão com ícone melhorado */
.btn i {
  transition: all 0.3s ease;
}

.btn:hover i {
  transform: scale(1.1);
}

/* --------- DARK MODE PARA BOTÕES CRUD ---------- */

.dark-mode .btn-success {
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
  box-shadow: 0 8px 25px rgba(72, 187, 120, 0.4);
}

.dark-mode .btn-success:hover {
  box-shadow: 0 12px 35px rgba(72, 187, 120, 0.5);
}

.dark-mode .btn-secondary {
  background: rgba(226, 232, 240, 0.15) !important;
  color: #e2e8f0 !important;
  border: 2px solid rgba(226, 232, 240, 0.3) !important;
}

.dark-mode .btn-secondary:hover {
  background: rgba(226, 232, 240, 0.25) !important;
  color: #4a5568 !important;
  border-color: #4a5568 !important;
}

.dark-mode .btn-outline-primary {
  background: rgba(74, 85, 104, 0.2) !important;
  color: #cbd5e0 !important;
  border: 2px solid rgba(74, 85, 104, 0.4) !important;
}

.dark-mode .btn-outline-primary:hover {
  background: #4a5568 !important;
  color: white !important;
}

.dark-mode .btn-outline-danger {
  background: rgba(229, 62, 62, 0.2) !important;
  color: #fed7d7 !important;
  border: 2px solid rgba(229, 62, 62, 0.4) !important;
}

.dark-mode .btn-outline-danger:hover {
  background: #e53e3e !important;
  color: white !important;
}

.dark-mode .btn-outline-secondary {
  background: rgba(226, 232, 240, 0.15) !important;
  color: #a0aec0 !important;
  border: 2px solid rgba(226, 232, 240, 0.3) !important;
}

.dark-mode .btn-outline-secondary:hover {
  background: #718096 !important;
  color: white !important;
}

.dark-mode .btn-link {
  color: #cbd5e0 !important;
}

.dark-mode .btn-link:hover {
  color: #4a5568 !important;
}
