/* Quiz Quakfy Frontend Styles */

/* Fontes otimizadas para todos os navegadores */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Roboto:wght@400;500;700&family=Open+Sans:wght@400;600;700&family=Lato:wght@400;700&family=Poppins:wght@400;500;600;700&display=swap');

/* Radio buttons e checkboxes personalizados */
input[type="radio"], input[type="checkbox"] {
    accent-color: #D41A37;
    width: 18px;
    height: 18px;
}

/* Estilos para os novos tipos de resposta */
.quiz-response-item {
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Resposta Única (Sem Radio Button) */
.quiz-response-item.single-no-radio:hover {
    border-color: #FD2B4C !important;
}

.quiz-response-item.single-no-radio.selected {
    background-color: #FD2B4C !important;
    border-color: #FD2B4C !important;
}

.quiz-response-item.single-no-radio.selected .quiz-response-text {
    color: white !important;
}

/* Resposta Única (Com Radio Button) */
.quiz-response-item.single-radio .quiz-radio-input {
    accent-color: #FD2B4C;
    width: 18px;
    height: 18px;
}

.quiz-response-item.single-radio:hover {
    border-color: #FD2B4C !important;
}

/* Múltipla Resposta (Sem Radio Button) */
.quiz-response-item.multiple-no-radio:hover {
    border-color: #FA5655 !important;
}

.quiz-response-item.multiple-no-radio.selected {
    background-color: #FA5655 !important;
    border-color: #FA5655 !important;
}

.quiz-response-item.multiple-no-radio.selected .quiz-response-text {
    color: white !important;
}

/* Grade 2x2 com novos tipos */
.quiz-response-grid.single-radio .quiz-radio-input {
    position: absolute;
    top: 10px;
    right: 10px;
    accent-color: #FD2B4C;
    width: 18px;
    height: 18px;
}

.quiz-response-grid.single-no-radio.selected,
.quiz-response-grid.multiple-no-radio.selected {
    border-color: #FA5655 !important;
}

.quiz-response-grid.single-no-radio.selected .quiz-grid-text,
.quiz-response-grid.multiple-no-radio.selected .quiz-grid-text {
    background-color: #FA5655 !important;
}

/* Alinhamento individual das perguntas */
.quiz-question-align-left .quiz-question-title,
.quiz-question-align-left .quiz-question-description {
    text-align: left;
}

.quiz-question-align-center .quiz-question-title,
.quiz-question-align-center .quiz-question-description {
    text-align: center;
}

.quiz-question-align-center .quiz-question-description {
    margin-left: auto;
    margin-right: auto;
    max-width: 80%;
}

.quiz-question-align-right .quiz-question-title,
.quiz-question-align-right .quiz-question-description {
    text-align: right;
}

/* Compatibilidade com configuração global (fallback) */
.quiz-questions-centered .quiz-question-title,
.quiz-questions-centered .quiz-question-description {
    text-align: center;
}

.quiz-questions-centered .quiz-question-description {
    margin-left: auto;
    margin-right: auto;
    max-width: 80%;
}

/* Texto explicativo das perguntas - sem borda */
.quiz-question-description {
    margin-bottom: 20px;
    color: #555;
    line-height: 1.6;
    font-size: 14px;
}

/* Estilos das perguntas */
.quiz-question {
    margin-bottom: 30px;
}

.quiz-question-title {
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

/* Estilos das respostas */
.quiz-response-option {
    display: flex;
    align-items: center;
    padding: 15px;
    background: white;
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    transition: all 0.2s ease;
}

.quiz-response-option:hover {
    border-color: #FA5655;
}

.quiz-response-option.selected {
    background-color: #FA5655;
    border-color: #FD2B4C;
    color: white;
}

.quiz-response-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
}

.quiz-response-text {
    flex: 1;
    color: inherit;
    font-size: 16px;
}

/* Grade 2x2 */
.quiz-response-grid {
    margin-bottom: 15px;
    cursor: pointer;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 15px;
    background: white;
    transition: all 0.2s ease;
}

.quiz-response-grid:hover {
    border-color: #FA5655;
}

.quiz-response-grid.selected {
    border-color: #FD2B4C;
}

.quiz-grid-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.quiz-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.quiz-grid-images img {
    width: 100%;
    max-width: 172px;
    height: 172px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 8px;
}

.quiz-grid-item-text {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    line-height: 1.3;
    word-wrap: break-word;
}

.quiz-grid-placeholder {
    width: 100%;
    max-width: 172px;
    height: 172px;
    background-color: #f5f5f5;
    border: 2px dashed #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
    margin-bottom: 8px;
}

.quiz-grid-placeholder {
    width: 100%;
    max-width: 172px;
    height: 172px;
    background: #ddd;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
}

.quiz-grid-text {
    background: #FD2B4C;
    color: white;
    padding: 10px;
    text-align: center;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-weight: 600;
}

.quiz-quakfy-container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    position: relative;
}

