﻿/**
 * SURVEY MODERN STYLES - CODIFICANDO
 * Estilos modernos para el modulo de encuestas de Odoo 17
 * Compatible con theme_voltro
 * v2.0.0 - Improved colors, contrast, and emoji support
 * =====================================================
 */

/* ===== VARIABLES CSS ===== */
:root {
    /* Primary Colors - Orange Theme */
    --cod-survey-primary: #f7941d;
    --cod-survey-primary-dark: #e07e0d;
    --cod-survey-primary-light: #ffb347;
    --cod-survey-gradient: linear-gradient(135deg, #ff9a1f 0%, #f7941d 50%, #e07e0d 100%);
    
    /* Background Colors */
    --cod-survey-bg: #f0f4f8;
    --cod-survey-card-bg: #ffffff;
    --cod-survey-question-bg: #fafbfc;
    
    /* Text Colors - High Contrast */
    --cod-survey-text-dark: #1a1a2e;
    --cod-survey-text: #2d3748;
    --cod-survey-text-secondary: #4a5568;
    --cod-survey-text-muted: #718096;
    --cod-survey-text-light: #a0aec0;
    
    /* Border Colors */
    --cod-survey-border: #e2e8f0;
    --cod-survey-border-active: #f7941d;
    
    /* Status Colors */
    --cod-survey-success: #10b981;
    --cod-survey-success-bg: #d1fae5;
    --cod-survey-error: #ef4444;
    --cod-survey-error-bg: #fee2e2;
    --cod-survey-info: #3b82f6;
    --cod-survey-info-bg: #dbeafe;
    --cod-survey-warning: #f59e0b;
    --cod-survey-warning-bg: #fef3c7;
    
    /* Shadows */
    --cod-survey-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --cod-survey-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --cod-survey-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --cod-survey-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --cod-survey-radius-sm: 8px;
    --cod-survey-radius: 12px;
    --cod-survey-radius-lg: 16px;
    --cod-survey-radius-xl: 24px;
}

/* ===== FONT STACK WITH EMOJI SUPPORT ===== */
.o_survey_wrap,
.o_survey_wrap *,
.o_survey_form,
.o_survey_form * {
    font-family: 'Inter', 'Segoe UI', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji', system-ui, -apple-system, sans-serif !important;
}

/* ===== FONDO Y CONTENEDOR PRINCIPAL ===== */
.o_survey_background,
body.o_survey_background {
    background: linear-gradient(180deg, #f0f4f8 0%, #e2e8f0 100%) !important;
    min-height: 100vh !important;
}

.o_survey_wrap {
    min-height: 100vh !important;
    padding: 2rem 1rem !important;
    background: transparent !important;
}

/* ===== MAIN CONTAINER ===== */
.o_survey_wrap .container,
.o_survey_wrap > .container-fluid {
    max-width: 900px !important;
    margin: 0 auto !important;
}

/* ===== TÃTULO PRINCIPAL ===== */
.o_survey_main_title,
.o_survey_title,
.o_survey_wrap h1,
.o_survey_wrap .display-4 {
    font-size: clamp(1.75rem, 4vw, 2.5rem) !important;
    font-weight: 700 !important;
    color: var(--cod-survey-text-dark) !important;
    text-align: center !important;
    margin-bottom: 1.5rem !important;
    line-height: 1.2 !important;
    letter-spacing: -0.02em !important;
}

/* ===== PAGE INDICATOR / BREADCRUMB ===== */
.o_survey_wrap .breadcrumb,
.o_survey_page_title,
.o_survey_wrap .badge {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    background: var(--cod-survey-card-bg) !important;
    border: 1px solid var(--cod-survey-border) !important;
    border-radius: 50px !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    color: var(--cod-survey-text-secondary) !important;
    margin-bottom: 1rem !important;
    box-shadow: var(--cod-survey-shadow-sm) !important;
}

/* ===== SECTION HEADER ===== */
.o_survey_wrap h2,
.o_survey_wrap .h2,
.o_survey_section_title {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    color: var(--cod-survey-text-dark) !important;
    text-align: center !important;
    margin: 1.5rem 0 !important;
}

/* ===== FORMULARIO PRINCIPAL ===== */
.o_survey_form {
    background: var(--cod-survey-card-bg) !important;
    border-radius: var(--cod-survey-radius-lg) !important;
    box-shadow: var(--cod-survey-shadow-lg) !important;
    padding: 2.5rem !important;
    max-width: 800px !important;
    margin: 0 auto 2rem !important;
    border: 1px solid var(--cod-survey-border) !important;
}

.o_survey_form_content {
    padding: 0 !important;
}

/* ===== WRAPPER DE PREGUNTA ===== */
.js_question-wrapper {
    background: var(--cod-survey-question-bg, #fafbfc) !important;
    border-radius: var(--cod-survey-radius) !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    border: 2px solid var(--cod-survey-border) !important;
    transition: all 0.3s ease !important;
    position: relative !important;
}

.js_question-wrapper:hover {
    border-color: var(--cod-survey-primary-light, #ffb347) !important;
    box-shadow: 0 0 0 3px rgba(247, 148, 29, 0.08) !important;
}

.js_question-wrapper:focus-within {
    border-color: var(--cod-survey-primary) !important;
    box-shadow: 0 0 0 4px rgba(247, 148, 29, 0.15) !important;
}

/* ===== TÃTULO DE PREGUNTA ===== */
.js_question-wrapper h3,
.js_question-wrapper .h3,
.js_question-wrapper label.o_survey_form_choice,
.js_question-wrapper .o_survey_question_text_title,
.o_survey_question_title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: var(--cod-survey-text-dark, #1a1a2e) !important;
    margin-bottom: 1rem !important;
    line-height: 1.5 !important;
    display: block !important;
}

/* Remove pseudo-elements that cause encoding issues */
.js_question-wrapper h3::before,
.js_question-wrapper .h3::before {
    content: none !important;
    display: none !important;
}

/* ===== INPUTS DE TEXTO ===== */
.o_survey_question_text_box,
.o_survey_question_numerical_box,
.o_survey_question_date,
.o_survey_question_datetime,
.o_survey_comment,
.o_survey_form .form-control,
.o_survey_form input[type="text"],
.o_survey_form input[type="email"],
.o_survey_form input[type="tel"],
.o_survey_form input[type="number"],
.o_survey_form input[type="date"],
.o_survey_form textarea {
    width: 100% !important;
    padding: 0.875rem 1rem !important;
    font-size: 1rem !important;
    border: 2px solid var(--cod-survey-border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    transition: all 0.2s ease !important;
    color: var(--cod-survey-text) !important;
}

.o_survey_question_text_box:focus,
.o_survey_question_numerical_box:focus,
.o_survey_question_date:focus,
.o_survey_question_datetime:focus,
.o_survey_comment:focus,
.o_survey_form .form-control:focus,
.o_survey_form input:focus,
.o_survey_form textarea:focus {
    border-color: var(--cod-survey-primary) !important;
    box-shadow: 0 0 0 4px rgba(247, 148, 29, 0.15) !important;
    outline: none !important;
}

.o_survey_form input::placeholder,
.o_survey_form textarea::placeholder {
    color: var(--cod-survey-text-muted) !important;
    opacity: 0.7 !important;
}

/* ===== TEXTAREA ===== */
.o_survey_form textarea,
textarea.o_survey_question_text_box {
    min-height: 120px !important;
    resize: vertical !important;
}

/* ===== CONTENEDOR DE COMENTARIOS ===== */
.o_survey_comment_container {
    margin-top: 1rem !important;
    padding-top: 1rem !important;
    border-top: 1px dashed var(--cod-survey-border) !important;
}

/* ===== OPCIONES DE RESPUESTA ===== */
.o_survey_answer_wrapper {
    margin-bottom: 0.5rem !important;
}

.o_survey_choice_btn {
    display: flex !important;
    align-items: center !important;
    gap: 0.75rem !important;
    padding: 0.875rem 1.25rem !important;
    background: #fff !important;
    border-radius: 10px !important;
    border: 2px solid var(--cod-survey-border) !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    font-weight: 500 !important;
    color: var(--cod-survey-text) !important;
    width: 100% !important;
    text-align: left !important;
}

.o_survey_choice_btn:hover {
    background: #f1f5f9 !important;
    border-color: var(--cod-survey-primary) !important;
}

.o_survey_choice_btn.o_survey_selected,
.o_survey_selected {
    background: rgba(247, 148, 29, 0.1) !important;
    border-color: var(--cod-survey-primary) !important;
    color: var(--cod-survey-primary-dark) !important;
}

/* ===== RADIO BUTTONS Y CHECKBOXES ===== */
.o_survey_form input[type="radio"],
.o_survey_form input[type="checkbox"] {
    width: 1.25rem !important;
    height: 1.25rem !important;
    accent-color: var(--cod-survey-primary) !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
}

/* ===== BOTÃ“N ENVIAR / SIGUIENTE ===== */
.o_survey_form button[type="submit"],
.o_survey_form .btn-primary,
.o_survey_navigation_submit .btn-primary,
#next_page,
button[value="start"],
button[value="next"] {
    background: var(--cod-survey-gradient) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-size: 1.1rem !important;
    padding: 1rem 2.5rem !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 4px 14px rgba(247, 148, 29, 0.4) !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
}

.o_survey_form button[type="submit"]:hover,
.o_survey_form .btn-primary:hover,
.o_survey_navigation_submit .btn-primary:hover,
#next_page:hover {
    background: linear-gradient(135deg, #e07e0d 0%, #d06a00 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(247, 148, 29, 0.5) !important;
}

.o_survey_form button[type="submit"]:active,
.o_survey_form .btn-primary:active {
    transform: translateY(0) !important;
}

/* ===== BOTONES SECUNDARIOS ===== */
.o_survey_form .btn-secondary,
.o_survey_navigation_submit .btn-secondary {
    background: #fff !important;
    border: 2px solid var(--cod-survey-border) !important;
    color: var(--cod-survey-text) !important;
    padding: 0.875rem 1.5rem !important;
    border-radius: 10px !important;
    font-weight: 500 !important;
    transition: all 0.2s ease !important;
}

.o_survey_form .btn-secondary:hover,
.o_survey_navigation_submit .btn-secondary:hover {
    border-color: var(--cod-survey-primary) !important;
    color: var(--cod-survey-primary) !important;
}

/* ===== TEXTO AYUDA TECLADO ===== */
.o_survey_form .text-muted,
.o_survey_form small {
    font-size: 0.875rem !important;
    color: var(--cod-survey-text-muted) !important;
}

/* ===== BARRA DE PROGRESO ===== */
.o_survey_progress,
.progress,
.o_survey_form .progress,
.o_survey_wrap .progress {
    height: 8px !important;
    border-radius: 4px !important;
    background: var(--cod-survey-border) !important;
    overflow: hidden !important;
    margin-bottom: 1.5rem !important;
}

.o_survey_progress .progress-bar,
.o_survey_progress > div,
.progress-bar,
.o_survey_form .progress-bar,
.o_survey_wrap .progress-bar {
    background: var(--cod-survey-gradient) !important;
    border-radius: 4px !important;
    transition: width 0.5s ease !important;
}

/* Force orange on all progress bar variants */
.progress-bar.bg-danger,
.progress-bar.bg-primary,
.progress-bar.bg-success,
.progress-bar.bg-info,
.progress-bar.bg-warning,
.o_survey_wrap .progress-bar[class*="bg-"] {
    background: var(--cod-survey-gradient) !important;
}

/* ===== TIMER ===== */
.o_survey_timer {
    background: var(--cod-survey-card-bg) !important;
    border-radius: 8px !important;
    padding: 0.5rem 1rem !important;
    font-weight: 600 !important;
    color: var(--cod-survey-text) !important;
    box-shadow: var(--cod-survey-shadow) !important;
}

/* ===== MATRIZ DE PREGUNTAS ===== */
.o_survey_question_matrix {
    width: 100% !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border-radius: var(--cod-survey-radius) !important;
    overflow: hidden !important;
    border: 1px solid var(--cod-survey-border) !important;
}

.o_survey_question_matrix th,
.o_survey_question_matrix td {
    padding: 1rem !important;
    text-align: center !important;
    border-bottom: 1px solid var(--cod-survey-border) !important;
}

.o_survey_question_matrix th {
    background: #f8fafc !important;
    font-weight: 600 !important;
    color: var(--cod-survey-text) !important;
}

.o_survey_question_matrix tr:last-child td {
    border-bottom: none !important;
}

.o_survey_question_matrix tr:hover td {
    background: rgba(247, 148, 29, 0.05) !important;
}

/* ===== ERROR EN PREGUNTA ===== */
.o_survey_question_error,
.js_question-wrapper.o_survey_question_error {
    border-color: var(--cod-survey-error) !important;
    background: rgba(239, 68, 68, 0.05) !important;
}

.o_survey_form .text-danger,
.o_survey_form .invalid-feedback {
    color: var(--cod-survey-error) !important;
    font-size: 0.875rem !important;
    margin-top: 0.5rem !important;
}

/* ===== PÃGINA INICIO ===== */
.o_survey_start {
    text-align: center !important;
    padding: 3rem 2rem !important;
}

.o_survey_start .btn-lg {
    padding: 1.25rem 3rem !important;
    font-size: 1.2rem !important;
}

/* ===== PÃGINA FINALIZADA ===== */
.o_survey_finished {
    background: var(--cod-survey-card-bg) !important;
    border-radius: var(--cod-survey-radius-lg) !important;
    padding: 3rem 2rem !important;
    box-shadow: var(--cod-survey-shadow-lg) !important;
    text-align: center !important;
    max-width: 600px !important;
    margin: 2rem auto !important;
}

.o_survey_finished .fa-check-circle {
    font-size: 4rem !important;
    color: var(--cod-survey-success) !important;
    margin-bottom: 1rem !important;
}

/* ===== ALERTAS ===== */
.o_survey_form .alert,
.o_survey_wrap .alert {
    border-radius: var(--cod-survey-radius) !important;
    border: none !important;
    padding: 1rem 1.5rem !important;
    margin-bottom: 1.5rem !important;
}

.o_survey_wrap .alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%) !important;
    color: #065f46 !important;
}

.o_survey_wrap .alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%) !important;
    color: #991b1b !important;
}

.o_survey_wrap .alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
    color: #1e40af !important;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 768px) {
    .o_survey_wrap {
        padding: 1rem 0.5rem !important;
    }
    
    .o_survey_form {
        padding: 1.5rem 1rem !important;
        margin: 0 0.5rem 1.5rem !important;
        border-radius: var(--cod-survey-radius) !important;
    }
    
    .js_question-wrapper {
        padding: 1rem !important;
    }
    
    .o_survey_form button[type="submit"],
    .o_survey_form .btn-primary {
        width: 100% !important;
        justify-content: center !important;
    }
    
    .o_survey_choice_btn {
        padding: 0.75rem 1rem !important;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes surveyFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.js_question-wrapper {
    animation: surveyFadeIn 0.4s ease-out !important;
    animation-fill-mode: both !important;
}

.js_question-wrapper:nth-child(1) { animation-delay: 0.1s !important; }
.js_question-wrapper:nth-child(2) { animation-delay: 0.2s !important; }
.js_question-wrapper:nth-child(3) { animation-delay: 0.3s !important; }
.js_question-wrapper:nth-child(4) { animation-delay: 0.4s !important; }
.js_question-wrapper:nth-child(5) { animation-delay: 0.5s !important; }

/* ===== PRINT STYLES ===== */
@media print {
    .o_survey_form button[type="submit"],
    .o_survey_navigation_submit,
    .o_survey_progress {
        display: none !important;
    }
    
    .js_question-wrapper {
        break-inside: avoid !important;
        border: 1px solid #ccc !important;
    }
}
