/* Variables */
:root {
--color-bg: #1e1e1e;
--color-surface: #2a2a2a;
--color-primary: #080060;
--color-accent: #FF5900;
--color-post: #00bb2d;
--color-text: #e0e0e0;
--color-text-secondary: #a0a0a0;
--color-border: #3a3a3a;
--header-height: 60px;
--sidebar-width: 260px;
--gap: 1rem;
--max-width: 1200px;
}
html{
scrollbar-width: thin;
scrollbar-color: var(--color-text-secondary) transparent; 
scroll-behavior: smooth;
}
/* Reset básico */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Segoe UI', sans-serif;
background: var(--color-bg);
color: var(--color-text);
overflow-x: hidden;
}
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Header fijo */
header {
position: fixed; top: 0; left: 0; right: 0;
height: var(--header-height);
background: var(--color-primary);
display: flex; align-items: center; justify-content: space-between;
padding: 0 1rem; z-index: 1000;
}
header .logo { display: flex; align-items: center; }
header .logo img { height: 32px; margin-right: 0.5rem; }
header .logo h1 { color: #fff; font-size: 1.25rem; }
header .actions { display: flex; align-items: center; }
header .actions button {
background: var(--color-post);
border: none;
color: #fff;
padding: 0.4rem 0.8rem;
border-radius: 4px;
cursor: pointer;
margin-left: 0.5rem;
white-space: nowrap;
}
header .actions button:hover { opacity: 0.9; }
#nav-toggle { display: none; }

/* Contenedor principal */
#container { margin-top: var(--header-height); }

/* Sidebar */
nav#sidebar {
width: var(--sidebar-width);
background: var(--color-surface);
position: fixed;
top: var(--header-height);
bottom: 0;
overflow-y: auto;
padding-top: 1rem;
transition: transform 0.3s;
transform: translateX(0); /* visible en desktop */
z-index: 999; /* asegúrate que está por debajo del header */
scrollbar-width: thin;
scrollbar-color: var(--color-text-secondary) transparent; 
}
/* Al añadir la clase .closed, se oculta, pero solo aplicable en móvil */
nav#sidebar.closed {
transform: translateX(-100%);
}

/* El estado .open lo mostrará (especialmente tras .closed en móvil) */
nav#sidebar.open {
transform: translateX(0);
}
nav#sidebar ul { list-style: none; }
nav#sidebar .api-group > a {
display: flex; justify-content: space-between; align-items: center;
padding: 0.6rem 1rem; font-weight: bold; color: var(--color-text);
cursor: pointer;
text-decoration: none;
}
nav#sidebar .api-group > a:hover { background: var(--color-border); }
nav#sidebar .api-group.open > a .arrow { transform: rotate(90deg); }
nav#sidebar .api-group ul {
list-style: none;
max-height: 0;
overflow: hidden;
transition: max-height 0.3s;
}
nav#sidebar .api-group.open ul {
max-height: 800px;
}
nav#sidebar .api-group ul li a {
display: block; padding: 0.4rem 2rem; color: var(--color-text-secondary);
white-space: nowrap;
text-decoration: none;
}
nav#sidebar .api-group ul li a.active,
nav#sidebar .api-group ul li a:hover {
background: var(--color-border);
color: var(--color-text);
}
.img-flag-nav{
width: 20px;
height: auto;
margin-left: 5px;
}
.content-wrapper {
max-width: var(--max-width);
margin: auto;
}

main {
flex: 1;
padding: var(--gap);
margin-left: 0;
}
@media (min-width: 901px) {
main {
margin-left: var(--sidebar-width);
}
}

/* Responsive: en pantallas <900px, ocultar sidebar por defecto */
@media (max-width: 900px) {
nav#sidebar {
transform: translateX(-100%); /* oculto en móvil */
}
nav#sidebar.open {
transform: translateX(0); /* se muestra al hacer toggle */
}
/* Mostrar botón nav-toggle en móvil (ya lo tienes) */
#nav-toggle {
display: block;
background: var(--color-post);
border: none;
color: var(--color-text);
padding: 0.4rem;
font-size: 1.25rem;
border-radius: 4px;
cursor: pointer;
margin-left: 1rem;
}
}

/* Secciones */
section { margin-bottom: 2rem; scroll-margin-top: var(--header-height); }
section h2 { font-size: 1.5rem; color: var(--color-post); margin-bottom: 0.5rem; }
section h3 { font-size: 1.2rem; margin: 1rem 0 0.5rem; }
p, li { margin-bottom: 0.75rem; }