/* Container da barra de progresso - largura total 1140px */
.quiz-progress-wrapper {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Container do body - largura 540px */
.quiz-body-container {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Influencer (Layout conforme imagem enviada - João Gomes) */
.quiz-influencer {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
    padding: 0;
    background: transparent;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
}

/* Foto do perfil com bolinha online */
.quiz-influencer img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-right: 15px;
    flex-shrink: 0;
}

/* Bolinha verde (online) - posição exata da imagem */
.quiz-influencer-online {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    background: #4CAF50;
    border: 2px solid white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Informações do perfil */
.quiz-influencer > div:last-child {
    flex: 1;
    min-width: 0;
}

/* Nome + Selo de verificação (linha 1) */
.quiz-influencer-name {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
    font-weight: 700;
    color: #000;
    font-size: 18px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.quiz-influencer-name svg,
.quiz-influencer-name img {
    width: 18px;
    height: 18px;
    margin-left: 6px;
    opacity: 0.7;
}

/* @username (linha 2) */
.quiz-influencer-username {
    color: #666;
    font-size: 15px;
    margin-bottom: 2px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Seguidores (linha 3) */
.quiz-influencer-followers {
    color: #666;
    font-size: 15px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Compatibilidade com classes antigas (deprecated) */
.quiz-influencer-profile,
.quiz-influencer-image-wrapper,
.quiz-influencer-image,
.quiz-influencer-info {
    /* Manter para compatibilidade, mas usar inline styles no template */
    font-size: 12px;
    margin-bottom: 8px;
}

.quiz-influencer-verification {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.quiz-influencer-verification-badge {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* Barra de Progresso - Especificações PRD */
.quiz-progress-container {
    width: 100%;
    max-width: 1140px;
    margin: 0 auto 30px auto;
    padding: 0 20px;
    box-sizing: border-box;
    position: relative;
}

.quiz-progress-bar {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f0f0f0;
    position: relative;
}

.quiz-progress-fill {
    height: 100%;
    background-color: #FD2B4C;
    transition: width 0.3s ease;
    border-radius: 4px;
    position: relative;
}

/* Customização da barra de progresso */
.quiz-progress-bar.custom-radius {
    border-radius: var(--progress-radius, 4px);
}

.quiz-progress-bar.custom-height {
    height: var(--progress-height, 8px);
}

.quiz-progress-fill.custom-color {
    background-color: var(--progress-color, #FD2B4C);
}

/* Título */
.quiz-title {
    margin-bottom: 20px;
    line-height: 1.4;
}

/* Imagem */
.quiz-image-container {
    text-align: center;
    margin-bottom: 20px;
}

.quiz-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Campo Vídeo - Especificações PRD */
.quiz-video-container {
    width: 353px;
    height: 529px;
    margin: 0 auto 20px auto;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.quiz-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Contador de visualizações ao vivo */
.quiz-video-live-counter {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(106, 110, 109, 0.9);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 10;
}

.quiz-video-live-dot {
    width: 8px;
    height: 8px;
    background: #ff0000;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Sistema de comentários */
.quiz-video-comments {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 200px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    padding: 20px 15px 15px;
    overflow-y: auto;
    z-index: 5;
}

.quiz-video-comment {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.quiz-video-comment:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.quiz-video-comment-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.quiz-video-comment-content {
    flex: 1;
    min-width: 0;
}

.quiz-video-comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.quiz-video-comment-name {
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
}

.quiz-video-comment-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 10px;
}

.quiz-video-comment-heart {
    width: 12px;
    height: 12px;
    cursor: pointer;
    margin-left: auto;
}

.quiz-video-comment-heart.liked {
    color: #ff0000;
}

.quiz-video-comment-text {
    color: rgba(255, 255, 255, 0.9);
    font-size: 11px;
    line-height: 1.3;
    word-wrap: break-word;
}

.quiz-video-comment-reply {
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    margin-top: 4px;
    cursor: pointer;
    text-decoration: underline;
}

.quiz-video-comment-reply:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* Texto */
.quiz-text {
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Campo de Carregamento - Especificações PRD */
.quiz-loading {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: 40px 20px;
    text-align: center;
    box-sizing: border-box;
}

.quiz-loading-text {
    margin-bottom: 20px;
    font-size: 16px;
    color: #333;
}

.quiz-loading-progress-container {
    width: 100%;
    margin-bottom: 15px;
    position: relative;
}

.quiz-loading-progress-bar {
    width: 100%;
    height: 12px;
    background: #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.quiz-loading-progress-fill {
    height: 100%;
    background: #FD2B4C;
    border-radius: 6px;
    transition: width 0.3s ease;
    position: relative;
}

/* Customização da barra de carregamento */
.quiz-loading-progress-bar.custom-color {
    background: var(--loading-bg-color, #f0f0f0);
}

.quiz-loading-progress-fill.custom-color {
    background: var(--loading-fill-color, #FD2B4C);
}

.quiz-loading-progress-bar.custom-radius {
    border-radius: var(--loading-radius, 6px);
}

.quiz-loading-progress-fill.custom-radius {
    border-radius: var(--loading-radius, 6px);
}

.quiz-loading-progress-bar.custom-height {
    height: var(--loading-height, 12px);
}

.quiz-loading-percentage {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-top: 8px;
}

/* Spinner alternativo */
.quiz-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #FD2B4C;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Campo de Avaliação - Especificações PRD */
.quiz-evaluation {
    width: 100%;
    max-width: 540px;
    margin: 0 auto 20px auto;
    padding: 30px 20px;
    text-align: center;
    box-sizing: border-box;
    background: #ffffff;
    border-radius: 8px;
}

.quiz-evaluation-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

/* Números de 1 a 5 */
.quiz-evaluation-numbers {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.quiz-evaluation-number {
    width: 50px;
    height: 50px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quiz-evaluation-number:hover {
    border-color: #FD2B4C;
    background: rgba(253, 43, 76, 0.05);
    color: #FD2B4C;
}

.quiz-evaluation-number.selected {
    border-color: #FD2B4C;
    background: #FD2B4C;
    color: #ffffff;
}

/* Barra colorida com labels */
.quiz-evaluation-bar-container {
    width: 100%;
    margin-top: 20px;
}

.quiz-evaluation-bar {
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, #ff6b6b, #feca57, #48dbfb, #0abde3, #00d2d3);
    border-radius: 4px;
    margin-bottom: 10px;
}

.quiz-evaluation-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quiz-evaluation-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

.quiz-evaluation-label.left {
    text-align: left;
}

.quiz-evaluation-label.right {
    text-align: right;
}

/* Respostas - Especificações PRD */
.quiz-responses {
    width: 100%;
    max-width: 540px;
    margin: 0 auto 20px auto;
    padding: 0 20px;
    box-sizing: border-box;
    display: grid;
    gap: 15px;
}

/* Formato padrão - texto */
.quiz-responses.format-text {
    display: grid;
    gap: 15px;
}

/* Formato ícone + texto */
.quiz-responses.format-icon-text {
    display: grid;
    gap: 15px;
}

/* Formato grade 2x2 */
.quiz-responses.format-grid-2x2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* Formato grade 2x2 imagens */
.quiz-responses.format-grid-2x2-image {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.quiz-response-btn {
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    position: relative;
}

/* Radio button no lado direito */
.quiz-response-btn::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    background: #ffffff;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.3s ease;
}

.quiz-response-btn.selected::after {
    background: #FD2B4C;
    border-color: #FD2B4C;
    box-shadow: inset 0 0 0 4px #ffffff;
}

/* Resposta com ícone */
.quiz-response-btn.has-icon {
    justify-content: flex-start;
    gap: 12px;
}

.quiz-response-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.quiz-response-text {
    flex: 1;
    text-align: left;
}

/* Grade 2x2 com imagens */
.quiz-response-btn.grid-image {
    flex-direction: column;
    padding: 0;
    border-radius: 5px;
    overflow: hidden;
    min-height: auto;
}

.quiz-response-image {
    width: 172px;
    height: 172px;
    object-fit: cover;
    border-radius: 5px 5px 0 0;
}

.quiz-response-image-text {
    width: 100%;
    height: 39px;
    background: #FD2B4C;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

.quiz-response-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #FD2B4C;
}

.quiz-response-btn:focus {
    outline: 2px solid #FD2B4C;
    outline-offset: 2px;
}

.quiz-response-btn.selected {
    border-color: #FD2B4C;
    background: rgba(253, 43, 76, 0.05);
}

/* Formulário */
.quiz-form {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.quiz-form-field {
    margin-bottom: 15px;
}

.quiz-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.quiz-form-field input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.quiz-form-field input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.quiz-form-submit {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.quiz-form-submit:hover {
    background: #005a87;
}

/* Botão Continuar */
.quiz-continue-container {
    text-align: center;
    margin-top: 30px;
}

.quiz-continue-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.quiz-continue-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.quiz-continue-btn:focus {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

.quiz-continue-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Estados ocultos */
.quiz-hidden {
    display: none !important;
}

/* Responsividade */
@media (max-width: 768px) {
    .quiz-quakfy-container {
        padding: 15px;
        margin: 10px;
    }
    
    .quiz-title {
        font-size: 20px !important;
    }
    
    .quiz-text {
        font-size: 14px !important;
    }
    
    .quiz-response-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
    
    .quiz-continue-btn {
        padding: 12px 30px;
        font-size: 16px;
        min-width: 150px;
    }
    
    .quiz-influencer {
        flex-direction: column;
        text-align: center;
    }
    
    .quiz-influencer-image {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .quiz-influencer-right .quiz-influencer-image {
        margin-left: 0;
        margin-bottom: 10px;
        order: 0;
    }
}

@media (max-width: 480px) {
    .quiz-quakfy-container {
        padding: 10px;
        margin: 5px;
    }
    
    .quiz-responses {
        gap: 10px;
    }
    
    .quiz-response-btn {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 45px;
    }
    
    .quiz-form-field input {
        padding: 10px;
        font-size: 14px;
    }
    
    .quiz-continue-btn {
        padding: 10px 25px;
        font-size: 14px;
        min-width: 120px;
    }
}
