/**
 * Styles pour le front-end (formulaires publics)
 *
 * @package CIDFP_Satisfaction_Survey
 * @since 1.0
 */

/* ===== Container principal ===== */
.cidfp-survey-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
}

.cidfp-survey-wrapper {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 40px;
}

/* ===== En-tête ===== */
.cidfp-survey-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.cidfp-survey-header h1 {
    color: #333;
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 600;
}

.cidfp-survey-header h2 {
    color: #199ca4;
    font-size: 24px;
    margin-bottom: 10px;
    font-weight: 500;
}

.cidfp-survey-date,
.cidfp-participant-info {
    color: #666;
    font-size: 16px;
}

/* ===== Barre de progression ===== */
.cidfp-progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    padding: 0 20px;
}

.cidfp-progress-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.cidfp-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #ddd;
    z-index: -1;
}

.cidfp-progress-step.active:not(:last-child)::after,
.cidfp-progress-step.completed:not(:last-child)::after {
    background: #199ca4;
}

.cidfp-step-number {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    border-radius: 50%;
    background: #ddd;
    color: #666;
    font-weight: 600;
    margin-bottom: 8px;
}

.cidfp-progress-step.active .cidfp-step-number {
    background: #199ca4;
    color: white;
}

.cidfp-progress-step.completed .cidfp-step-number {
    background: #46b450;
    color: white;
}

.cidfp-step-label {
    display: block;
    font-size: 14px;
    color: #666;
}

.cidfp-progress-step.active .cidfp-step-label {
    color: #199ca4;
    font-weight: 600;
}

/* ===== Formulaire ===== */
.cidfp-form-section {
    margin-bottom: 30px;
}

.cidfp-form-section h3 {
    color: #333;
    font-size: 22px;
    margin-bottom: 20px;
    font-weight: 600;
}

.cidfp-form-description {
    color: #666;
    margin-bottom: 20px;
}

.cidfp-form-group {
    margin-bottom: 25px;
}

.cidfp-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.cidfp-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.cidfp-input:focus {
    outline: none;
    border-color: #199ca4;
    box-shadow: 0 0 0 3px rgba(25, 156, 164, 0.1);
}

/* ===== Questions ===== */
.cidfp-question-wrapper {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 25px;
    margin-bottom: 25px;
}

.cidfp-question-number {
    color: #199ca4;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.cidfp-question-text {
    color: #333;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 20px;
}

/* ===== Questions Radio ===== */
.cidfp-question-radio {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cidfp-radio-option {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.cidfp-radio-option:hover {
    border-color: #199ca4;
    background: #edf8f8;
}

.cidfp-radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    cursor: pointer;
}

.cidfp-radio-option input[type="radio"]:checked + span {
    font-weight: 600;
    color: #199ca4;
}

.cidfp-radio-option span {
    flex: 1;
    font-size: 16px;
}

/* ===== Questions Échelle (Vumètre) ===== */
.cidfp-question-scale {
    padding: 20px 0;
}

.cidfp-scale-wrapper {
    text-align: center;
}

.cidfp-scale-input {
    width: 100%;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(to right, #dc3232, #f56e28, #ffb900, #46b450);
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 20px;
}

.cidfp-scale-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 3px solid #199ca4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cidfp-scale-input::-moz-range-thumb {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    cursor: pointer;
    border: 3px solid #199ca4;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.cidfp-scale-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: #666;
}

.cidfp-scale-value {
    font-size: 32px;
    font-weight: bold;
    color: #199ca4;
}

/* ===== Récapitulatif ===== */
.cidfp-recap-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 20px;
}

.cidfp-recap-section h4 {
    color: #199ca4;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 18px;
}

