/* === DESIGN ENHANCEMENTS - Session 20 === */
/* Tarefas 7, 8, 9 do Relatório de Análise de Design */

/* ============================================
   TAREFA 7: ELEMENTOS DECORATIVOS E TEXTURAS
   ============================================ */

/* Padrão geométrico sutil no background do body */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 191, 165, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 50% 50%, rgba(29, 53, 127, 0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
}

/* Blob shapes decorativas */
.main-content::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0, 191, 165, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

.main-content::after {
  content: '';
  position: absolute;
  bottom: -80px;
  left: -80px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(29, 53, 127, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
}

/* Linhas decorativas nos títulos de seção */
.management-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(0, 191, 165, 0.3) 0%,
    rgba(0, 191, 165, 0.1) 50%,
    transparent 100%);
  margin-left: 20px;
  border-radius: 1px;
}

/* Textura sutil nos cards */
.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.02'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  border-radius: 16px;
  z-index: 0;
}

.stat-card > * {
  position: relative;
  z-index: 1;
}

/* ============================================
   TAREFA 8: LAYOUT ASSIMÉTRICO NOS CARDS
   ============================================ */

/* Grid assimétrico para cards de destaque */
.quick-stats {
  display: grid !important;
  grid-template-columns: repeat(12, 1fr) !important;
  gap: 20px !important;
}

/* Primeiro card maior (destaque) */
.quick-stats .stat-card:first-child {
  grid-column: span 5 !important;
  padding: 30px !important;
}

.quick-stats .stat-card:first-child .stat-icon {
  width: 90px !important;
  height: 90px !important;
  font-size: 3.5rem !important;
}

.quick-stats .stat-card:first-child .stat-number {
  font-size: 3rem !important;
}

/* Segundo e terceiro cards médios */
.quick-stats .stat-card:nth-child(2),
.quick-stats .stat-card:nth-child(3) {
  grid-column: span 3.5 !important;
}

/* Cards restantes com tamanho padrão */
.quick-stats .stat-card:nth-child(n+4) {
  grid-column: span 3 !important;
}

/* Fallback para grids que não suportam span fracionário */
@supports not (grid-column: span 3.5) {
  .quick-stats .stat-card:first-child {
    grid-column: span 4 !important;
  }
  .quick-stats .stat-card:nth-child(2),
  .quick-stats .stat-card:nth-child(3) {
    grid-column: span 4 !important;
  }
  .quick-stats .stat-card:nth-child(n+4) {
    grid-column: span 3 !important;
  }
}

/* Layout assimétrico para tablet */
@media (max-width: 1200px) {
  .quick-stats {
    grid-template-columns: repeat(6, 1fr) !important;
  }

  .quick-stats .stat-card:first-child {
    grid-column: span 6 !important;
  }

  .quick-stats .stat-card:nth-child(2),
  .quick-stats .stat-card:nth-child(3) {
    grid-column: span 3 !important;
  }

  .quick-stats .stat-card:nth-child(n+4) {
    grid-column: span 3 !important;
  }
}

/* Layout para mobile */
@media (max-width: 768px) {
  .quick-stats {
    grid-template-columns: 1fr 1fr !important;
  }

  .quick-stats .stat-card:first-child {
    grid-column: span 2 !important;
  }

  .quick-stats .stat-card {
    grid-column: span 1 !important;
  }
}

@media (max-width: 480px) {
  .quick-stats {
    grid-template-columns: 1fr !important;
  }

  .quick-stats .stat-card,
  .quick-stats .stat-card:first-child,
  .quick-stats .stat-card:nth-child(2),
  .quick-stats .stat-card:nth-child(3) {
    grid-column: span 1 !important;
  }
}

/* ============================================
   TAREFA 9: DARK MODE COM ACENTOS VIBRANTES
   ============================================ */

/* Dark mode com cores mais vibrantes */
[data-theme="dark"] {
  /* Acentos neon vibrantes */
  --accent-glow: rgba(0, 191, 165, 0.4);
  --accent-neon: #00e5cc;
  --accent-neon-secondary: #7c4dff;
  --accent-neon-warning: #ffab00;
  --accent-neon-danger: #ff5252;
}

