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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
}

/* Class for the main index.html layout  */
.app-shell {
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Botón de Menú (Móvil) - Oculto por defecto en Desktop */
.menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 2000;
    background-color: #cc0000;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Overlay oscuro para móvil */
.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    display: block;
    opacity: 1;
}

/* Layout */
.container {
    display: flex;
    flex: 1;
    /* Height automático por flex: 1 */
    position: relative;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: #e0e0e0; 
    border-right: 1px solid #ccc;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
    flex-shrink: 0;
    transition: transform 0.3s ease; /* Animación suave */
    z-index: 1000; /* Por encima del contenido en móvil */
}

.banner-container {
    margin-bottom: 30px;
    text-align: center;
}

.banner-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.sidebar-title {
    color: #cc0000;
    font-size: 1.2rem;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #cc0000;
    padding-bottom: 10px;
}

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

.nav-item {
    margin-bottom: 15px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-size: 0.95rem;
    display: block;
    padding: 10px;
    border-radius: 5px;
    transition: all 0.3s ease;
    border-left: 3px solid #cc0000;
}

.nav-link:hover, .nav-link.active {
    background-color: #d0d0d0;
    color: #000;
    border-left: 3px solid #cc0000;
}

.nav-link .practice-num {
    color: #cc0000;
    font-weight: bold;
    margin-right: 5px;
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Main Content */
.main-content {
    flex: 1;
    background-color: #fff;
    position: relative;
    width: 100%; /* Asegura ancho completo */
}

iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #fff; 
}

/* Footer */
.footer {
    height: auto;
    min-height: 80px; /* Reducido ligeramente */
    padding: 10px 20px; /* Padding más compacto */
    background-color: #f8f8f8;
    border-top: 2px solid #cc0000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 0.8rem; /* Texto más pequeño para escritorio */
    text-align: center;
    z-index: 10;
    flex-shrink: 0; /* Asegura que el footer no se aplaste */
}

.footer-info {
    margin-bottom: 10px;
    line-height: 1.4;
}

.footer-info strong {
    color: #cc0000;
}

#last-updated {
    color: #cc0000;
    font-weight: bold;
    font-size: 0.85rem; /* This is the current font size */
}

/* Download Button Styles */
.download-container {
    display: flex;
    justify-content: flex-start; 
    padding: 15px 20px;
    margin-bottom: 25px;
    background-color: transparent;
    border-bottom: 1px solid #eaeaea;
}

.download-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(135deg, #cc0000 0%, #990000 100%);
    color: #ffffff !important;
    padding: 12px 28px;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    box-shadow: 0 4px 15px rgba(204, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(204, 0, 0, 0.4);
    background: linear-gradient(135deg, #e60000 0%, #b30000 100%);
}

.download-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(204, 0, 0, 0.3);
}

.download-btn::before {
    content: "📥"; 
    font-size: 1.1em;
    filter: brightness(0) invert(1); 
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f4f4f4; 
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: #cc0000; 
    border-radius: 5px;
    border: 2px solid #f4f4f4;
}

::-webkit-scrollbar-thumb:hover {
    background: #990000; 
}

* {
    scrollbar-width: thin;
    scrollbar-color: #cc0000 #f4f4f4;
}

/* =========================================
    MATLAB HTML - Estilos internos
   ========================================= */
.rtcContent {
    max-width: 950px;
    margin: 40px auto !important;
    background-color: #ffffff;
    padding: 60px !important;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    border-top: 6px solid #cc0000;
    opacity: 0;
    animation: slideUpFade 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

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

h1, .S0, .S1 {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    color: #222 !important;
    letter-spacing: -0.5px;
}

.S0 span {
    color: #cc0000 !important;
    font-size: 2.2rem !important;
    font-weight: 800 !important;
    border-bottom: 2px solid #eee;
    padding-bottom: 15px;
    display: block;
    margin-bottom: 20px;
}

.S1 span {
    color: #555 !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
}

p, .S2, .S3, .S4, .S5, .S6, li {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important;
    line-height: 1.8 !important;
    color: #444 !important;
    font-size: 16px !important;
}

ul, ol {
    margin-left: 20px !important;
    margin-bottom: 20px !important;
}

li { margin-bottom: 8px; }

.CodeBlock {
    background-color: #f8f9fa !important;
    border: 1px solid #e9ecef !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin: 25px 0 !important;
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.03);
    font-family: 'Consolas', 'Monaco', monospace !important;
    font-size: 14px !important;
    overflow-x: auto;
}

img {
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin: 20px auto;
    display: block;
    max-width: 100%;
    transition: transform 0.3s ease;
}

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

span[texencoding] img {
    display: inline;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    transition: none;
}

span[texencoding] img:hover { transform: none; }

.rtcContent div, .rtcContent pre, .eoOutputWrapper, .embeddedOutputsTextElement, .inlineElement {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

.eoOutputWrapper, .CodeBlock, .S11, .S13, .embeddedOutputsTextElement {
    overflow-x: auto !important;
    display: block !important;
    word-wrap: break-word; 
}

.textElement, .eoOutputContent {
    white-space: pre-wrap !important; 
    font-family: 'Consolas', 'Monaco', monospace !important;
    font-size: 13px !important;
}

img { height: auto !important; max-width: 100% !important; }


/* =========================================
    RESPONSIVE / MOBILE DESIGN
   ========================================= */
@media (max-width: 768px) {
    .menu-toggle {
        display: block; /* Mostrar botón en móvil */
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        width: 80%; /* Ancho del menú en móvil */
        max-width: 300px;
        transform: translateX(-100%); /* Oculto a la izquierda */
        box-shadow: 5px 0 15px rgba(0,0,0,0.2);
    }

    .sidebar.active {
        transform: translateX(0); /* Mostrar al activar */
    }

    .rtcContent {
        padding: 20px !important;
        margin: 10px !important;
    }
    
    /* Ajuste para que el botón no tape contenido en home.html */
    .hero-wrapper {
        padding-top: 60px !important; 
    }

    /* Footer: ajustar tamaño de fuente para móviles */
    .footer {
        font-size: 0.75rem; /* Tamaño general del texto del footer */
        padding: 10px; /* Reducir padding */
    }

    .footer-info {
        font-size: 0.8rem;
    }
    
    #last-updated {
        font-size: 0.7rem; /* Tamaño para la fecha de actualización */
    }
}