/* =========================================
   VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================= */
:root {
    --bg-body: #f1f1f1;
    --bg-container: #ffffff;
    --color-acento: #32cd00;
    --texto-principal: #333333;
    --texto-secundario: #666666;
    --borde-suave: #e5e5e5;
}

html {
    /* Animación sutil al hacer clic en los enlaces del nav */
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 2rem 1rem;
    background-color: var(--bg-body);
    color: var(--texto-principal);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
}

/* =========================================
   CONTENEDOR PRINCIPAL Y LAYOUT
   ========================================= */
.contenedor-general {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 4rem;
    border-radius: 12px;
    background-color: var(--bg-container);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    opacity: 0;
    /* Animación sutil de entrada al cargar la página */
    animation: aparecerArriba 0.8s ease-out forwards;
    transform: translateY(20px);
}

@keyframes aparecerArriba {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   CABECERA Y NAVEGACIÓN
   ========================================= */
header h1 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

header h1 span {
    color: var(--color-acento);
}

nav {
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--borde-suave);
}

nav ul {
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

nav a {
    position: relative;
    color: var(--texto-secundario);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

nav a:hover {
    color: var(--color-acento);
}

/* Subrayado animado en los enlaces del menú */
nav a::after {
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--color-acento);
    transition: width 0.3s ease;
    content: "";
}

nav a:hover::after {
    width: 100%;
}

/* =========================================
   CONTENIDO PRINCIPAL (MAIN & ARTICLES)
   ========================================= */
main h2 {
    margin-bottom: 2.5rem;
    color: var(--texto-secundario);
    font-size: 1.5rem;
    font-weight: 400;
}

article {
    margin-bottom: 3.5rem;
}

article h3 {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

/* Estilo de "Etiqueta" o "Badge" para el span dentro del h3 */
article h3 span {
    margin-right: 12px;
    padding: 0.3em 0.8em;
    border-radius: 20px;
    background-color: var(--color-acento);
    color: var(--bg-container);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(50, 205, 0, 0.3);
}

article > p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

/* Código en línea (inline) */
article > p code {
    padding: 0.2em 0.5em;
    border: 1px solid var(--borde-suave);
    border-radius: 4px;
    background-color: var(--bg-body);
    color: var(--texto-principal);
    font-family: "Fira Code", Consolas, Monaco, "Andale Mono", monospace;
    font-size: 0.95em;
}

/* =========================================
   CAJAS DE RESULTADO Y CÓDIGO
   ========================================= */
.resultado {
    position: relative;
    padding: 1.5rem;
    border: 1px solid var(--borde-suave);
    border-left: 4px solid var(--color-acento);
    border-radius: 0 8px 8px 0;
    background-color: #fafafa;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

/* Animación sutil de elevación al pasar el ratón */
.resultado:hover {
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
    transform: translateX(4px);
}

.resultado > p {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--texto-secundario);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Ajustes para que Prism.js encaje bien dentro de las cajas */
pre.ejemplo {
    margin: 0 !important;
    border-radius: 6px !important;
    background-color: #2d2d2d !important; /* Fondo oscuro elegante para el código */
}

/* =========================================
   FOOTER
   ========================================= */
footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--borde-suave);
    color: var(--texto-secundario);
    font-size: 0.9rem;
    text-align: center;
}

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    .contenedor-general {
        padding: 2rem 1.5rem;
    }

    header h1 {
        font-size: 2rem;
    }
}

/* Eliminar el fondo de Prism.js dentro de los contenedores destacados */
.destacado pre[class*="language-"],
.destacado code[class*="language-"] {
    background: transparent !important; /* Elimina el color de fondo */
    box-shadow: none !important; /* Por si el tema de Prism añade bordes o sombras a la caja */
    text-shadow: none !important; /* Prism añade una sombra blanca al texto que suele verse mal sin su fondo original */
}

/* Opcional: Si quieres ajustar el padding interior del bloque de código dentro de la alerta */
.destacado pre[class*="language-"] {
    margin: 0.5rem 0 !important;
    padding: 0 !important;
}