/* Badges GET/POST */
.badge { padding: 0.15rem 0.4rem; border-radius: 4px; font-size: 0.85rem; font-weight: bold; color: #fff; }
.badge-nav { padding: 0.2rem 0.2rem; border-radius: 4px; font-size: 0.5rem; font-weight: bold; color: #fff; }
.get { background: var(--color-accent); }
.post { background: var(--color-post); }

/* Endpoint path */
.endpoint-path {
background: var(--color-surface);
padding: 0.5rem;
border-left: 4px solid var(--color-post);
font-family: monospace;
margin-bottom: 1rem;
word-break: break-all;
}

/* Pestañas de código */
.code-tabs { margin: var(--gap) 0; }
.code-tabs .tab-buttons {
display: flex;
border-bottom: 1px solid var(--color-border);
overflow-x: auto;
}
.code-tabs button {
background: none;
border: none;
padding: 0.5rem 1rem;
cursor: pointer;
color: var(--color-text-secondary);
flex-shrink: 0;
}
.code-tabs button.active {
color: var(--color-text);
border-bottom: 2px solid var(--color-post);
}
.code-tabs pre {
background: #101010;
padding: 1rem;
border-radius: 4px;
overflow-x: auto;
}

/* Tablas */
table {
width: 100%;
border-collapse: collapse;
margin-bottom: 1rem;
}
th, td {
border: 1px solid var(--color-border);
padding: 0.5rem;
}
th { background: var(--color-surface); }

/* Sección "Pruébalo": contenedor y formularios */
.try-section {
background: var(--color-surface);
padding: var(--gap);
border-radius: 6px;
margin-top: var(--gap);
}
.try-section h3 {
margin-bottom: var(--gap);
text-align: center;
margin-bottom: 40px;
}
/* Filas de formulario con dos columnas */
.form-row {
display: flex;
flex-wrap: wrap;
gap: var(--gap);
margin-bottom: var(--gap);
}
.form-group {
flex: 1 1 calc(50% - var(--gap));
display: flex;
flex-direction: column;
}
@media (max-width: 600px) {
.form-group { flex: 1 1 100%; }
}
label {
margin-bottom: 0.3rem;
font-weight: 500;
}
input, select, textarea {
padding: 0.5rem;
border: 1px solid var(--color-border);
border-radius: 4px;
background: #121212;
color: var(--color-text);
}
button.try-btn {
background: var(--color-accent);
border: none;
color: #fff;
padding: 0.6rem 1rem;
border-radius: 4px;
cursor: pointer;
margin-top: var(--gap);
}
button.try-btn:hover { opacity: 0.9; }
.response-box {
background: #101010;
padding: var(--gap);
border: 1px solid var(--color-border);
border-radius: 4px;
color: var(--color-text);
max-height: 300px;
overflow-y: auto;
margin-top: 0.5rem;
white-space: pre-wrap;
word-break: break-word;
}

/* Selector de país con bandera */
.pais-selector-wrapper {
position: relative;
}
.select-button-pais-flag {
padding: 0.5rem;
cursor: pointer;
display: flex;
align-items: center;
gap: 0.5rem;
border: 1px solid var(--color-border);
border-radius: 4px;
background: var(--color-surface);
color: var(--color-text);
}
.select-button-pais-flag img {
width: 24px;
height: auto;
}
.dropdown-list-pais-flag {
position: absolute;
top: calc(100% + 4px);
left: 0;
background: var(--color-surface);
border: 1px solid var(--color-border);
border-radius: 4px;
max-height: 200px;
overflow-y: auto;
z-index: 1000;
display: none;
width: 100%;
}
.dropdown-item-pais-flag {
padding: 0.5rem;
display: flex;
align-items: center;
gap: 0.5rem;
cursor: pointer;
color: var(--color-text);
}
.dropdown-item-pais-flag:hover {
background: var(--color-border);
}
.dropdown-item-pais-flag img {
width: 20px;
height: auto;
}

#paypal-button-container-dynamic{
background: #f7f7f7;
}

/* Botón eliminar destinatario */
.remove-recipient-btn {
  background: #FF5900;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  display: none;
}
.whatsapp-recipient:hover .remove-recipient-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Input URL */
.fileUrlInput {
  width: 100%;
  padding: .4rem .6rem;
  border-radius: 4px;
  font-size: .95rem;
}
/* Botón eliminar URL */
.remove-url-btn {
  background: #FF5900;
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  display: none;
}
.url-recipient:hover .remove-url-btn {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Ajustes generales de form-row/form-group si usas tu CSS existente: */
/* .form-row { display:flex; flex-wrap: wrap; gap: 1rem; } */
/* .form-group { flex:1; display:flex; flex-direction: column; } */

/* Botones “+” */
#addWhatsAppRecipient, #addFileUrl {
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 16px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
/* Ya en el HTML se aplicaron colores inline, pero puedes ajustar aquí: */
#addWhatsAppRecipient { background: #00bb2d; color:#fff; }
#addFileUrl { background: #080060; color:#fff; }

/* Botón enviar */
#wa_btn_send.try-btn {
  padding: .6rem 1rem;
  border-radius: 4px;
  font-size: .95rem;
  cursor: pointer;
  border: none;
}