:root {
    --color-primario: #2A2F4F;
    --color-secundario: #917FB3;
    --color-terciario: #E5BEEC;
    --color-fondo: #FDE2F3;
    --color-texto: #2A2F4F;
    --degradado: linear-gradient(135deg, #E5BEEC 0%, #917FB3 100%);
    --sombra: 0 8px 32px rgba(0, 0, 0, 0.1);
    --borde-redondeado: 20px;
}

body {
    font-family: 'Inter', system-ui;
    line-height: 1.7;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: var(--degradado) fixed;
    color: var(--color-texto);
    transition: all 0.3s ease;
}

/* Tema oscuro */
body.light-mode {
    --color-fondo: #fff;
    --color-texto: #2A2F4F;
    --degradado: linear-gradient(135deg, #ffffff 0%, #f5f5f5 100%);
}

.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem 2rem;
    border-radius: var(--borde-redondeado);
    margin: 2rem auto;
    box-shadow: var(--sombra);
    position: sticky;
    top: 20px;
    z-index: 1000;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
}

.nav-links a {
    color: var(--color-primario);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 5px 0;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-secundario);
    transition: width 0.3s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--borde-redondeado);
    padding: 2.5rem;
    margin: 2rem 0;
    box-shadow: var(--sombra);
    transform: translateY(0);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

h1, h2, h3 {
    background: linear-gradient(to right, var(--color-primario), var(--color-secundario));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 1.5rem 0;
    position: relative;
    padding-left: 1.5rem;
}

h1::before, h2::before, h3::before {
    content: "▹";
    position: absolute;
    left: 0;
    color: var(--color-secundario);
}

img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2rem 0;
    border: 3px solid var(--color-secundario);
    box-shadow: var(--sombra);
}

ul {
    padding-left: 2rem;
    margin: 1.5rem 0;
}

li {
    margin-bottom: 1rem;
    padding-left: 1rem;
    position: relative;
}

li::before {
    content: "•";
    color: var(--color-secundario);
    position: absolute;
    left: -1rem;
}

.pagination {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 3rem 0;
}

.pagination a {
    padding: 10px 15px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    color: var(--color-primario);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.pagination a.active,
.pagination a:hover {
    background: var(--color-secundario);
    color: white;
    border-color: var(--color-terciario);
}

#themeToggler {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--color-secundario);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    cursor: pointer;
    z-index: 1001;
    box-shadow: var(--sombra);
    transition: transform 0.2s ease;
}

#themeToggler:hover {
    transform: scale(1.05);
}

#scrollTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--color-secundario);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.9;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#scrollTop:hover {
    opacity: 1;
    transform: translateY(-5px);
}

@media (max-width: 768px) {
    body {
        padding: 15px;
    }
    
    .navbar {
        padding: 1rem;
        border-radius: 15px;
    }
    
    .nav-links {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .card {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.25rem; }
}

.hidden {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

.collapsed {
    display: none;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}