/* ============================================================
   FilexFlow - api.css
   Estilos específicos para api.html
   ============================================================ */

.layout-api {
  align-items: flex-start;
}

/* Ajuste columnas en escritorio */
@media (min-width: 960px) {
  .layout-api {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  }
}

/* ------------------------------
   Hero / contenido principal
   ------------------------------ */

.api-main-left {
  padding-top: 4px;
}

/* Evitar desbordes de texto en el card izquierdo */
.api-hero-sub,
.api-hero-list,
.api-section-sub {
  overflow-wrap: anywhere;
}

.api-hero-label {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #a5b4fc;
  background: rgba(37, 99, 235, 0.14);
  border: 1px solid rgba(129, 140, 248, 0.4);
  margin-bottom: 12px;
}

.api-hero-title {
  font-size: 1.45rem;
  font-weight: 600;
  color: #e5e7eb;
  margin-bottom: 6px;
}

.api-hero-sub {
  font-size: 0.9rem;
  color: #9ca3af;
  max-width: 38rem;
  margin-bottom: 16px;
}

.api-hero-list {
  list-style: none;
  padding: 0;
  margin: 0 0 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.84rem;
  color: #9ca3af;
}

.api-hero-list li::before {
  content: "•";
  margin-right: 6px;
  color: #60a5fa;
}

/* ------------------------------
   Secciones
   ------------------------------ */

.api-section {
  margin-top: 12px;
}

.api-section-title {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: #9ca3af;
  margin-bottom: 6px;
}

.api-section-sub {
  font-size: 0.86rem;
  color: #9ca3af;
  margin-bottom: 10px;
}

/* ------------------------------
   Core endpoints
   ------------------------------ */

.api-endpoints-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 900px) {
  .api-endpoints-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.api-endpoint {
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.9);
}

/* AHORA: método arriba, path en la línea siguiente */
.api-endpoint-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 6px;
}

.api-endpoint-method {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
}

/* Que las rutas nunca se salgan del card */
.api-endpoint-path {
  font-size: 0.78rem;
  color: #e5e7eb;
  word-break: break-all;
}

.api-endpoint-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #e5e7eb;
  margin-bottom: 2px;
}

.api-endpoint-text {
  font-size: 0.82rem;
  color: #9ca3af;
  overflow-wrap: anywhere;
}

/* ------------------------------
   Código de ejemplo
   ------------------------------ */

.api-code {
  margin-top: 8px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.5);
  background: rgba(15, 23, 42, 0.98);
  overflow: hidden;
}

/* header = tabs + botón copiar */

.api-code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 4px;
  gap: 8px;
}

.api-code-tabs {
  display: flex;
  gap: 6px;
}

.api-code-tab {
  border: 0;
  background: transparent;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: #9ca3af;
  cursor: pointer;
}

.api-code-tab-active {
  background: rgba(37, 99, 235, 0.9);
  color: #f9fafb;
}

/* Botón Copy code (no es CTA principal, es pill secundaria) */

.api-copy-btn {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: rgba(15, 23, 42, 0.9);
  padding: 4px 10px;
  font-size: 0.78rem;
  color: #e5e7eb;
  cursor: pointer;
  white-space: nowrap;
}

.api-copy-btn:hover {
  border-color: rgba(129, 140, 248, 0.9);
}

.api-code-blocks {
  padding: 6px 8px 10px;
}

.api-code-block {
  display: none;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  color: #e5e7eb;
  white-space: pre;
  overflow-x: auto;
}

.api-code-block-active {
  display: block;
}

/* ------------------------------
   Card derecha
   ------------------------------ */

.api-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.api-side-section {
  border-radius: 20px;
  padding: 14px 16px;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.98), #020617 70%);
  border: 1px solid rgba(148, 163, 184, 0.7);
}

/* Evitar desbordes de texto en la derecha */
.api-side-text,
.api-env-text,
.api-side-list,
.api-side-footer {
  overflow-wrap: anywhere;
}

.api-side-label {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 6px;
}

.api-side-title {
  font-size: 0.98rem;
  font-weight: 500;
  color: #f9fafb;
  margin-bottom: 4px;
}

.api-side-text {
  font-size: 0.84rem;
  color: #cbd5f5;
  margin-bottom: 8px;
}

.api-side-steps {
  counter-reset: step;
  padding-left: 0;
  list-style: none;
  margin: 0 0 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: #e5e7eb;
}

.api-side-steps li::before {
  counter-increment: step;
  content: counter(step) ". ";
  color: #93c5fd;
  font-weight: 500;
}

/* Más aire encima de los botones del card derecho */
.api-side-cta,
.api-side-contact {
  margin-top: 20px !important;
  font-size: 0.82rem;
  border-radius: 999px;
  display: inline-block;
}

/* Environments */

.api-env-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 900px) {
  .api-env-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.api-env-card {
  border-radius: 14px;
  padding: 10px 12px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px dashed rgba(148, 163, 184, 0.7);
}

.api-env-title {
  font-size: 0.86rem;
  font-weight: 500;
  color: #f9fafb;
  margin-bottom: 4px;
}

.api-env-text {
  font-size: 0.8rem;
  color: #cbd5f5;
}

/* Best practices */

.api-side-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: #e5e7eb;
}

.api-side-list li::before {
  content: "•";
  margin-right: 6px;
  color: #93c5fd;
}

.api-side-footer {
  font-size: 0.8rem;
  color: #cbd5f5;
  margin-bottom: 8px;
}

/* ------------------------------
   Light mode
   ------------------------------ */

body[data-theme="light"] .api-hero-title {
  color: #111827;
}

body[data-theme="light"] .api-hero-sub,
body[data-theme="light"] .api-hero-list {
  color: #4b5563;
}

/* subtítulo genérico de secciones en light */
body[data-theme="light"] .api-section-sub {
  color: #4b5563;
}

/* Endpoint cards — fondo claro + texto oscuro y legible */
body[data-theme="light"] .api-endpoint {
  background: #f3f5f9;
  border-color: rgba(15, 23, 42, 0.15);
}

/* Método (POST/GET) pill más contrastado */
body[data-theme="light"] .api-endpoint-method {
  background: rgba(37, 99, 235, 0.20);
  color: #1d4ed8;
}

/* Path del endpoint */
body[data-theme="light"] .api-endpoint-path {
  color: #1f2937;
}

/* Título del endpoint */
body[data-theme="light"] .api-endpoint-title {
  color: #111827;
}

/* Descripción del endpoint */
body[data-theme="light"] .api-endpoint-text {
  color: #374151;
}

/* Bloque de código mantiene fondo oscuro en light */
body[data-theme="light"] .api-code {
  background: #020617;
  border-color: rgba(15, 23, 42, 0.9);
}

/* Card derecho se mantiene oscuro en light */
body[data-theme="light"] .api-side-section {
  background: radial-gradient(circle at top, #020617, #020617 70%);
  border-color: rgba(15, 23, 42, 0.9);
}

body[data-theme="light"] .api-env-card {
  background: rgba(15, 23, 42, 0.98);
  border-color: rgba(148, 163, 184, 0.7);
}

body[data-theme="light"] .api-side-title {
  color: #f9fafb;
}

body[data-theme="light"] .api-side-text,
body[data-theme="light"] .api-env-text,
body[data-theme="light"] .api-side-list,
body[data-theme="light"] .api-side-footer {
  color: #e5e7eb;
}
