/*
 * ==========================================================================
 * VARIABLES DE COLOR
 * ==========================================================================
 */
 :root {
    --text-color: #f0e6d2;
    --accent: #c19a6b;
    --background-color: rgba(0, 0, 0, 0.8);
    --sidebar-bg: rgba(30, 30, 30, 0.9);
    --highlight: #cd7f32;
    --link-hover: #e0c090;
    --section-border: #555;
    --shadow-color: rgba(0, 0, 0, 0.6);
    --sidebar-width: 280px; /* Variable para el ancho del sidebar */
    --sidebar-collapsed-width: 60px; /* Ancho del sidebar cuando está colapsado */
    --header-height: 60px; /* Altura del header */
}

/*
 * ==========================================================================
 * RESET Y ESTILOS BASE
 * ==========================================================================
 */
/* Reset básico para asegurar la consistencia entre navegadores */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Estilos para el body y el html */
html,
body {
    height: 100%;
    font-family: 'Merriweather', serif;
    color: var(--text-color);
    background: url('https://static.planetminecraft.com/files/image/minecraft/project/2022/130/16294735_xl.webp') no-repeat center center fixed;
    background-size: cover;
    background-attachment: fixed;
}

/*
 * ==========================================================================
 * CONTENEDOR PRINCIPAL
 * ==========================================================================
 */
.container {
    display: flex; /* Para la disposición del sidebar y el contenido */
    width: 100%; /* Ocupa todo el ancho del viewport */
    min-height: 100vh; /* Ocupa al menos toda la altura del viewport */
}

/*
 * ==========================================================================
 * BARRA LATERAL (SIDEBAR)
 * ==========================================================================
 */
/*
 * ==========================================================================
 * BARRA LATERAL (SIDEBAR)
 * ==========================================================================
 */
 .sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    padding: 1rem 1.5rem;
    position: fixed; /* Fijo a la izquierda */
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    overflow-y: auto;
    box-shadow: 5px 0 15px var(--shadow-color);
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease-in-out; /* Transición suave para el ancho */
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
    padding: 1rem 0.5rem;
}

.sidebar.collapsed h2 {
    opacity: 0;
    transition: opacity 0.3s ease-in-out 0.2s;
}

.sidebar.collapsed .menu-item a span {
    display: none;
}

.sidebar.collapsed .has-submenu i:last-child {
    display: none;
}

.sidebar h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--highlight);
    text-transform: uppercase;
    font-weight: bold;
    letter-spacing: 0.05em;
}

.sidebar nav ul {
    list-style: none;
    padding: 0;
}

.sidebar nav li {
    margin-bottom: 0.5rem;
}

.sidebar nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.7rem 1rem;
    display: flex;
    align-items: center;
    border-radius: 6px;
    transition: background 0.3s ease-in-out, padding-left 0.3s ease-in-out;
    font-weight: 500;
    font-size: 0.95rem;
}

.sidebar nav a i {
    margin-right: 0.8rem;
    font-size: 1rem;
    width: 1.2rem; /* Para alinear los iconos */
    text-align: center;
}

.sidebar.collapsed nav a i {
    margin-right: 0;
}

.sidebar nav a:hover {
    background-color: var(--accent);
    color: #111;
    padding-left: 1.2rem;
}

.sidebar.collapsed nav a:hover {
    padding-left: 0.7rem;
}

/* Estilos para los submenús (inicialmente ocultos y con animación) */
.sidebar .submenu {
    margin-left: 0.8rem;
    margin-top: 0.3rem;
    border-left: 2px solid var(--accent);
    padding-left: 0.8rem;
    overflow: hidden; /* Para la animación de altura */
    max-height: 0; /* Inicialmente oculto */
    transition: max-height 0.3s ease-in-out; /* Animación suave */
}

/* Clase para mostrar el submenú */
.sidebar .submenu.open {
    max-height: 500px; /* Altura máxima estimada */
}

.sidebar .submenu li {
    margin-bottom: 0.3rem;
}