/* Glow nos cards em dark mode */
[data-theme="dark"] .stat-card {
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .stat-card:hover {
  box-shadow:
    0 15px 40px rgba(0, 0, 0, 0.5),
    0 0 30px rgba(0, 191, 165, 0.15),
    inset 0 0 0 1px rgba(0, 191, 165, 0.1) !important;
}

/* Borda luminosa nos cards de destaque */
[data-theme="dark"] .stat-card.stat-primary::before {
  background: linear-gradient(135deg, #00e5cc 0%, #00bfa5 100%) !important;
  box-shadow: 0 0 20px rgba(0, 229, 204, 0.4);
}

[data-theme="dark"] .stat-card.stat-warning::before {
  background: linear-gradient(135deg, #ffab00 0%, #ff8f00 100%) !important;
  box-shadow: 0 0 20px rgba(255, 171, 0, 0.4);
}

[data-theme="dark"] .stat-card.stat-danger::before {
  background: linear-gradient(135deg, #ff5252 0%, #f44336 100%) !important;
  box-shadow: 0 0 20px rgba(255, 82, 82, 0.4);
}

[data-theme="dark"] .stat-card.stat-success::before,
[data-theme="dark"] .stat-card.stat-info::before {
  background: linear-gradient(135deg, #69f0ae 0%, #00e676 100%) !important;
  box-shadow: 0 0 20px rgba(105, 240, 174, 0.4);
}

/* Gradiente de background mais profundo */
[data-theme="dark"] body {
  background:
    radial-gradient(ellipse at 0% 0%, rgba(0, 191, 165, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 100% 100%, rgba(124, 77, 255, 0.08) 0%, transparent 50%),
    linear-gradient(135deg, #0a0e17 0%, #111827 50%, #0f172a 100%) !important;
}

/* Textos com brilho sutil */
[data-theme="dark"] .stat-number {
  text-shadow: 0 0 30px rgba(255, 255, 255, 0.1) !important;
}

[data-theme="dark"] .module-title span {
  text-shadow: 0 0 40px rgba(0, 191, 165, 0.3) !important;
}

/* Botões com glow neon */
[data-theme="dark"] .btn-primary:hover {
  box-shadow:
    0 8px 25px rgba(0, 191, 165, 0.4),
    0 0 40px rgba(0, 191, 165, 0.2) !important;
}

/* Inputs com borda luminosa no focus */
[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] input:focus,
[data-theme="dark"] select:focus,
[data-theme="dark"] textarea:focus {
  box-shadow:
    0 0 0 3px rgba(0, 191, 165, 0.2),
    0 0 20px rgba(0, 191, 165, 0.1) !important;
  border-color: #00bfa5 !important;
}

/* Tabelas com hover glow */
[data-theme="dark"] .data-table tr:hover {
  background: rgba(0, 191, 165, 0.08) !important;
  box-shadow: inset 0 0 30px rgba(0, 191, 165, 0.05);
}

/* Links de acesso rápido com glow */
[data-theme="dark"] .management-section a[href]:hover {
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.4),
    0 0 25px var(--accent-glow) !important;
}

/* ============================================
   ANIMAÇÕES REFINADAS
   ============================================ */

/* Staggered entrance para cards */
@keyframes cardEntranceStagger {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.stat-card {
  animation: cardEntranceStagger 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

.quick-stats .stat-card:nth-child(1) { animation-delay: 0.1s; }
.quick-stats .stat-card:nth-child(2) { animation-delay: 0.15s; }
.quick-stats .stat-card:nth-child(3) { animation-delay: 0.2s; }
.quick-stats .stat-card:nth-child(4) { animation-delay: 0.25s; }
.quick-stats .stat-card:nth-child(5) { animation-delay: 0.3s; }
.quick-stats .stat-card:nth-child(6) { animation-delay: 0.35s; }
.quick-stats .stat-card:nth-child(7) { animation-delay: 0.4s; }

/* Animação sutil de pulso nos números */
@keyframes numberPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.stat-number:not(:empty) {
  animation: numberPulse 3s ease-in-out infinite;
}

/* Hover mais elaborado nos cards */
.stat-card {
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.stat-card:hover {
  transform: translateY(-8px) scale(1.02) !important;
}

.stat-card:hover .stat-icon {
  transform: scale(1.1) rotate(5deg);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   SOMBRAS MAIS DRAMÁTICAS
   ============================================ */

.stat-card {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.05),
    0 10px 20px rgba(0, 0, 0, 0.08),
    0 20px 40px rgba(29, 53, 127, 0.1) !important;
}

.stat-card:hover {
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.1),
    0 25px 50px rgba(0, 0, 0, 0.15),
    0 30px 60px rgba(29, 53, 127, 0.15) !important;
}

.management-section {
  box-shadow:
    0 4px 6px rgba(0, 0, 0, 0.03),
    0 10px 30px rgba(0, 0, 0, 0.06),
    0 20px 50px rgba(29, 53, 127, 0.08) !important;
}

.management-section:hover {
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.08),
    0 20px 50px rgba(0, 0, 0, 0.12),
    0 30px 70px rgba(29, 53, 127, 0.12) !important;
}

/* Acesso rápido - cards com sombras coloridas */
.management-section .form-grid a[style*="linear-gradient"] {
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.management-section .form-grid a[style*="linear-gradient"]:hover {
  transform: translateY(-5px) scale(1.03) !important;
}
