:root {
  --primary-color: #7f5af0;
  --secondary-color: #2cb67d;
  --text-color: #fffffe;
  --text-secondary: #94a1b2;
  --background-color: #16161a;
  --card-background: #242629;
  --card-border: #383838;
  --border-radius: 8px;
  --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    'Inter',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    'Open Sans',
    'Helvetica Neue',
    sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--background-color);
  padding: 0;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

header {
  background: var(--background-color);
  color: white;
  padding: 80px 0 60px;
  text-align: center;
  margin-bottom: 60px;
  border-bottom: 1px solid var(--card-border);
}

header h1 {
  font-size: 2.8rem;
  margin-bottom: 20px;
  letter-spacing: -0.5px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.tagline {
  font-size: 1.2rem;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto 20px;
  color: var(--text-secondary);
}

h2 {
  font-size: 1.8rem;
  margin: 2.5rem 0 1.5rem;
  color: var(--text-color);
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 0.8rem;
  color: var(--text-color);
}

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Fira Code', 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--secondary-color);
}

.url-example {
  background-color: var(--card-background);
  padding: 20px;
  border-radius: var(--border-radius);
  margin: 20px 0 40px;
  text-align: center;
  border: 1px solid var(--card-border);
}

.url-example code {
  font-size: 1.1rem;
  background: none;
  padding: 0;
}

.highlight {
  color: var(--primary-color);
  font-weight: bold;
}

section {
  margin-bottom: 80px;
}

.examples {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.example-card {
  display: flex;
  flex-direction: row;
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--card-border);
  width: 100%;
}

.example-content {
  padding: 30px;
  width: 60%;
  overflow-x: auto;
}

.example-preview {
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: center;
  align-items: center;
  width: 40%;
  border-top: none;
  border-left: 1px solid var(--card-border);
}

.example-preview img {
  max-width: 100%;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.code-container {
  width: 100%;
  overflow-x: auto;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--border-radius);
  margin: 10px 0;
}

pre {
  background-color: transparent;
  border-radius: var(--border-radius);
  padding: 15px;
  margin: 0;
  font-size: 0.9rem;
  max-width: 100%;
}

pre code {
  background: none;
  padding: 0;
  white-space: pre;
  word-break: normal;
  word-wrap: normal;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  border: 1px solid var(--card-border);
  border-radius: var(--border-radius);
  overflow: hidden;
}

th,
td {
  padding: 15px;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

th {
  background-color: rgba(255, 255, 255, 0.05);
  font-weight: 600;
  color: var(--text-color);
}

td {
  color: var(--text-secondary);
}

tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

footer {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 60px 0;
  text-align: center;
  margin-top: 80px;
  border-top: 1px solid var(--card-border);
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

.api-docs {
  background-color: var(--card-background);
  padding: 30px;
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border);
}

.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Melhorias de acessibilidade */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important; /* eslint-disable-line */
    animation-iteration-count: 1 !important; /* eslint-disable-line */
    transition-duration: 0.01ms !important; /* eslint-disable-line */
    scroll-behavior: auto !important; /* eslint-disable-line */
  }
}

/* Responsividade */
@media (max-width: 767px) {
  header {
    padding: 40px 0 30px;
    margin-bottom: 30px;
  }

  header h1 {
    font-size: 1.8rem;
    line-height: 1.3;
  }

  .tagline {
    font-size: 1rem;
    line-height: 1.5;
  }

  section {
    margin-bottom: 40px;
  }

  h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
  }

  .url-example {
    padding: 15px;
    margin: 15px 0 25px;
    overflow-x: auto;
  }

  .url-example code {
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .example-card {
    flex-direction: column;
    max-width: 100%;
    margin-bottom: 20px;
  }

  .example-content,
  .example-preview {
    width: 100%;
  }

  .example-content {
    padding: 20px;
  }

  .example-preview {
    border-left: none;
    border-top: 1px solid var(--card-border);
    padding: 15px;
  }

  .code-container {
    margin: 8px 0;
  }

  pre {
    padding: 12px;
    font-size: 0.8rem;
  }

  .api-docs {
    padding: 20px 15px;
    overflow-x: auto;
  }

  table {
    font-size: 0.9rem;
  }

  th,
  td {
    padding: 10px;
  }

  footer {
    padding: 40px 0;
    margin-top: 40px;
  }

  .examples {
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 15px;
  }

  header h1 {
    font-size: 1.6rem;
  }

  .tagline {
    font-size: 0.95rem;
  }

  pre code {
    font-size: 0.8rem;
  }

  table {
    font-size: 0.85rem;
  }
}

/* Estilos para o gerador de imagens */
.generator-section {
  margin-bottom: 80px;
}

.generator-container {
  background-color: var(--card-background);
  border-radius: var(--border-radius);
  border: 1px solid var(--card-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.generator-form {
  padding: 30px;
  border-bottom: 1px solid var(--card-border);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.form-group input,
.form-group select {
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--text-color);
  font-size: 1rem;
  transition: border-color 0.2s ease;
}

.form-group input:focus,
.form-group select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(127, 90, 240, 0.2);
}

.color-inputs {
  display: flex;
  gap: 10px;
}

.color-inputs input[type='text'] {
  flex: 1;
}

.color-inputs input[type='color'] {
  width: 40px;
  padding: 0;
  height: 40px;
  cursor: pointer;
  background-color: transparent;
}

.generate-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 4px;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    transform 0.1s ease;
  grid-column: 1 / -1;
  margin-top: 10px;
}

.generate-btn:hover {
  background-color: #6b4cd8;
}

.generate-btn:active {
  transform: translateY(2px);
}

.generator-result {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.preview-container {
  position: relative;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

.preview-image {
  max-width: 100%;
  height: auto;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.preview-loading {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: var(--border-radius);
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.code-output {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: var(--border-radius);
  padding: 20px;
}

.code-output h3 {
  margin-bottom: 15px;
  font-size: 1.1rem;
}

.copy-btn {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color);
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin-top: 15px;
  display: inline-flex;
  align-items: center;
}

.copy-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
}

.copy-btn::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fffffe' viewBox='0 0 24 24'%3E%3Cpath d='M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM19 5H8C6.9 5 6 5.9 6 7V21C6 22.1 6.9 23 8 23H19C20.1 23 21 22.1 21 21V7C21 5.9 20.1 5 19 5ZM19 21H8V7H19V21Z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  margin-right: 6px;
}

/* Responsividade para o gerador */
@media (min-width: 768px) {
  .generator-container {
    flex-direction: row;
  }

  .generator-form {
    width: 50%;
    border-bottom: none;
    border-right: 1px solid var(--card-border);
  }

  .generator-result {
    width: 50%;
  }
}

@media (max-width: 767px) {
  .generator-form {
    display: flex;
    flex-direction: column;
    padding: 20px;
  }

  .generator-result {
    padding: 20px;
  }

  .preview-container {
    min-height: 200px;
  }

  .form-group input,
  .form-group select {
    font-size: 16px; /* Evita zoom em dispositivos iOS */
  }
}
