/**
 * Super Quiz Pro - Frontend Styles (Mobile-First)
 */

/* CSS Variables for customization */
:root {
    --sqp-primary-color: #0073aa;
    --sqp-hover-color: #005a87;
    --sqp-secondary-color: #23282d;
    --sqp-text-color: #333;
    --sqp-bg-color: #f9f9f9;
    --sqp-border-radius: 8px;
    --sqp-transition: all 0.3s ease;
}

/* Container */
.sqp-quiz-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Progress Bar */
.sqp-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.sqp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sqp-primary-color) 0%, #00a0d2 100%);
    transition: width 0.5s ease;
    position: relative;
}

.sqp-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.sqp-progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    margin-top: 10px;
}

/* Question Card */
.sqp-question-card {
    background: #fff;
    border-radius: var(--sqp-border-radius);
    padding: 30px 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sqp-question-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--sqp-text-color);
    margin-bottom: 25px;
    line-height: 1.5;
    text-align: center;
}

.sqp-question-description {
    font-size: 14px;
    color: #666;
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    line-height: 1.6;
}

/* Answer Options */
.sqp-answers {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 25px;
}

.sqp-answer-option {
    position: relative;
}

.sqp-answer-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.sqp-answer-label {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: var(--sqp-border-radius);
    cursor: pointer;
    transition: var(--sqp-transition);
    font-size: 16px;
    font-weight: 500;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sqp-answer-label:hover {
    border-color: var(--sqp-primary-color);
    background: #f0f8ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.sqp-answer-option input:checked + .sqp-answer-label {
    background: var(--sqp-primary-color);
    border-color: var(--sqp-primary-color);
    color: #fff;
    transform: scale(1.02);
    box-shadow: 0 6px 12px rgba(0,115,170,0.3);
}

.sqp-answer-emoji {
    font-size: 28px;
    margin-right: 15px;
    min-width: 40px;
    text-align: center;
}

.sqp-answer-text {
    flex: 1;
}

/* Button Styles */
.sqp-button {
    display: block;
    width: 100%;
    padding: 16px 24px;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    color: #fff !important;
    background: var(--sqp-primary-color);
    border: none;
    border-radius: var(--sqp-border-radius);
    cursor: pointer;
    transition: var(--sqp-transition);
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.sqp-button:hover {
    background: var(--sqp-hover-color);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.sqp-button:active {
    transform: translateY(0);
}

.sqp-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Button Styles - Rounded */
.sqp-button-rounded {
    border-radius: 8px;
}

/* Button Styles - Square */
.sqp-button-square {
    border-radius: 0;
}

/* Button Styles - Pill */
.sqp-button-pill {
    border-radius: 50px;
}

/* Loading Screen */
.sqp-loading-screen {
    text-align: center;
    padding: 60px 20px;
}

.sqp-loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 30px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--sqp-primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.sqp-loading-message {
    font-size: 18px;
    color: var(--sqp-text-color);
    font-weight: 500;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Lead Capture Form */
.sqp-lead-capture {
    background: #fff;
    border-radius: var(--sqp-border-radius);
    padding: 30px 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.4s ease;
}

.sqp-lead-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--sqp-text-color);
    margin-bottom: 10px;
    text-align: center;
}

.sqp-lead-subtitle {
    font-size: 16px;
    color: #666;
    margin-bottom: 25px;
    text-align: center;
}

.sqp-form-group {
    margin-bottom: 20px;
}

.sqp-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--sqp-text-color);
    margin-bottom: 8px;
}

.sqp-form-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    transition: var(--sqp-transition);
    box-sizing: border-box;
}

.sqp-form-input:focus {
    outline: none;
    border-color: var(--sqp-primary-color);
    box-shadow: 0 0 0 3px rgba(0,115,170,0.1);
}

.sqp-form-input.error {
    border-color: #dc3232;
}

.sqp-checkbox-group {
    display: flex;
    align-items: flex-start;
    margin-bottom: 20px;
}

.sqp-checkbox-group input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.sqp-checkbox-label {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    cursor: pointer;
}

