/******************
    User custom CSS
    ---------------
*/

/* 1. Cambio de Botones de Navegación y Acción (Verde a Rojo ESPOCH) */
.btn-primary, .btn-success, .btn-info {
    background-color: #e33324 !important;
    border-color: #c0281c !important;
    color: #ffffff !important;
}

.btn-primary:hover, .btn-success:hover, .btn-info:hover {
    background-color: #c0281c !important;
    border-color: #a02015 !important;
    color: #ffffff !important;
}

/* Botón Anterior (Botones Secundarios) */
.btn-default, .btn-secondary, .btn-outline-secondary, .btn-outline-primary {
    color: #333f48 !important;
    border-color: #333f48 !important;
    background-color: transparent !important;
}

.btn-default:hover, .btn-secondary:hover, .btn-outline-secondary:hover {
    color: #ffffff !important;
    background-color: #333f48 !important;
}

/* 2. Barra Superior y Títulos (Gris oscuro ESPOCH) */
.navbar-default, .navbar-inverse {
    background-color: #333f48 !important;
    border-color: #273038 !important;
}

.navbar-brand, .navbar-nav>li>a {
    color: #ffffff !important;
}

/* 3. Textos, descripciones y mensajes de bienvenida que aparecen verdes por defecto */
.text-success, .text-primary, .text-info,
.survey-name, .survey-description, .survey-welcome,
.survey-description-text, .survey-welcome-text,
.welcome-title, .ls-questionhelp,
.message-box, .jumbotron {
    color: #333f48 !important;
}

/* 4. Enlaces destacados */
a {
    color: #e33324 !important;
}

a:hover {
    color: #c0281c !important;
}

/* 5. Barra de progreso */
.progress-bar {
    background-color: #e33324 !important;
}

/* 6. Cajas y Bordes Activos */
.form-control:focus {
    border-color: #e33324 !important;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(227,51,36,.6) !important;
}

/* Forzar sobreescritura global de cualquier texto verde sobrante */
h1, h2, h3, h4, h5, h6 {
    color: #333f48 !important;
}

/* 7. Texto institucional al lado del logo */
.navbar-brand::after {
    content: 'Sistema de Encuestas Institucionales' !important;
    position: absolute !important;
    left: 80px !important; /* Ajuste para separar del logo */
    top: 50% !important;
    transform: translateY(-50%) !important;
    color: #333f48 !important; /* Gris Oscuro */
    font-size: 18px !important;
    font-weight: bold !important;
    white-space: nowrap !important;
    display: block !important;
    z-index: 1050 !important;
}

/* Forzar que ningún contenedor padre rompa el 'position: fixed' */
body, #wrapper, .outerframe, .survey-container {
    overflow-x: visible !important;
    overflow-y: visible !important;
}

/* 8. Fijar únicamente la barra de progreso (línea delgada) y no sus contenedores gigantes */
.progress {
    position: fixed !important;
    top: 75px !important; /* Ajuste preciso: empujada más abajo para no montar la barra superior */
    left: 0 !important;
    width: 100% !important;
    z-index: 1030 !important; /* Menor que el menú móvil desplegable para que no lo tape */
    margin: 0 !important;
    border-radius: 0 !important;
    height: 15px !important; /* Barra delgada y elegante */
    background-color: #e2e8f0 !important; /* Fondo gris muy clarito para la barra vacía */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
}

.progress-bar {
    background-color: #e33324 !important; /* Rojo ESPOCH para el llenado */
}

/* Neutralizar por completo los contenedores padre para que no generen espacios en blanco gigantes ni tapen el texto */
.top-container, .progress-container, .ls-progress-container, #progress-wrapper {
    position: static !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: none !important;
    height: 0 !important;
    min-height: 0 !important;
    box-shadow: none !important;
}
.progress-bar {
    background-color: #e33324 !important; /* Rojo ESPOCH */
}

/* Empuje del cuerpo de la encuesta hacia abajo */
.outerframe, #outerframeContainer, .survey-container, #welcome-container, #question-container {
    margin-top: 110px !important; /* Ajustado para el nuevo top de la barra de progreso */
}

/* --- DISEÑO RESPONSIVO (MÓVILES Y TABLETS PEQUEÑAS) --- */
@media (max-width: 768px) {
    /* 1. Restaurar el logotipo y el texto institucional en la barra móvil */
    .navbar-header, .navbar-brand {
        display: flex !important;
        align-items: center !important;
    }
    .navbar-brand img, .logo-container img {
        display: block !important;
        max-height: 30px !important; /* Más pequeño para que quepa */
        width: auto !important;
    }
    .navbar-brand::after {
        display: block !important;
        font-size: 13px !important;
        left: 55px !important; /* Más cerca del logo pequeño */
        white-space: normal !important; /* Permitir salto de línea */
        max-width: 180px !important; /* Evitar que empuje al menú hamburguesa */
        line-height: 1.1 !important;
    }

    /* 2. En móviles, la barra fluye con la página */
    .progress {
        position: static !important; 
        margin-top: 15px !important;
        margin-bottom: 15px !important;
        box-shadow: none !important;
    }

    /* 3. Como anulamos la altura del padre globalmente, la barra se monta sobre el texto. 
          Forzamos a que el cuerpo principal baje para darle espacio a la barra estática. */
    .outerframe, #outerframeContainer, .survey-container, #welcome-container, #question-container {
        margin-top: 70px !important; 
    }
}


/* 9. Diferenciación de Texto de Pregunta y Texto de Ayuda */
.ls-questionhelp, .questionhelp, .question-help-container {
    color: #6c757d !important;
    font-size: 0.9em !important;
    font-style: italic !important;
}

.question-title-container, .question-text {
    font-weight: bold !important;
    color: #333f48 !important;
}
