/* --- VARIABLES CSS (Design System) --- */
:root {
    --k8s-blue: #326CE5;
    --k8s-dark: #293448;
    --k8s-light-bg: #f8f9fc;
    --text-primary: #1a1c20;
    --text-secondary: #5e6d82;
    --code-bg: #2d2d2d;
    --accent-success: #00c08b;
    --accent-warn: #f0ad4e;
    --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --sidebar-width: 300px;
    --github-color: #6e7681;
}

/* --- RESET & BASE --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--k8s-light-bg);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    min-height: 100vh;
}

/* --- SIDEBAR DE NAVEGACIÓN --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--k8s-dark);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    padding: 2rem 1.5rem;
    z-index: 100;
    box-shadow: 4px 0 15px rgba(0,0,0,0.1);
}

.brand-area {
    margin-bottom: 3rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    background-color: white;
    border-radius: 50%; /* Placeholder para logo K8s */
    display: grid;
    place-items: center;
    color: var(--k8s-blue);
    font-weight: bold;
}

.brand-text h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    letter-spacing: -0.5px;
    color: white;
}

.brand-text span {
    font-size: 0.75rem;
    color: #a0aec0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-menu { list-style: none; }

.nav-item { margin-bottom: 0.5rem; }

.nav-link {
    display: block;
    padding: 12px 16px;
    color: #cbd5e0;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.nav-link:hover,.nav-link.active {
    background-color: rgba(50, 108, 229, 0.2);
    color: white;
    border-left: 4px solid var(--k8s-blue);
    padding-left: 12px; /* Ajuste visual por el borde */
}

.progress-widget {
    margin-top: 3rem;
    padding: 1.5rem;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
}

.progress-bar {
    height: 6px;
    background: #4a5568;
    border-radius: 3px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%; /* Dinámico */
    background: var(--accent-success);
}

/* --- CONTENIDO PRINCIPAL --- */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 3rem 4rem;
    max-width: 1400px; /* Límite de lectura */
}

header.syllabus-header {
    margin-bottom: 4rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 2rem;
}

h2.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    color: var(--k8s-dark);
    margin-bottom: 1rem;
}

p.intro-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
}

/* --- MÓDULOS DEL SYLLABUS --- */
.module-card {
    background: white;
    border-radius: 16px;
    padding: 0;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-card);
    border: 1px solid #edf2f7;
    overflow: hidden;
}

.module-header {
    padding: 2rem;
    background: white;
    border-bottom: 1px solid #edf2f7;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-title h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    color: var(--k8s-dark);
    display: flex;
    align-items: center;
    gap: 15px;
}

.weight-badge {
    background-color: var(--k8s-blue);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.module-body { padding: 2rem; }

/* --- ACORDEONES DETALLADOS --- */
details.topic {
    margin-bottom: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: all 0.3s ease;
}

details.topic[open] {
    border-color: var(--k8s-blue);
    box-shadow: 0 4px 12px rgba(50, 108, 229, 0.1);
}

summary.topic-summary {
    padding: 1.2rem;
    cursor: pointer;
    font-weight: 600;
    list-style: none;
    position: relative;
    padding-right: 3rem;
    color: var(--k8s-dark);
}

summary.topic-summary::-webkit-details-marker { display: none; }

summary.topic-summary::after {
    content: '+';
    position: absolute;
    right: 1.5rem;
    font-size: 1.5rem;
    color: var(--k8s-blue);
    font-weight: 300;
}

details[open] summary.topic-summary::after { content: '-'; }

.topic-content {
    padding: 1.5rem;
    border-top: 1px solid #edf2f7;
    background-color: #fbfbfb;
}

/* --- ELEMENTOS INTERNOS DEL CONTENIDO --- */
.source-tag {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.tag-kk { background-color: #e6fffa; color: #2c7a7b; border: 1px solid #b2f5ea; }
.tag-or { background-color: #fffaf0; color: #c05621; border: 1px solid #fbd38d; }
.tag-new { background-color: #ebf8ff; color: #2b6cb0; border: 1px solid #bee3f8; }

ul.topic-list {
    list-style-position: inside;
    margin: 1rem 0;
    color: var(--text-secondary);
}

ul.topic-list li { margin-bottom: 0.5rem; }

/* --- BLOQUES DE CÓDIGO --- */
.code-block {
    background-color: var(--code-bg);
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    position: relative;
    overflow-x: auto;
}

.code-block::before {
    content: 'BASH / YAML';
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(255,255,255,0.1);
    padding: 4px 8px;
    font-size: 0.7rem;
    border-bottom-left-radius: 8px;
    color: #a0aec0;
}

.cmd { color: #a5d6ff; font-weight: bold; }
.flag { color: #79c0ff; }
.val { color: #d2a8ff; }

/* --- RESPONSIVIDAD --- */
@media (max-width: 1024px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.3s; }
    .sidebar.active { transform: translateX(0); }
    .main-content { margin-left: 0; padding: 2rem; }
    .main-content { padding-top: 80px; }
}

@media (max-width: 768px) {
    .main-content { padding: 1rem; }
    h2.section-title { font-size: 2rem; }
    .module-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .module-header { padding: 1.5rem; }
    .module-body { padding: 1.5rem; }
}

/* --- GITHUB LINK --- */
.github-link {
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
    color: var(--github-color);
    opacity: 0.7;
    transition: all 0.2s ease;
    text-decoration: none;
}

.github-link:hover {
    opacity: 1;
    color: var(--k8s-blue);
    transform: translateY(-1px);
}

.topic-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