/* Result Screen */
.sqp-result {
    background: #fff;
    border-radius: var(--sqp-border-radius);
    padding: 40px 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.4s ease;
    text-align: center;
}

.sqp-result-score {
    font-size: 48px;
    font-weight: 700;
    color: var(--sqp-primary-color);
    margin-bottom: 20px;
}

.sqp-result-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--sqp-text-color);
    margin-bottom: 20px;
}

.sqp-result-content {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 30px;
    text-align: left;
}

.sqp-result-html {
    margin-top: 30px;
}

/* CTA Buttons in Result */
.sqp-result-cta {
    display: inline-block;
    padding: 14px 30px;
    margin: 10px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--sqp-primary-color);
    border-radius: var(--sqp-border-radius);
    text-decoration: none;
    transition: var(--sqp-transition);
}

.sqp-result-cta:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.sqp-result-cta-whatsapp {
    background: #25d366;
}

.sqp-result-cta-whatsapp:hover {
    background: #1da851;
}

/* Error Messages */
.sqp-error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
}

/* Tablet */
@media (min-width: 768px) {
    .sqp-quiz-container {
        padding: 40px 20px;
    }
    
    .sqp-question-card {
        padding: 40px 30px;
    }
    
    .sqp-question-text {
        font-size: 24px;
    }
    
    .sqp-answer-label {
        font-size: 18px;
        padding: 20px 24px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .sqp-quiz-container {
        max-width: 700px;
    }
    
    .sqp-result-cta {
        display: inline-block;
        width: auto;
    }
}

/* Accessibility */
.sqp-answer-label:focus-within {
    outline: 2px solid var(--sqp-primary-color);
    outline-offset: 2px;
}

/* Print */
@media print {
    .sqp-button,
    .sqp-progress-bar {
        display: none;
    }
}

/* Question Description - Separada da pergunta */
.sqp-question-description-wrapper {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    padding-top: 100px;
}

.sqp-question-description {
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

.sqp-question-description p {
    margin: 0 0 10px 0;
}

.sqp-question-description p:last-child {
    margin-bottom: 0;
}

/* Área para AdSense */
.sqp-question-ads {
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border: 1px dashed #ddd;
    border-radius: 6px;
    text-align: center;
    min-height: 90px;
}

/* Se o AdSense não carregar, não deixa espaço vazio */
.sqp-question-ads:empty {
    display: none;
}

/* Ocultar progress bar quando necessário */
.sqp-quiz-container[data-hide-progress="true"] .sqp-progress-bar,
.sqp-quiz-container[data-hide-progress="true"] .sqp-progress-text {
    display: none !important;
}

/* ===== DESCRIÇÃO DO QUIZ ===== */

.sqp-quiz-description-wrapper {
    margin-top: 30px;
    border-top: 1px solid #e0e0e0;
    padding-top: 25px;
}

.sqp-quiz-description-image {
    margin-bottom: 20px;
    text-align: center;
}

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

.sqp-quiz-description-content {
    font-size: 15px;
    line-height: 1.7;
    color: #555;
}

.sqp-quiz-description-content p {
    margin: 0 0 12px 0;
}

.sqp-quiz-description-content p:last-child {
    margin-bottom: 0;
}

/* ===== ÁREA DE ANÚNCIO ABAIXO DAS RESPOSTAS ===== */

.sqp-ads-below-answers {
    margin: 20px 0;
    text-align: center;
    min-height: 0;
}

.sqp-ads-below-answers:empty {
    display: none;
}

/* ===== BUTTON WRAPPER ===== */

.sqp-button-wrapper {
    margin-top: 10px;
}

/* ===== BUTTON LOADING ANIMATION ===== */

.sqp-button-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.sqp-button-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sqp-spin 0.6s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

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

/* Loading state for different button styles */
.sqp-button-loading.sqp-button-rounded {
    background: var(--sqp-primary-color, #0073aa);
}

.sqp-button-loading.sqp-button-square {
    background: var(--sqp-primary-color, #0073aa);
}

.sqp-button-loading.sqp-button-pill {
    background: var(--sqp-primary-color, #0073aa);
}