.sidebar .submenu a {
    font-size: 0.85rem;
    padding: 0.5rem 0.7rem;
    border-radius: 4px;
    display: block; /* Ocupa el ancho para la animación */
}

.sidebar .submenu a:hover {
    background-color: var(--link-hover);
    color: #111;
    padding-left: 1rem;
}

/*
 * ==========================================================================
 * ENCABEZADO (HEADER)
 * ==========================================================================
 */
 header {
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed; /* Fijo en la parte superior */
    top: 0;
    left: var(--sidebar-width); /* Empieza después del sidebar */
    width: calc(100% - var(--sidebar-width)); /* Ocupa el ancho restante */
    border-bottom: 1px solid var(--accent);
    z-index: 900;
    box-shadow: 0 2px 10px var(--shadow-color);
    height: var(--header-height); /* Altura fija del header */
    transition: left 0.3s ease-in-out, width 0.3s ease-in-out; /* Transición suave para left y width */
}

header.sidebar-collapsed {
    left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

header .toggle-sidebar {
    background: none;
    color: var(--text-color);
    cursor: pointer;
    margin-right: 1rem;
    display: none; /* Oculto en pantallas grandes */
}

header .logo {
    display: flex;
    align-items: center;
    font-family: 'Cinzel Decorative', serif;
    font-size: 1.3rem;
    color: var(--accent);
    text-shadow: 2px 2px 4px var(--shadow-color);
}

header .logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    position: relative;
    top: -2px;
}
header nav {
    padding-right: 20px; /* Reduje un poco el padding derecho */
}

header nav a {
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    transition: background-color 0.3s ease-in-out, color 0.3s ease-in-out;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 0.4rem;
}

header nav a:hover,
header nav a#here {
    background-color: var(--highlight);
    color: #111;
}
/*
 * ==========================================================================
 * CONTENIDO PRINCIPAL
 * ==========================================================================
 */
 .main-content {
    margin-left: var(--sidebar-width); /* Empieza después del sidebar */
    padding: 2rem;
    background: var(--background-color);
    min-height: 100vh;
    overflow-y: auto;
    width: calc(100% - var(--sidebar-width)); /* Ocupa el ancho restante */
    padding-top: calc(2rem + var(--header-height)); /* Añade un padding-top igual a la altura del header */
    transition: margin-left 0.3s ease-in-out, width 0.3s ease-in-out; /* Transición suave para el margen y el ancho */
}

.main-content.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
    width: calc(100% - var(--sidebar-collapsed-width));
}

/*
 * ==========================================================================
 * SECCIÓN HERO
 * ==========================================================================
 */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: rgba(20, 20, 20, 0.75);
    border-radius: 10px;
    margin-bottom: 3rem;
    box-shadow: 0 0 15px var(--shadow-color);
    animation: fadeIn 1.5s ease-out;
    border: 1px solid var(--section-border);
}

.hero h1 {
    font-size: 2.8rem;
    font-family: 'Cinzel Decorative', serif;
    color: var(--accent);
    text-shadow: 2px 2px 5px var(--shadow-color);
    margin-bottom: 0.8rem;
}

.hero p {
    margin-top: 1rem;
    font-size: 1.15rem;
    line-height: 1.8;
    max-width: 700px;
    margin: 0 auto;
    color: #ddd;
}

/*
 * ==========================================================================
 * SECCIONES DE CONTENIDO GENERAL
 * ==========================================================================
 */
