/* ============================================
   LAYOUT E NAVEGAÇÃO
   ============================================ */

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: white;
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(10px);
  background-color: rgba(255, 255, 255, 0.95);
  padding: var(--spacing-md) 0;
  transition: all var(--transition-base);
}

.navbar:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--color-border), transparent);
}

.navbar.scrolled {
  box-shadow: var(--shadow-sm);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: var(--font-size-xl);
  font-weight: 700;
}

.logo a {
  transition: all var(--transition-fast);
}

.logo a:hover {
  text-shadow: 0 0 20px rgba(0, 102, 255, 0.3);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: var(--spacing-2xl);
  align-items: center;
}

.nav-link {
  position: relative;
  color: var(--color-text);
  font-weight: 500;
  transition: color var(--transition-fast);
  padding-bottom: var(--spacing-xs);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(to right, var(--color-secondary), var(--color-accent));
  transition: width var(--transition-base);
}

.nav-link:hover,
.nav-link.active {
  color: var(--color-secondary);
}

.nav-link.active::after,
.nav-link:hover::after {
  width: 100%;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.03) 0%, rgba(255, 107, 53, 0.03) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 102, 255, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -5%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.08) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.hero .container > div {
  position: relative;
  z-index: 1;
}

/* Grid Responsivo para Hero */
.grid {
  display: grid;
  gap: var(--spacing-2xl);
}

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

/* Responsive Grid */
@media (max-width: 1024px) {
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }
  
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: white;
    border-bottom: 1px solid var(--color-border);
    padding: var(--spacing-lg) 0;
    gap: 0;
    z-index: var(--z-dropdown);
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .nav-link {
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--color-light-gray);
  }

  .navbar button {
    display: block !important;
  }

  .hero {
    padding-top: var(--spacing-3xl);
    padding-bottom: var(--spacing-3xl);
  }
}

/* App Container */
.app-container {
  min-height: calc(100vh - 200px);
  opacity: 1;
  transition: opacity var(--transition-base);
}

.app-container.loading {
  opacity: 0.5;
  pointer-events: none;
}

/* Seções */
.section {
  position: relative;
}

.section + .section {
  border-top: 1px solid var(--color-border);
}

/* Background Alternado */
.bg-light-gray {
  background-color: var(--color-light-gray);
}

.bg-primary {
  background-color: var(--color-primary);
}

.bg-secondary {
  background-color: var(--color-secondary);
  color: white;
}

.bg-secondary a {
  color: var(--color-accent);
}

/* Prose Styling */
.prose {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2xl);
}

.prose section {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
}

.prose h2 {
  margin-top: var(--spacing-lg);
}

.prose h3 {
  margin-top: var(--spacing-md);
  font-size: var(--font-size-xl);
}

.prose h4 {
  margin-top: var(--spacing-md);
}

.prose ul {
  margin-left: var(--spacing-lg);
  list-style: none;
}

.prose ul li {
  position: relative;
  padding-left: var(--spacing-lg);
}

.prose ul li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--color-secondary);
  font-weight: bold;
}

.prose ol {
  margin-left: var(--spacing-lg);
  list-style: none;
  counter-reset: item;
}

.prose ol li {
  position: relative;
  padding-left: var(--spacing-xl);
  counter-increment: item;
}

.prose ol li::before {
  content: counter(item) '.';
  position: absolute;
  left: 0;
  font-weight: bold;
  color: var(--color-secondary);
}

/* Max Width Container */
.container.max-w-3xl {
  max-width: 800px;
}

/* Espaçamento */
.space-y-md > * + * {
  margin-top: var(--spacing-md);
}

.space-y-lg > * + * {
  margin-top: var(--spacing-lg);
}

.space-y-xl > * + * {
  margin-top: var(--spacing-xl);
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

.gap-xl {
  gap: var(--spacing-xl);
}

.gap-2xl {
  gap: var(--spacing-2xl);
}

.gap-4xl {
  gap: var(--spacing-4xl);
}

/* Utilidades de Flexbox */
.flex-wrap {
  flex-wrap: wrap;
}

.flex-col {
  flex-direction: column;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.items-end {
  align-items: flex-end;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

/* Helpers de Responsividade */
.hidden-mobile {
  display: block;
}

.visible-mobile {
  display: none;
}

@media (max-width: 768px) {
  .hidden-mobile {
    display: none;
  }

  .visible-mobile {
    display: block;
  }

  .md\:flex-row {
    flex-direction: row;
  }

  .md\:grid-2 {
    grid-template-columns: 1fr;
  }
}

/* Texto */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }

.font-light { font-weight: 300; }
.font-normal { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

.inline-block { display: inline-block; }
.block { display: block; }

/* Border */
.border-t {
  border-top: 1px solid var(--color-border);
}

.border-b {
  border-bottom: 1px solid var(--color-border);
}

.border-l {
  border-left: 1px solid var(--color-border);
}

.border-r {
  border-right: 1px solid var(--color-border);
}

/* Overflow */
.overflow-hidden {
  overflow: hidden;
}

.overflow-auto {
  overflow: auto;
}

/* Position */
.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

/* Display */
.inset-0 {
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.h-full {
  height: 100%;
}

.w-48 {
  width: 12rem;
}

.h-48 {
  height: 12rem;
}

/* Smooth Transitions */
a, button {
  transition: all var(--transition-base);
}

/* Print Styles */
@media print {
  .navbar,
  .btn,
  nav {
    display: none;
  }

  body {
    font-size: 12pt;
    color: black;
  }

  a {
    color: black;
    text-decoration: underline;
  }
}

/* Dark Mode Support (futuro) */
@media (prefers-color-scheme: dark) {
  /* Será implementado conforme necessário */
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Focus States */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* Placeholder Styling */
::placeholder {
  color: var(--color-text-light);
  opacity: 0.7;
}

/* Selection */
::selection {
  background-color: var(--color-secondary);
  color: white;
}
