/**
 * Estilos para a página de Áreas do Direito
 * UI/UX Moderno com Microinterações e Design System
 */

:root {
  --brand-green: #70bb52;
  --brand-green-dark: #5da940;
  --brand-green-darker: #4a8833;
  --bg-light: #f5f5f5;
  --bg-white: #ffffff;
  --border-light: #e0e0e0;
  --text-dark: #333333;
  --text-muted: #666666;
  --primary-green: #203A24;
  --primary-green-light: #2d5433;
  --primary-green-dark: #162614;
  --accent-gold: #C9A961;
  --bg-white: #ffffff;
  --bg-lighter: #fafbfc;
  --border-light: #e1e4e8;
  --text-body: #586069;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 3px 8px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
  --shadow-hover: 0 12px 32px rgba(32,58,36,0.18);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-main {
    margin-top: 60px;
}

.breadcrumb-custom {
  margin-top: 1rem;
  margin-bottom: 1rem;
}

/* Main Container */
.law-areas-main {
  background: linear-gradient(180deg, var(--bg-lighter) 0%, var(--bg-light) 100%);
  min-height: 100vh;
  padding-bottom: 4rem;
}

/* Hero Section - Melhorado */
.law-areas-hero {
  background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-green-light) 50%, var(--primary-green-dark) 100%);
  color: white;
  padding: 5rem 0 4rem;
  margin-bottom: 3.5rem;
  position: relative;
  overflow: hidden;
}

/* Pattern decorativo no hero */
.law-areas-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(255,255,255,0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255,255,255,0.03) 0%, transparent 50%);
  pointer-events: none;
}

.law-areas-hero .container {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
  letter-spacing: -0.02em;
  animation: fadeInUp 0.6s ease-out;
}

.hero-subtitle {
  font-size: 1.35rem;
  font-weight: 400;
  opacity: 0.95;
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.6;
  animation: fadeInUp 0.6s ease-out 0.1s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stats Bar (opcional - pode adicionar depois) */
.law-areas-stats {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 2rem;
  margin-top: 2rem;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-around;
  gap: 2rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-green);
  display: block;
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Law Areas Section */
.law-areas-section {
  padding: 0 1rem;
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Grid Animation */
#lawAreasGrid .col-12 {
  animation: slideInUp 0.6s ease-out both;
}

#lawAreasGrid .col-12:nth-child(1) { animation-delay: 0.05s; }
#lawAreasGrid .col-12:nth-child(2) { animation-delay: 0.1s; }
#lawAreasGrid .col-12:nth-child(3) { animation-delay: 0.15s; }
#lawAreasGrid .col-12:nth-child(4) { animation-delay: 0.2s; }
#lawAreasGrid .col-12:nth-child(5) { animation-delay: 0.25s; }
#lawAreasGrid .col-12:nth-child(6) { animation-delay: 0.3s; }

@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Law Area Card - UI/UX Melhorado */
.law-area-card {
  background: var(--bg-white);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 2rem;
  transition: all var(--transition-smooth);
  height: 100%;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

/* Efeito de shimmer ao hover */
.law-area-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: left 0.5s;
}

.law-area-card:hover::before {
  left: 100%;
}

.law-area-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-green);
  text-decoration: none;
  color: inherit;
}

.law-area-card:active {
  transform: translateY(-2px);
  transition: all 0.1s;
}

/* Ícone com animação */
.law-area-icon {
  width: 72px;
  height: 72px;
  background: var(--brand-green);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 2.25rem;
  color: white;
  flex-shrink: 0;
  transition: all var(--transition-smooth);
  box-shadow: 0 4px 12px rgba(32,58,36,0.25);
}

.law-area-card:hover .law-area-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 6px 16px rgba(32,58,36,0.35);
}

/* Título */
.law-area-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  line-height: 1.3;
  transition: color var(--transition-fast);
}

.law-area-card:hover .law-area-title {
  color: var(--primary-green);
}