section.content {
    margin-bottom: 3rem;
    padding: 2.5rem;
    background-color: rgba(30, 30, 30, 0.8);
    border-radius: 8px;
    border: 1px solid var(--section-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    padding-top: 2rem; /* Aumenta un poco el padding superior si es necesario */
    margin-top: -1px; /* Intenta compensar un posible margen superior */
    font-family: sans-serif;
    scroll-margin-top: calc(var(--header-height) + 1rem);
}

.section-title {
    font-size: 2rem;
    color: var(--highlight);
    margin-bottom: 1.2rem;
    font-family: 'Cinzel', serif;
    text-shadow: 1px 1px 4px var(--shadow-color);
    border-bottom: 1px solid var(--accent);
    padding-bottom: 0.4rem;
    margin-top: 0; /* Asegúrate de que no haya margen superior en el título */
}

section.content p {
    font-size: 1.05rem;
    line-height: 1.9;
    max-width: 800px;
    margin: 0 auto 2rem auto;
    color: #eee;
    margin-top: 1rem; /* Añade un poco de espacio entre el título y el párrafo */
}
section.content a {
    font-size: 1.05rem;
    line-height: 1.9;
    max-width: 800px;
    margin: 0 auto 2rem auto;
    color: #e0c090;
    margin-top: 1rem; /* Añade un poco de espacio entre el título y el párrafo */
    scroll-margin-top: calc(var(--header-height) + 1rem);
}
section.content li {
    border-bottom: #6e5d42 solid 1px;
    border-top: #e0c090 solid 1px;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    scroll-margin-top: calc(var(--header-height) + 1rem);
    list-style: none;
}

section.content li li {
    border: none;
    padding: 0px;
    padding-left: 20px;
    list-style: none;
}
section.content h3 {
    color: #e0c090;
    margin-top: 1rem;
    font-family: 'Cinzel';
    scroll-margin-top: calc(var(--header-height) + 1rem);
    padding: 10px; /* Añade un poco de espacio entre el título y el párrafo */
}

/*
 * ==========================================================================
 * PIE DE PÁGINA (FOOTER)
 * ==========================================================================
 */
footer {
    text-align: center;
    padding: 1rem;
    background-color: rgba(20, 20, 20, 0.9);
    color: #888;
    border-top: 1px solid var(--accent);
    margin-top: 40px;
    box-shadow: 0 -2px 8px var(--shadow-color);
}

/*
 * ==========================================================================
 * ANIMACIONES
 * ==========================================================================
 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/*
 * ==========================================================================
 * MEDIA QUERIES (RESPONSIVIDAD)
 * ==========================================================================
 */
@media (max-width: 960px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 100%;
        border-bottom: 1px solid var(--accent);
        box-shadow: 0 2px 10px var(--shadow-color);
        max-height: 400px;
        overflow-y: auto;
        margin-top: 50px;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    header {
        position: fixed;
        width: 100%;
        left: 0;
        flex-direction: column; /* Apilar elementos verticalmente */
        align-items: center; /* Centrar elementos horizontalmente */
        padding: 0.5rem;
        height: auto; /* Ajustar altura automáticamente */
        text-align: center; /* Centrar el texto dentro del header */
    }

    header .toggle-sidebar {
        display: block;
 /* Centrar el botón horizontalmente */
    }

    header .logo {
        margin-bottom: 0.3rem;
        flex-direction: column; /* Apilar imagen y título */
        align-items: center; /* Centrar imagen y título */
    }

    header .logo img {
        width: 30px; /* Reducir el ancho de la imagen */
        height: 30px; /* Reducir la altura de la imagen */
        margin-bottom: 0.3rem; /* Espacio entre imagen y título */
    }

    header .logo h1 {
        font-size: 1.1rem; /* Reducir el tamaño de la fuente del título */
        margin-bottom: 0; /* Eliminar margen inferior innecesario */
    }

    header nav {
        padding-right: 0;
        display: flex;
        flex-direction: row;
        width: 100%;
        justify-content: center; /* Centrar los enlaces */
        margin-top: 0.1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    header nav a {
        margin: 0;
        text-align: center; /* Centrar texto de los enlaces */
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding-top: calc(2rem + var(--header-height) + 30px);
    }
}

@media (max-width: 600px) {
    header .logo {
        font-size: 1.1rem;
    }

    header nav a {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .main-content {
        padding: 1.5rem;
        padding-top: calc(1.5rem + var(--header-height) + 20px);
    }
}

