/* MinhasCalorias - Custom CSS */

:root {
  --mc-primary: #4CAF50;
  --mc-primary-dark: #388E3C;
  --mc-primary-light: #C8E6C9;
  --mc-accent: #FF9800;
  --mc-protein: #E91E63;
  --mc-carbs: #2196F3;
  --mc-fat: #FFC107;
  --mc-calories: #9C27B0;
  --mc-gradient: linear-gradient(135deg, #4CAF50 0%, #8BC34A 100%);
}

/* Body */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Reserva espaço para scrollbar em todas as abas - evita "quebradinha" ao alternar
   (Overview tem scroll, Pacientes/Config não; sem isso o layout pula ~15px) */
html {
  scrollbar-gutter: stable;
}

/* Espaço padrão entre o cabeçalho e o conteúdo */
.page-body {
  padding-top: 1.25rem;
}

/* Cards */
.card {
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.card-header {
  border-bottom: 1px solid var(--tblr-border-color);
  background: transparent;
}

/* Buttons */
.btn-primary {
  background: var(--mc-gradient);
  border: none;
}

.btn-primary:hover {
  background: var(--mc-primary-dark);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.btn-success {
  background: var(--mc-primary);
  border-color: var(--mc-primary);
}

/* Form Controls */
.form-control:focus,
.form-select:focus {
  border-color: var(--mc-primary);
  box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25);
}

/* Tables */
.table {
  --tblr-table-striped-bg: rgba(76, 175, 80, 0.03);
}

.table thead th {
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tblr-secondary);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--tblr-bg-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--tblr-border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--tblr-secondary);
}

/* Animations */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading spinner */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--tblr-border-color);
  border-top-color: var(--mc-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ApexCharts dark mode fix */
[data-bs-theme="dark"] .apexcharts-text {
  fill: var(--tblr-body-color) !important;
}

[data-bs-theme="dark"] .apexcharts-legend-text {
  color: var(--tblr-body-color) !important;
}

/* Empty states */
.empty-state {
  padding: 3rem;
  text-align: center;
}

.empty-state-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.empty-state-description {
  color: var(--tblr-secondary);
  max-width: 400px;
  margin: 0 auto;
}

/* Stats highlight effect */
.stat-highlight {
  position: relative;
}

.stat-highlight::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--mc-gradient);
  opacity: 0;
  border-radius: 8px;
  transition: opacity 0.3s;
}

.stat-highlight:hover::after {
  opacity: 0.05;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
  .nav-pills-custom {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .nav-pills-custom::-webkit-scrollbar {
    display: none;
  }

}

/* Print styles */
@media print {
  .topbar,
  .nav-pills-custom,
  .btn {
    display: none !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}