@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Open+Sans:wght@300;400;600&display=swap');

:root {
    --primary-color: #2c6e49;
    --secondary-color: #1b4332;
    --accent-color: #4caf50;
    --light-bg: #f8f9fa;
    --dark-bg: #343a40;
    --text-color: #333;
    --light-text: #fff;
    --border-color: #e9ecef;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --border-radius: 8px;
    --nav-width: 220px;
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Open Sans', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    line-height: 1.7;
    color: var(--text-color);
    background: linear-gradient(135deg, var(--light-bg) 0%, #e8f5e9 100%);
    min-height: 100vh;
    margin-left: var(--nav-width);
    padding: 0;
    overflow-x: hidden;
}

nav {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: var(--nav-width);
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    padding: 30px 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-header {
    color: var(--light-text);
    text-align: center;
    font-size: 20px;
    margin-bottom: 30px;
    font-weight: 700;
    font-family: var(--font-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 0 20px;
    margin: 0;
}

nav li {
    margin: 8px 0;
}

nav a {
    display: block;
    color: var(--light-text);
    text-decoration: none;
    font-size: 16px;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    font-weight: 500;
    text-align: left;
}

nav a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

nav a:hover::before {
    left: 100%;
}

nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

main {
    max-width: 900px;
    margin: 0 auto;
    padding: 30px 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 20px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

h1 {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-family: var(--font-secondary);
    position: relative;
}

h1::after {
    content: '';
    display: block;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    margin: 8px 0;
    border-radius: 2px;
}

h2 {
    font-size: 2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 2rem 0 1rem 0;
    font-family: var(--font-secondary);
}

h3 {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--secondary-color);
    margin: 1.5rem 0 1rem 0;
}

p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

header {
    background: linear-gradient(135deg, var(--dark-bg) 0%, #495057 100%);
    color: var(--light-text);
    text-align: center;
    padding: 3rem 2rem;
    margin: 2rem 1rem 3rem 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

header h1 {
    margin-bottom: 0.5rem;
    color: var(--light-text);
}

header h1::after {
    background: var(--accent-color);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

footer {
    background: var(--dark-bg);
    color: var(--light-text);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--accent-color);
    transition: var(--transition);
}

section:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.resumen {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border-left: 5px solid var(--accent-color);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    box-shadow: var(--shadow);
}

.indice {
    background: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin: 1rem 0;
}

.tipo {
    font-weight: 700;
    color: var(--primary-color);
    background: rgba(76, 175, 80, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

ul, ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin: 1rem 0;
}

img:hover {
    transform: scale(1.02);
}

.index-body {
    text-align: center;
    padding: 60px 20px;
}

.index-body h1 {
    margin-bottom: 2rem;
    font-size: 3rem;
}

.index-body main {
    max-width: 800px;
    padding: 60px 40px;
}

@media (max-width: 768px) {
    body {
        margin-left: 0;
    }

    nav {
        width: 100%;
        height: auto;
        position: relative;
        padding: 20px 0;
        flex-direction: row;
        justify-content: center;
    }

    .nav-header {
        margin-bottom: 10px;
        font-size: 16px;
    }

    nav ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        padding: 0;
    }

    nav li {
        margin: 5px;
    }

    nav a {
        width: auto;
        min-width: 120px;
        font-size: 14px;
        padding: 8px 12px;
    }

    main {
        padding: 20px 15px;
        margin: 10px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .index-body h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    nav a {
        font-size: 12px;
        padding: 6px 10px;
        min-width: 100px;
    }

    main {
        padding: 15px 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.2rem;
    }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

section, header, footer {
    animation: fadeIn 0.6s ease-out;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    nav {
        display: none;
    }

    body {
        margin-left: 0;
    }

    main {
        box-shadow: none;
        background: white;
    }
}

::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--secondary-color), var(--primary-color));
}

::-webkit-scrollbar-corner {
    background: transparent;
}
