/* ============================================================
 * encuesta-form.css
 * Estilos del formulario público de encuestas (encuesta-segura.php)
 *
 * Cubre:
 *   - Cards de encuestas (listado, imagen de portada, placeholder).
 *   - Pasos del flujo (#step-1..4).
 *   - Resultados graficos al finalizar.
 *   - Variables de marca y elementos auxiliares.
 *
 * Las clases con prefijo de Bootstrap (form-check, alert, badge, etc.)
 * se asume que las aporta Bootstrap 5.3 cargado en la pagina padre.
 * ============================================================ */

/* ============ Variables de marca ============ */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4cc9f0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --success-color: #4bb543;
    --warning-color: #ffcc00;
    --danger-color: #f44336;
}

/* ============ Cards de encuestas ============ */
.card-encuesta {
    transition: all 0.3s ease;
    cursor: pointer;
    height: 100%;
    overflow: hidden;
}

.card-encuesta:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img-wrapper {
    line-height: 0;
}

.card-img-encuesta {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #f0f0f0;
}

.card-img-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1976d2;
    font-size: 56px;
    border-bottom: 1px solid #e0e0e0;
}

/* Card generica del flujo de encuesta */
.card {
    border: none;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    margin-bottom: 20px;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* ============ Container general del listado ============ */
#encuestas-container {
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.encuesta {
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

/* ============ Pasos del flujo (step-1..4) ============ */
.step {
    display: none;
}

.step.active {
    display: block;
    animation: fadeIn 0.5s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.progress-bar {
    transition: width 0.5s ease;
}

/* ============ Resultados al finalizar la encuesta ============ */
.resultados-container {
    margin-top: 10px;
}

.resultado-pregunta {
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 16px 18px;
    margin-bottom: 14px;
    background: #fafbfc;
}

.resultado-pregunta h5 {
    font-size: 1rem;
    color: #333;
    margin: 0 0 4px;
    font-weight: 600;
}

.resultado-pregunta .total-respuestas {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 12px;
}

.resultado-pregunta .chart-wrapper {
    position: relative;
    height: 220px;
    max-width: 100%;
}

.resultado-opcion-mia {
    background: #d1edff !important;
    border-color: #0d6efd !important;
}

.resultado-opcion-mia::before {
    content: "Tu respuesta";
    background: #0d6efd;
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 6px;
    vertical-align: middle;
}

/* ============ Sidebar (vista admin embebida, opcional) ============ */
.sidebar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    height: 100vh;
    position: fixed;
    padding: 20px 0;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    margin: 5px 0;
    border-radius: 5px;
    transition: all 0.3s;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 500;
}

.sidebar .nav-link i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.main-content {
    margin-left: 250px;
    padding: 20px;
    transition: all 0.3s;
}

/* ============ Tablas, badges y opciones (auxiliares) ============ */
.table th {
    font-weight: 600;
    color: var(--dark-color);
}

.badge-estado {
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 500;
}

.badge-activa {
    background-color: rgba(46, 204, 113, 0.2);
    color: var(--success-color);
}

.badge-inactiva {
    background-color: rgba(231, 76, 60, 0.2);
    color: var(--danger-color);
}

.badge-tipo {
    background-color: rgba(52, 152, 219, 0.2);
    color: var(--primary-color);
}

.btn-action {
    padding: 5px 8px;
    border-radius: 5px;
    margin-right: 3px;
    transition: all 0.2s;
}

.btn-action:hover {
    transform: scale(1.1);
}

.opcion-item {
    display: flex;
    align-items: center;
    padding: 8px;
    border-bottom: 1px solid #eee;
}

.opcion-item:last-child {
    border-bottom: none;
}

.opcion-item input {
    flex-grow: 1;
    margin-right: 10px;
}

/* ============ Animaciones ============ */
.animate__animated {
    --animate-duration: 0.5s;
}

/* ============ Titulo de seccion ============ */
.section-title {
    text-align: center;
    color: #28a745;
    font-weight: 800;
    font-size: 1.8rem;
    margin: 0 0 2.5rem;
    letter-spacing: -0.5px;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 3px;
    background: #28a745;
    border-radius: 2px;
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .main-content {
        margin-left: 0;
    }
}
