
/* ==========================================================================
   Quiz Plugin Frontend Styles
   ========================================================================== */

/**
 * Table of Contents:
 *
 * 1. Base Container Styles
 * 2. Header Styles
 * 3. Quiz Steps Common Styles
 * 4. User Data Form
 * 5. Questions Step
 * 6. Progress Bar
 * 7. Question Display
 * 8. Answer Options
 * 9. Navigation Controls
 * 10. Results Display
 * 11. Animations
 * 12. Media Queries
 */

/* 1. Base Container Styles
   ========================================================================== */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* 2. Header Styles
   ========================================================================== */
.quiz-header {
    margin-bottom: 30px;
    text-align: center;
}

.quiz-description {
    color: #555;
    margin-top: 10px;
}

/* 3. Quiz Steps Common Styles
   ========================================================================== */
.quiz-step {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 4. User Data Form
   ========================================================================== */
.user-data-step .form-field {
    margin-bottom: 20px;
}

.user-data-step label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.user-data-step input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* 5. Questions Step
   ========================================================================== */
.questions-step {
    /* Base styles for the questions step */
}

/* 6. Progress Bar
   ========================================================================== */
.quiz-progress {
    margin-bottom: 30px;
}

.quiz-progress-bar {
    height: 8px;
    background: #eee;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.quiz-progress-fill {
    height: 100%;
    background: #4CAF50;
    transition: width 0.3s ease;
}

.quiz-progress-text {
    text-align: right;
    font-size: 14px;
    color: #666;
}

/* 7. Question Display
   ========================================================================== */
.quiz-question {
    margin-bottom: 30px;
}

.question-text {
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 500;
}

.question-image {
    text-align: center;
    margin-bottom: 20px;
}

.question-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

/* 8. Answer Options
   ========================================================================== */
.question-options {
    margin-bottom: 20px;
}

.question-option {
    padding: 10px 15px;
    margin-bottom: 10px;
    background: #f9f9f9;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.question-option:hover {
    background: #f0f0f0;
}

.question-option input {
    margin-right: 10px;
}

/* Open-ended questions */
.question-open-answer textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

/* 9. Navigation Controls
   ========================================================================== */
.quiz-navigation {
    margin-top: 30px;
    display: flex;
    justify-content: space-between;
}

.button {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.button:hover {
    background: #45a049;
}

.button:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* 10. Results Display
   ========================================================================== */
/* Loading state */
.loading-results {
    text-align: center;
    padding: 30px 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4CAF50;
    border-radius: 50%;
    margin: 20px auto;
    animation: spin 1s linear infinite;
}

.quiz-results {
    text-align: center;
}

/* Profile result */
.result-profile {
    margin-bottom: 30px;
}

.profile-name {
    color: #4CAF50;
}

.profile-description {
    margin-top: 10px;
    color: #555;
}

/* Score display */
.result-score {
    margin-bottom: 30px;
}

.score-container {
    font-size: 48px;
    font-weight: bold;
    color: #4CAF50;
}

.score-value {
    display: inline-block;
}

.score-max {
    display: inline-block;
    color: #999;
    font-size: 32px;
}

.score-label {
    color: #666;
}

/* Group scores */
.group-scores {
    margin-top: 40px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.group-score {
    margin-bottom: 20px;
}

.group-title {
    font-weight: bold;
    margin-bottom: 5px;
}

.group-score-bar {
    height: 20px;
    background: #eee;
    border-radius: 10px;
    overflow: hidden;
}

.group-score-fill {
    height: 100%;
    background: #4CAF50;
}

.group-score-text {
    text-align: right;
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* 11. Animations
   ========================================================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 12. Media Queries
   ========================================================================== */
@media (max-width: 768px) {
    .quiz-step {
        padding: 20px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .quiz-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    .button {
        width: 100%;
    }
}