/* Descrição */
.law-area-description {
  font-size: 1rem;
  color: var(--text-body);
  line-height: 1.65;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

/* Badge de contagem */
.law-area-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--primary-green);
  font-weight: 600;
  padding: 0.75rem 1rem;
  background: rgba(32,58,36,0.05);
  border-radius: 8px;
  margin-top: auto;
  transition: all var(--transition-fast);
}

.law-area-card:hover .law-area-count {
  background: rgba(32,58,36,0.1);
  color: var(--brand-green);
  transform: translateX(4px);
}

.law-area-count i {
  font-size: 1.1rem;
}

/* Arrow indicator */
.law-area-count::after {
  content: '\F285';
  font-family: 'bootstrap-icons';
  font-size: 1.25rem;
  opacity: 0;
  transform: translateX(-10px);
  transition: all var(--transition-smooth);
}

.law-area-card:hover .law-area-count::after {
  opacity: 1;
  transform: translateX(0);
}

/* Loading State Melhorado */
#lawAreasLoading {
  text-align: center;
  padding: 5rem 2rem;
}

#lawAreasLoading .spinner-border {
  width: 3.5rem;
  height: 3.5rem;
  border-width: 4px;
  color: var(--primary-green);
}

#lawAreasLoading p {
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 1.1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Error State Melhorado */
#lawAreasError {
  max-width: 600px;
  margin: 3rem auto;
  border-radius: 12px;
  border-left: 4px solid #dc3545;
}

/* Empty State Melhorado */
.law-areas-empty {
  text-align: center;
  padding: 5rem 2rem;
  animation: fadeIn 0.6s ease-out;
}

.law-areas-empty i {
  font-size: 5rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  opacity: 0.6;
}

.law-areas-empty h3 {
  color: var(--text-dark);
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.law-areas-empty p {
  color: var(--text-muted);
  font-size: 1.1rem;
  line-height: 1.6;
}

/* Skeleton Loading (adicionar depois se necessário) */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Responsive - Mobile First */
@media (max-width: 991px) {
  .law-areas-hero {
    padding: 4rem 0 3rem;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .hero-subtitle {
    font-size: 1.15rem;
  }

  .law-area-card {
    padding: 1.75rem;
  }

  .law-area-icon {
    width: 64px;
    height: 64px;
    font-size: 2rem;
  }
}

@media (max-width: 767px) {
  .law-areas-hero {
    padding: 3rem 0 2.5rem;
    margin-bottom: 2.5rem;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1.05rem;
  }

  .law-area-card {
    padding: 1.5rem;
  }

  .law-area-icon {
    width: 60px;
    height: 60px;
    font-size: 1.85rem;
    margin-bottom: 1.25rem;
  }

  .law-area-title {
    font-size: 1.5rem;
  }

  .law-area-description {
    font-size: 0.95rem;
  }

  .law-area-count {
    font-size: 0.9rem;
    padding: 0.65rem 0.85rem;
  }
}

@media (max-width: 575px) {
  .law-areas-section {
    padding: 0 0.5rem;
  }

  .law-areas-hero {
    padding: 2.5rem 0 2rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .law-area-card {
    padding: 1.25rem;
  }

  .law-area-icon {
    width: 56px;
    height: 56px;
    font-size: 1.65rem;
  }

  .law-area-title {
    font-size: 1.4rem;
  }
}

/* Dark Mode Support (futuro) */
@media (prefers-color-scheme: dark) {
  /* Adicionar suporte a dark mode se necessário */
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  .law-areas-hero {
    background: var(--primary-green) !important;
    color: white !important;
    padding: 2rem 0 !important;
  }

  .law-area-card {
    break-inside: avoid;
    page-break-inside: avoid;
    box-shadow: none !important;
    border: 1px solid var(--border-light) !important;
  }

  .law-area-card:hover {
    transform: none !important;
  }
}
