:root {
    /* Paleta ICESI */
    --icesi-blue: #5454e9;
    --icesi-white: #ffffff;
    --icesi-yellow: #e4eb60;
    --icesi-green: #4cb979;
    --icesi-purple: #865cf0;
    --icesi-orange: #e9683b;
    
    --sidebar-width: 300px;
    --header-height: 70px; 
}

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

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* Header */
header {
    background-color: var(--icesi-blue);
    color: var(--icesi-white);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between; 
    padding: 0 25px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.hamburger {
    font-size: 26px;
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    padding: 5px;
}

.site-title {
    font-weight: 600;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}


.logo-icesi {
    height: 45px; 
    width: auto;
    filter: brightness(0) invert(1); 
    opacity: 0.9;
}


.main-container {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--header-height));
}


#sidebar {
    width: var(--sidebar-width);
    background-color: #f8f9fa;
    overflow-y: auto;
    border-right: 1px solid #e0e0e0;
    transition: margin-left 0.3s ease;
}

#sidebar.collapsed {
    margin-left: calc(var(--sidebar-width) * -1);
}

/* Menú Items */
.menu-item { 
    cursor: pointer; 
    user-select: none; 
    transition: background-color 0.2s ease;
}

.level-curso { 
    background-color: #4a4ac2; 
    color: white; 
    padding: 18px 20px; 
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 700;
    font-size: 1rem;
}

.level-unidad { 
    background-color: #f1f3f5; 
    padding: 12px 20px; 
    border-left: 5px solid var(--icesi-purple);
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
}

.level-semana { 
    background-color: #ffffff; 
    padding: 10px 20px 10px 30px; 
    color: #555;
    font-weight: 500;
    font-size: 0.9rem;
    border-left: 5px solid var(--icesi-orange);
    border-bottom: 1px solid #f0f0f0;
}

.level-sesion { 
    padding: 10px 20px 10px 45px; 
    font-size: 0.85rem;
    color: #666;
    display: block;
    border-left: 5px solid var(--icesi-green);
    background-color: #fff;
}

.level-sesion:hover {
    background-color: var(--icesi-yellow);
    color: #000;
    font-weight: 600;
}


/* Asegura que el panel derecho permita scroll interno */
#content-area {
  flex: 1;
  background-color: #525659; /* el gris del área general */
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: hidden; /* clave para que no se “expanda” en vez de scrollear */
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.hidden { display: none; }

/* PDF ocupa todo cuando está visible */
#pdf-viewer {
  width: 100%;
  height: 100%;
  border: none;
}

/* Contenedor Markdown estilo “hoja” */
#md-viewer {
  width: 100%;
  height: 100%;
  overflow-y: auto;            /* scroll con la ruedita */
  padding: 28px 32px;
  background: #ffffff;         /* blanco dentro del panel */
  color: #1f2937;
  line-height: 1.65;
  font-size: 16px;
}

/* Limita el ancho para que no quede apeñuscado y mejora legibilidad */
#md-viewer > * {
  max-width: 900px;
}

/* Títulos */
#md-viewer h1 {
  margin: 8px 0 18px;
  font-size: 2rem;
  font-weight: 800;
  color: #111827;
}

#md-viewer h2 {
  margin: 28px 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--icesi-blue);
}

#md-viewer h3 {
  margin: 18px 0 8px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #111827;
}

/* Párrafos y bloques */
#md-viewer p {
  margin: 10px 0 12px;
}

/* Listas más limpias */
#md-viewer ul,
#md-viewer ol {
  margin: 10px 0 16px;
  padding-left: 28px;
}

#md-viewer li {
  margin: 6px 0;
}

/* Negritas: NO las pongas block (eso te rompe el flujo) */
#md-viewer strong {
  font-weight: 800;
}

/* Separadores: sin “línea infinita” */
#md-viewer hr {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, #e5e7eb, transparent);
  margin: 22px 0;
}

/* Inline code */
#md-viewer code {
  background: #f1f5f9;
  color: #0f172a;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.95em;
}

/* Code blocks */
#md-viewer pre {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  border-left: 6px solid var(--icesi-blue);
  padding: 14px 16px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 14px 0 18px;
  line-height: 1.5;
}

/* Quita el "doble fondo" (porque marked genera pre > code) */
#md-viewer pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
  display: block;
  white-space: pre; /* respeta indentación */
}


/* Bloques tipo cita */
#md-viewer blockquote {
  margin: 14px 0 16px;
  padding: 12px 14px;
  border-left: 5px solid var(--icesi-purple);
  background: #f8f7ff;
  border-radius: 8px;
}