.cidfp-recap-question {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.cidfp-recap-question:last-child {
    border-bottom: none;
}

.cidfp-recap-question-text {
    margin-bottom: 5px;
}

.cidfp-recap-answer {
    color: #199ca4;
    font-size: 16px;
    margin: 0;
}

.cidfp-confirmation-message {
    background: #e7f6f7;
    border-left: 4px solid #199ca4;
    padding: 15px;
    margin-top: 20px;
}

/* ===== Boutons ===== */
.cidfp-form-actions {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-top: 30px;
}

.cidfp-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.cidfp-btn-primary {
    background: #199ca4;
    color: white;
}

.cidfp-btn-primary:hover {
    background: #147f86;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 156, 164, 0.3);
}

.cidfp-btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.cidfp-btn-secondary:hover {
    background: #e0e0e0;
}

.cidfp-btn-submit {
    background: #46b450;
}

.cidfp-btn-submit:hover {
    background: #3ba042;
}

.cidfp-btn-icon {
    font-size: 18px;
}

/* ===== Messages ===== */
.cidfp-form-message {
    padding: 15px;
    border-radius: 4px;
    margin-top: 20px;
    font-weight: 500;
}

.cidfp-form-message.error {
    background: #fef2f2;
    border-left: 4px solid #dc3232;
    color: #dc3232;
}

.cidfp-form-message.success {
    background: #f0fdf4;
    border-left: 4px solid #46b450;
    color: #46b450;
}

/* ===== Système de notation étoiles ===== */
.cidfp-star-rating {
    display: inline-flex;
    flex-direction: row;
    gap: 4px;
    padding: 10px 0;
}

.cidfp-star-input {
    display: none;
}

.cidfp-star-label {
    cursor: pointer;
    font-size: 40px;
    color: #ddd;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
}

.cidfp-star-label:hover,
.cidfp-star-label.hover {
    color: #ffb900;
    transform: scale(1.15);
}

.cidfp-star-label.active {
    color: #ffb900;
}

.cidfp-star-icon {
    pointer-events: none;
}

.cidfp-star-text {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
    font-style: italic;
}

/* ===== Étoiles dans le récapitulatif ===== */
.cidfp-recap-stars {
    color: #ffb900;
    font-size: 20px;
    letter-spacing: 2px;
}

/* ===== Textarea témoignage ===== */
.cidfp-textarea {
    resize: vertical;
    min-height: 100px;
    max-height: 300px;
    font-family: inherit;
    line-height: 1.6;
}

.cidfp-char-count {
    text-align: right;
    font-size: 13px;
    color: #999;
    margin-top: 5px;
}

/* ===== Toggle Switch (Oui/Non) ===== */
.cidfp-toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
}

.cidfp-toggle {
    position: relative;
    display: inline-block;
    width: 56px;
    height: 30px;
}

.cidfp-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cidfp-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 30px;
}

.cidfp-toggle-slider::before {
    content: '';
    position: absolute;
    height: 22px;
    width: 22px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.cidfp-toggle input:checked + .cidfp-toggle-slider {
    background-color: #46b450;
}

.cidfp-toggle input:checked + .cidfp-toggle-slider::before {
    transform: translateX(26px);
}

.cidfp-toggle input:focus + .cidfp-toggle-slider {
    box-shadow: 0 0 0 3px rgba(70, 180, 80, 0.2);
}

.cidfp-toggle-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.cidfp-toggle-description {
    margin-top: 5px;
    font-size: 13px;
}

/* ===== Page formulaire pleine largeur (sans sidebar - Porto) ===== */

/* Masquer sidebar */
.cidfp-survey-fullwidth .sidebar,
.cidfp-survey-fullwidth aside.sidebar,
.cidfp-survey-fullwidth #secondary {
    display: none !important;
}

/* Forcer le container Bootstrap en pleine largeur */
.cidfp-survey-fullwidth #main > .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Row et colonnes Porto en pleine largeur */
.cidfp-survey-fullwidth .main-content-wrap {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.cidfp-survey-fullwidth .main-content,
.cidfp-survey-fullwidth .main-content-wrap > [class*="col-"] {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    float: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* ===== Responsive ===== */
@media screen and (max-width: 768px) {
    .cidfp-survey-wrapper {
        padding: 20px;
    }

    .cidfp-survey-header h1 {
        font-size: 24px;
    }

    .cidfp-survey-header h2 {
        font-size: 20px;
    }

    .cidfp-progress-bar {
        padding: 0;
    }

    .cidfp-step-label {
        font-size: 12px;
    }

    .cidfp-step-number {
        width: 35px;
        height: 35px;
        line-height: 35px;
    }

    .cidfp-form-actions {
        flex-direction: column-reverse;
    }

    .cidfp-btn {
        width: 100%;
        justify-content: center;
    }

    .cidfp-star-label {
        font-size: 32px;
    }

    .cidfp-star-rating {
        gap: 2px;
    }
}
