/* Tema ADTR SWOT - Paleta de Cores Customizada */
:root {
  /* Cores principais */
  --primary-dark: #013956;
  --secondary-dark: #0b1c29;
  --primary-teal: #17a89c;
  --secondary-teal: #58c2b6;
  --light-gray: #e6e7e9;
  --white: #ffffff;
  
  /* Cores SWOT específicas */
  --swot-strength: #198754;        /* Verde para Forças */
  --swot-weakness: #fd7e14;        /* Laranja para Fraquezas */
  --swot-opportunity: #0d6efd;     /* Azul para Oportunidades */
  --swot-threat: #dc3545;          /* Vermelho para Ameaças */
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, var(--primary-dark) 0%, var(--secondary-dark) 100%);
  --gradient-teal: linear-gradient(135deg, var(--primary-teal) 0%, var(--secondary-teal) 100%);
  
  /* Sombras */
  --shadow-sm: 0 2px 4px rgba(1, 57, 86, 0.1);
  --shadow-md: 0 4px 8px rgba(1, 57, 86, 0.15);
  --shadow-lg: 0 8px 16px rgba(1, 57, 86, 0.2);
}

/* Background geral */
body {
  background: linear-gradient(135deg, var(--light-gray) 0%, var(--white) 100%);
  color: var(--primary-dark);
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* Navbar customizada */
.navbar {
  background: var(--gradient-primary) !important;
  box-shadow: var(--shadow-md);
  border-bottom: 3px solid var(--primary-teal);
}

.navbar-brand, .navbar-nav .nav-link {
  color: var(--white) !important;
  font-weight: 500;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
  color: var(--secondary-teal) !important;
  transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
  color: var(--secondary-teal) !important;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

/* Cards */
.card {
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  background: var(--white);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card-header {
  background: var(--gradient-teal);
  color: var(--white);
  border-radius: 12px 12px 0 0 !important;
  border-bottom: none;
  font-weight: 600;
  padding: 1rem 1.5rem;
}

/* Botões primários */
.btn-primary {
  background: var(--gradient-primary);
  border: none;
  border-radius: 8px;
  font-weight: 500;
  padding: 0.5rem 1.5rem;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: var(--gradient-teal);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-primary:focus {
  box-shadow: 0 0 0 0.25rem rgba(23, 168, 156, 0.25);
}

/* Botões secundários */
.btn-outline-primary {
  color: var(--primary-teal);
  border-color: var(--primary-teal);
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn-outline-primary:hover {
  background: var(--primary-teal);
  border-color: var(--primary-teal);
  transform: translateY(-1px);
}

/* Botões de informação */
.btn-outline-info {
  color: var(--secondary-teal);
  border-color: var(--secondary-teal);
  border-radius: 8px;
}

.btn-outline-info:hover {
  background: var(--secondary-teal);
  border-color: var(--secondary-teal);
}

/* Botões de alerta */
.btn-outline-warning {
  color: #f39c12;
  border-color: #f39c12;
  border-radius: 8px;
}

/* Formulários */
.form-control, .form-select {
  border: 2px solid var(--light-gray);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--primary-teal);
  box-shadow: 0 0 0 0.25rem rgba(23, 168, 156, 0.25);
}

.form-label {
  color: var(--primary-dark);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

/* Badges */
.badge {
  border-radius: 6px;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
}

.badge.bg-success {
  background: var(--primary-teal) !important;
}

.badge.bg-info {
  background: var(--secondary-teal) !important;
}

.badge.bg-primary {
  background: var(--primary-dark) !important;
}

.badge.bg-secondary {
  background: var(--secondary-dark) !important;
}

/* Alertas */
.alert {
  border: none;
  border-radius: 10px;
  border-left: 4px solid;
}

.alert-success {
  background: rgba(23, 168, 156, 0.15);
  border-left-color: var(--primary-teal);
  color: var(--primary-dark);
}

.alert-warning {
  background: rgba(243, 156, 18, 0.15);
  border-left-color: #f39c12;
  color: var(--primary-dark);
}

.alert-info {
  background: rgba(88, 194, 182, 0.15);
  border-left-color: var(--secondary-teal);
  color: var(--primary-dark);
}

/* Alertas posicionados (toasts) - melhor visibilidade */
.alert.position-fixed {
  background: rgba(255, 255, 255, 0.85) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid;
  min-width: 300px;
  backdrop-filter: blur(10px);
}

.alert-success.position-fixed {
  border-color: var(--primary-teal);
  background: rgba(255, 255, 255, 0.85) !important;
}

.alert-success.position-fixed::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary-teal);
  border-radius: 10px 0 0 10px;
}

/* SWOT Grid customizado */
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.swot-quadrant {
  background: var(--white);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  min-height: 400px;
}

.swot-quadrant:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.swot-quadrant.strengths {
  border-top: 4px solid var(--primary-teal);
}

.swot-quadrant.strengths h3 {
  color: var(--primary-teal);
}

.swot-quadrant.weaknesses {
  border-top: 4px solid #e74c3c;
}

.swot-quadrant.weaknesses h3 {
  color: #e74c3c;
}

.swot-quadrant.opportunities {
  border-top: 4px solid var(--secondary-teal);
}

.swot-quadrant.opportunities h3 {
  color: var(--secondary-teal);
}

.swot-quadrant.threats {
  border-top: 4px solid var(--primary-dark);
}

.swot-quadrant.threats h3 {
  color: var(--primary-dark);
}

/* Itens SWOT */
.swot-item {
  background: rgba(230, 231, 233, 0.3);
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
  border-left: 3px solid;
  transition: all 0.3s ease;
}

.strengths .swot-item {
  border-left-color: var(--primary-teal);
}

.weaknesses .swot-item {
  border-left-color: #e74c3c;
}

.opportunities .swot-item {
  border-left-color: var(--secondary-teal);
}

.threats .swot-item {
  border-left-color: var(--primary-dark);
}

.swot-item:hover {
  background: rgba(230, 231, 233, 0.5);
  transform: translateX(3px);
}

.category-badge {
  background: rgba(1, 57, 86, 0.1);
  color: var(--primary-dark);
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 0.5rem;
}

/* Modais */
.modal {
  z-index: 1055 !important;
}

.modal-backdrop {
  z-index: 1050 !important;
}

.modal-dialog {
  margin: 1.75rem auto !important;
  max-width: 500px !important;
  position: relative !important;
}

.modal-content {
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  position: relative !important;
  background: var(--white) !important;
  pointer-events: auto !important;
}

.modal-header {
  background: var(--gradient-primary);
  color: var(--white);
  border-radius: 12px 12px 0 0;
  border-bottom: none;
  position: relative !important;
  z-index: 1 !important;
}

.modal-header .btn-close {
  filter: brightness(0) invert(1);
  z-index: 10 !important;
  position: relative !important;
}

.modal-body {
  position: relative !important;
  z-index: 1 !important;
  background: var(--white) !important;
}

.modal-footer {
  position: relative !important;
  z-index: 1 !important;
  background: var(--white) !important;
  border-top: 1px solid var(--light-gray) !important;
}

/* Corrigir intermitência do modal */
.modal.show {
  display: block !important;
}

.modal.show .modal-dialog {
  transform: none !important;
}

.modal .btn:hover {
  transform: none !important;
}

.modal .card:hover {
  transform: none !important;
  box-shadow: var(--shadow-sm) !important;
}

/* Garantir que elementos dentro do modal não tenham hover effects problemáticos */
.modal *:hover {
  z-index: auto !important;
}

/* Tabelas */
.table {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead th {
  background: var(--gradient-teal);
  color: var(--white);
  border: none;
  font-weight: 600;
}

.table tbody tr:hover {
  background: rgba(23, 168, 156, 0.05);
}

/* Mandala específico */
.mandala-container {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin-bottom: 2rem;
}

.pillar-card {
  border-radius: 10px;
  transition: all 0.3s ease;
}

.pillar-card:hover {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
}

/* Responsividade */
@media (max-width: 768px) {
  .swot-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .swot-quadrant {
    min-height: 300px;
    padding: 1rem;
  }
  
  .card {
    margin-bottom: 1rem;
  }
}

/* Animações suaves */
* {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

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

::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-teal);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-teal);
}

/* Estados de loading */
.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* Elementos desabilitados por permissão */
.btn.disabled,
.btn:disabled,
a.disabled {
  opacity: 0.5 !important;
  pointer-events: none !important;
  cursor: not-allowed !important;
  filter: grayscale(50%) !important;
}

.btn.disabled:hover,
.btn:disabled:hover,
a.disabled:hover {
  transform: none !important;
  box-shadow: none !important;
}

/* Tooltip para elementos desabilitados */
.disabled[title]:hover::after {
  content: attr(title);
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary-dark);
  color: white;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 1000;
  margin-top: 5px;
}

/* Alertas de permissão flutuantes */
.permission-alert {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Indicadores visuais de permissão */
.permission-indicator {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.permission-indicator.read-only {
  background: var(--secondary-teal);
}

.permission-indicator.edit {
  background: #f39c12;
}

.permission-indicator.full {
  background: var(--primary-teal);
}

.permission-indicator.disabled {
  background: #dc3545;
}

/* Overlay de permissão para seções inteiras */
.permission-overlay {
  position: relative;
}

.permission-overlay::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(2px);
  z-index: 10;
  border-radius: inherit;
}

.permission-overlay::after {
  content: '🔒';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  z-index: 11;
}

/* Utilitários de cores */
.text-primary-teal {
  color: var(--primary-teal) !important;
}

.text-secondary-teal {
  color: var(--secondary-teal) !important;
}

.bg-primary-teal {
  background-color: var(--primary-teal) !important;
}

.bg-secondary-teal {
  background-color: var(--secondary-teal) !important;
}

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

/* Classes SWOT personalizadas para heads dos cards */
.swot-strength {
  border-color: var(--swot-strength) !important;
}

.swot-strength .card-header {
  background-color: var(--swot-strength) !important;
  background-image: none !important;
  color: white !important;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
}

.swot-weakness {
  border-color: var(--swot-weakness) !important;
}

.swot-weakness .card-header {
  background-color: var(--swot-weakness) !important;
  background-image: none !important;
  color: white !important;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
}

.swot-opportunity {
  border-color: var(--swot-opportunity) !important;
}

.swot-opportunity .card-header {
  background-color: var(--swot-opportunity) !important;
  background-image: none !important;
  color: white !important;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
}

.swot-threat {
  border-color: var(--swot-threat) !important;
}

.swot-threat .card-header {
  background-color: var(--swot-threat) !important;
  background-image: none !important;
  color: white !important;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2) !important;
}

/* Efeitos especiais */
.glass-effect {
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}