/* ============================================
   COMCMS Surveys - Public Styles
   ============================================ */

/* Survey Wrapper */
.comcms-survey-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Progress Bar */
.comcms-survey-progress {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 10px;
    margin-bottom: 30px;
    overflow: hidden;
}

.comcms-survey-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #4a9fd8);
    transition: width 0.3s ease;
}

/* Survey Title & Description */
.comcms-survey-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.comcms-survey-description {
    font-size: 16px;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Fields Container */
.comcms-survey-fields {
    margin-bottom: 30px;
}

/* Individual Field */
.comcms-survey-field {
    margin-bottom: 25px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
    transition: all 0.3s;
}

.comcms-survey-field:hover {
    background: #f5f5f5;
}

.comcms-survey-field.comcms-field-hidden {
    display: none;
}

.comcms-field-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.comcms-required-mark {
    color: #d63638;
    margin-left: 3px;
}

/* Input Fields */
.comcms-field-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.comcms-field-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.comcms-input-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Radio & Checkbox */
.comcms-radio-label,
.comcms-checkbox-label {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    cursor: pointer;
    border-radius: 5px;
    transition: background 0.3s;
}

.comcms-radio-label:hover,
.comcms-checkbox-label:hover {
    background: #fff;
}

.comcms-radio-label input,
.comcms-checkbox-label input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* ============================================
   GRID LAYOUT (MATRIZ) - COMO NA SUA IMAGEM
   ============================================ */

.comcms-grid-field {
    overflow-x: auto;
}

.comcms-grid-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.comcms-grid-table thead th {
    padding: 15px 10px;
    text-align: center;
    background: #f9f9f9;
    border-bottom: 2px solid #ddd;
    font-weight: 600;
    font-size: 14px;
}

.comcms-grid-label-col {
    text-align: left !important;
    min-width: 200px;
}

.comcms-grid-option-col {
    min-width: 120px;
}

.comcms-grid-option-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.comcms-grid-icon {
    font-size: 24px;
}

/* Emojis para satisfação */
.comcms-grid-option-label .emoji-muito-satisfeito:before { content: "😊"; }
.comcms-grid-option-label .emoji-satisfeito:before { content: "🙂"; }
.comcms-grid-option-label .emoji-neutro:before { content: "😐"; }
.comcms-grid-option-label .emoji-insatisfeito:before { content: "😕"; }
.comcms-grid-option-label .emoji-muito-insatisfeito:before { content: "😞"; }

.comcms-grid-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
}

.comcms-grid-table tbody tr:hover {
    background: #fafafa;
}

.comcms-grid-row-label {
    padding: 15px;
    font-weight: 500;
    color: #333;
    text-align: left;
}

.comcms-grid-cell {
    padding: 15px;
    text-align: center;
    vertical-align: middle;
}

.comcms-grid-radio-label {
    display: inline-block;
    position: relative;
    cursor: pointer;
}

.comcms-grid-input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.comcms-radio-custom {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 2px solid #ddd;
    border-radius: 50%;
    background: #fff;
    transition: all 0.3s;
    position: relative;
}

.comcms-grid-input:checked ~ .comcms-radio-custom {
    border-color: #2271b1;
    background: #2271b1;
}

.comcms-grid-input:checked ~ .comcms-radio-custom:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
}

.comcms-grid-radio-label:hover .comcms-radio-custom {
    border-color: #2271b1;
    box-shadow: 0 0 0 4px rgba(34, 113, 177, 0.1);
}

/* Rating (Estrelas) */
.comcms-rating-input {
    display: flex;
    gap: 5px;
    flex-direction: row-reverse;
    justify-content: flex-end;
}

.comcms-rating-star {
    cursor: pointer;
    position: relative;
}

.comcms-rating-star input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.comcms-rating-star .star {
    font-size: 36px;
    color: #ddd;
    transition: color 0.3s;
}

.comcms-rating-star:hover .star,
.comcms-rating-star:hover ~ .comcms-rating-star .star {
    color: #ffc107;
}

.comcms-rating-star input:checked ~ .star,
.comcms-rating-star input:checked ~ .comcms-rating-star .star {
    color: #ffc107;
}

/* Scale (Escala Linear) */
.comcms-scale-input {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.comcms-scale-option {
    cursor: pointer;
}

.comcms-scale-option input {
    position: absolute;
    opacity: 0;
}

.comcms-scale-option span {
    display: inline-block;
    min-width: 40px;
    padding: 10px;
    text-align: center;
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 5px;
    transition: all 0.3s;
}

.comcms-scale-option:hover span {
    background: #e0e0e0;
}

.comcms-scale-option input:checked + span {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
}

/* Field Error */
.comcms-field-error {
    color: #d63638;
    font-size: 13px;
    margin-top: 5px;
}

.comcms-survey-field.has-error {
    border: 2px solid #d63638;
}

/* Messages */
.comcms-survey-messages {
    margin-bottom: 20px;
}

.comcms-survey-error,
.comcms-survey-success {
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.comcms-survey-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.comcms-survey-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Submit Button */
.comcms-survey-actions {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.comcms-survey-submit {
    padding: 15px 40px;
    background: linear-gradient(135deg, #2271b1, #4a9fd8);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.comcms-survey-submit:hover {
    background: linear-gradient(135deg, #135e96, #2271b1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.comcms-survey-submit:active {
    transform: translateY(0);
}

.comcms-survey-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Loading State */
.comcms-survey-form.loading {
    opacity: 0.6;
    pointer-events: none;
}

.comcms-survey-form.loading .comcms-survey-submit:after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .comcms-survey-wrapper {
        padding: 15px;
    }
    
    .comcms-survey-title {
        font-size: 22px;
    }
    
    .comcms-grid-table {
        font-size: 13px;
    }
    
    .comcms-grid-option-col {
        min-width: 80px;
    }
    
    .comcms-grid-row-label {
        font-size: 14px;
    }
    
    .comcms-rating-star .star {
        font-size: 28px;
    }
    
    .comcms-scale-option span {
        min-width: 35px;
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .comcms-grid-label-col {
        min-width: 150px;
    }
    
    .comcms-grid-option-col {
        min-width: 60px;
    }
    
    .comcms-grid-option-label {
        font-size: 11px;
    }
}
