/* Estilos customizados para o Sistema de Gerenciamento de Investimentos */

:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --danger-color: #dc3545;
  --warning-color: #ffc107;
  --info-color: #0dcaf0;
  --investment-highlight: #0a58ca;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #f8f9fa;
}

main {
  flex: 1;
}

/* Navbar customização */
.navbar-brand {
  font-weight: bold;
  font-size: 1.25rem;
  transition: transform 0.2s ease;
}

.navbar-brand:hover {
  transform: scale(1.05);
}

.navbar-dark .navbar-nav .nav-link {
  transition: all 0.3s ease;
  border-radius: 0.25rem;
  margin: 0 0.25rem;
  padding: 0.5rem 1rem;
}

.navbar-dark .navbar-nav .nav-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Destaque para itens principais de investimentos */
.navbar-nav .nav-link i.bi-briefcase-fill,
.navbar-nav .nav-link i.bi-cloud-upload-fill {
  font-size: 1.1rem;
  margin-right: 0.25rem;
}

/* Dropdown headers */
.dropdown-header {
  color: var(--primary-color);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-top: 0.75rem;
}

/* Dropdown items com ícones maiores */
.dropdown-menu .dropdown-item i {
  width: 1.5rem;
  text-align: center;
  margin-right: 0.5rem;
}

.dropdown-menu .dropdown-item {
  transition: all 0.2s ease;
  padding: 0.5rem 1rem;
}

.dropdown-menu .dropdown-item:hover {
  background-color: #f8f9fa;
  transform: translateX(5px);
}

/* Cards */
.card {
  border: none;
  border-radius: 0.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-header {
  background-color: #fff;
  border-bottom: 2px solid #f8f9fa;
  font-weight: 600;
}

/* Botões */
.btn {
  border-radius: 0.375rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

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

/* Forms */
.form-control:focus,
.form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

/* Tabelas */
.table {
  background-color: #fff;
}

.table thead th {
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  color: var(--secondary-color);
}

.table-hover tbody tr:hover {
  background-color: #f8f9fa;
  cursor: pointer;
}

/* Badges */
.badge {
  font-weight: 500;
  padding: 0.5em 0.75em;
}

/* Alerts */
.alert {
  border: none;
  border-radius: 0.5rem;
}

/* Loading spinner para HTMX */
.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: inline-block;
}

.htmx-request.htmx-indicator {
  display: inline-block;
}

/* Stats Cards */
.stat-card {
  border-left: 4px solid var(--primary-color);
}

.stat-card.success {
  border-left-color: var(--success-color);
}

.stat-card.danger {
  border-left-color: var(--danger-color);
}

.stat-card.warning {
  border-left-color: var(--warning-color);
}

.stat-card.info {
  border-left-color: var(--info-color);
}

.stat-value {
  font-size: 2rem;
  font-weight: bold;
  margin: 0;
}

.stat-label {
  color: var(--secondary-color);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Transações */
.transaction-item {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
  transition: background-color 0.2s ease;
}

.transaction-item:hover {
  background-color: #f8f9fa;
}

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

.transaction-type-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .stat-value {
    font-size: 1.5rem;
  }

  .navbar-brand {
    font-size: 1rem;
  }
}

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

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

/* Footer */
footer {
  margin-top: 3rem;
  padding: 1.5rem 0;
  border-top: 1px solid #dee2e6;
}

/* Fix para evitar piscar quando modal está aberto */
body.modal-open .card,
body.modal-open .card:hover {
  transform: none !important;
  box-shadow: none !important;
  transition: none !important;
}

body.modal-open .btn,
body.modal-open .btn:hover {
  transform: none !important;
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.15) !important;
  transition: none !important;
}

body.modal-open .table-hover tbody tr:hover {
  background-color: inherit !important;
}

body.modal-open * {
  transition: none !important;
}

/* Garante que o modal fique estável */
.modal {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.modal-dialog {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.modal-backdrop {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Remove pointer events do conteúdo quando modal está aberto */
body.modal-open .container-fluid {
  pointer-events: none;
}

body.modal-open .modal {
  pointer-events: auto;
}
