/* ============================================
   ELIMINAR SCROLL DEL CONTENEDOR PRINCIPAL
   ============================================ */

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden !important;
}

/* ============================================
   CONFIGURACIÓN GENERAL DE STOPLIGHT ELEMENTS
   ============================================ */

elements-api {
    display: block;
    width: 100%;
    overflow: hidden !important;
    margin-top: 80px !important;
    height: calc(100vh - 80px) !important;
    
    /* Variables CSS de Stoplight Elements */
    --color-heading: #000000;
    --color-canvas-100: #15376e;
    --color-canvas-50: #0000003f;
    --color-canvas-200: #8381814d;
    --color-primary: #77b7db;
    --color-text: #000000;
    --color-http-get: #10b981;
    --color-http-post: #3b82f6;
    --color-http-put: #f59e0b;
    --color-http-delete: #ef4444;
    --color-http-patch: #8b5cf6;
    --color-border: #000000b0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Contenedor interno con scroll */
elements-api .sl-bg-canvas.sl-overflow-y-auto {
    overflow-y: auto !important;
    height: 100% !important;
}

/* Asegurar que el contenedor principal no tenga scroll */
elements-api > div:first-child {
    overflow: hidden !important;
    height: 100% !important;
}

/* ============================================
   CONFIGURACIÓN POR ELEMENTOS ESPECÍFICOS
   ============================================ */

/* Títulos principales H1 */
elements-api h1 {
    background-image: linear-gradient(to right, #00BFFF, #00008B) !important;
    color: transparent !important;
    background-clip: text !important;
}

/* Títulos principales H4 */
elements-api h4 {
    background-image: linear-gradient(to right, #00BFFF, #ffffff) !important;
    color: transparent !important;
    background-clip: text !important;
}

/* Contenedor del sidebar con texto blanco */
elements-api .sl-bg-canvas-100.sl-w-full.sl-overflow-y-auto {
    color: #ffffff !important;
}

/* Bloques de código con fondo negro */
elements-api .sl-code-highlight,
elements-api .prism-code {
    background-color: #000000 !important;
}

/* ============================================
   COLORES DE TOKENS DE SINTAXIS EN CÓDIGO
   ============================================ */

elements-api .token.plain {
    color: #74bcff !important;
}

elements-api .token.string {
    color: #b17939 !important;
}

elements-api .token.class-name,
elements-api .token.function {
    color: #cfc676 !important;
}

elements-api .token.property {
    color: #74bcff !important;
}

elements-api .token.operator {
    color: #ffffff !important;
}

elements-api .token.keyword {
    color: #023cfc !important;
}

elements-api .token.number {
    color: #b17939 !important;
}

elements-api .token.punctuation {
    color: #ffffff !important;
}

/* ============================================
   ESTILOS DE BOTONES
   ============================================ */

elements-api button.sl-button[aria-expanded="true"] {
    background-color: #42a0d6 !important;
    color: #ffffff !important;
    border-color: #b9b5c2 !important;
}

elements-api button.sl-button:focus {
    background-color: #ffffff !important;
    color: #000000 !important;
    border-color: #b6b6b6 !important;
}

/* ============================================
   SEPARADOR/RESIZER - Gradiente animado
   ============================================ */

elements-api .sl-resize-x {
    background: linear-gradient(135deg, #ffffff 0%, #5dc6e0 50%, #000000 100%) !important;
    background-size: 200% 100% !important;
    animation: gradientShift 1s ease infinite !important;
    width: 20px !important;
    cursor: ew-resize !important;
}

/* ============================================
   CONTENEDOR DEL SIDEBAR - Gradiente animado
   ============================================ */

elements-api .sl-flex-col.sl-flex-grow.sl-flex-shrink,
elements-api .sl-overflow-y-auto.sl-flex-col {
    background: linear-gradient(135deg, 
        #15376e 0%, 
        #000000 50%, 
        #15376e 100%) !important;
    background-size: 200% 100% !important;
    animation: gradientShift 4s ease infinite !important;
}

/* Personalización del texto "ENDPOINTS" */
elements-api .sl-text-sm.sl-uppercase.sl-font-bold.sl-pl-4 {
    font-size: 0 !important;
}

elements-api .sl-text-sm.sl-uppercase.sl-font-bold.sl-pl-4::before {
    content: " - ENDPOINTS - " !important;
    font-size: 0.875rem !important;
    font-weight: 800 !important;
    color: #12b2fc !important;
    letter-spacing: 0.15em !important;
    background-color: #ffffff00;
}

/* ============================================
   ANIMACIÓN GRADIENTE
   ============================================ */

@keyframes gradientShift {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

/* ============================================
   HEADER PERSONALIZADO
   ============================================ */

.custom-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, #15376e 0%, #000000 50%, #15376e 100%);
    background-size: 200% 100%;
    animation: gradientShift 4s ease infinite;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 1rem;
    border-bottom: 3px solid #12b2fc;
}

.custom-header .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.custom-header .logo span {
    font-size: 2rem;
}

.custom-header .logo img {
    height: 50px;
    width: auto;
    display: block;
}

.custom-header .logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.custom-header .header-title {
    flex: 1;
}

.custom-header .header-title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00BFFF 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.custom-header .header-title p {
    margin: 0;
    font-size: 0.875rem;
    color: #94a3b8;
    margin-top: 0.25rem;
}

.custom-header .header-info {
    text-align: right;
    color: #94a3b8;
    font-size: 0.875rem;
}

/* ============================================
   PÁGINA DE INICIO (OVERVIEW) - STOPLIGHT
   ============================================ */

elements-api .sl-markdown-viewer p:has(> img[alt="HKA Factura"]),
elements-api .sl-markdown-viewer a:has(> img[alt="HKA Factura"]) {
    margin: 0 0 1rem 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
    display: inline-block;
    line-height: 0;
    pointer-events: none;
    cursor: default;
    text-decoration: none;
}

elements-api .sl-markdown-viewer img[alt="HKA Factura"] {
    height: 56px;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
    display: block;
    cursor: default;
    transform: none !important;
    transition: none !important;
    object-fit: contain;
}

elements-api .sl-markdown-viewer img:not([alt="HKA Factura"]) {
    max-width: 100%;
    height: auto;
}

elements-api .sl-markdown-viewer a {
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
}

elements-api .sl-markdown-viewer a:hover {
    color: #12b2fc;
    text-decoration: underline;
}

elements-api .sl-markdown-viewer table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.9rem;
}

elements-api .sl-markdown-viewer th,
elements-api .sl-markdown-viewer td {
    border: 1px solid #e2e8f0;
    padding: 0.6rem 0.75rem;
    text-align: left;
}

elements-api .sl-markdown-viewer th {
    background-color: #f1f5f9;
    font-weight: 600;
}

elements-api .sl-markdown-viewer h2 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
    border-bottom: 2px solid #12b2fc;
    padding-bottom: 0.35rem;
}

elements-api .sl-markdown-viewer hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 1.25rem 0;
}

elements-api .sl-markdown-viewer ul {
    line-height: 1.75;
    padding-left: 1.25rem;
}
