/**
 * PTE Listening Quiz - Frontend Styles
 */

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

.pte-quiz-form {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Question Block */
.pte-question {
    padding: 25px;
    border-bottom: 1px solid #e5e5e5;
}

.pte-question:last-of-type {
    border-bottom: none;
}

.pte-question-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.pte-question-number {
    background: #2196F3;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.pte-question-type-label {
    background: #f0f0f0;
    color: #666;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pte-question-points {
    color: #888;
    font-size: 13px;
    margin-left: auto;
}

.pte-question-content {
    margin-bottom: 20px;
}

.pte-question-title {
    font-size: 18px;
    color: #333;
    margin: 0 0 10px;
    font-weight: 500;
}

.pte-question-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Audio Player */
.pte-audio-player {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 15px 0;
}

.pte-audio-player audio {
    width: 100%;
    outline: none;
}

/* Answer Areas */
.pte-answer-area {
    margin-top: 15px;
}

/* Multiple Choice Options */
.pte-options-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pte-option {
    display: flex;
    align-items: flex-start;
    padding: 12px 15px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pte-option:hover {
    background: #e8f4fd;
    border-color: #90caf9;
}

.pte-option input[type="checkbox"],
.pte-option input[type="radio"] {
    margin-right: 12px;
    margin-top: 3px;
    flex-shrink: 0;
}

.pte-option-text {
    flex: 1;
    line-height: 1.5;
}

.pte-option.selected {
    background: #e3f2fd;
    border-color: #2196F3;
}

/* Fill in Blanks */
.pte-fill-blanks {
    line-height: 2.2;
    font-size: 16px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.pte-blank-input {
    width: 120px;
    padding: 5px 10px;
    margin: 0 5px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    text-align: center;
    background: #fff;
    transition: border-color 0.2s;
}

.pte-blank-input:focus {
    border-color: #2196F3;
    outline: none;
}

/* Summary and Dictation Fields */
.pte-summary-field,
.pte-dictation-field {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
}

.pte-summary-field label,
.pte-dictation-field label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
}

.pte-summary-textarea,
.pte-dictation-textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    box-sizing: border-box;
}

.pte-summary-textarea:focus,
.pte-dictation-textarea:focus {
    border-color: #2196F3;
    outline: none;
}

.pte-word-count {
    text-align: right;
    color: #888;
    font-size: 13px;
    margin-top: 8px;
}

.pte-word-count .word-count {
    font-weight: 600;
    color: #333;
}

/* Highlight Incorrect Words */
.pte-highlight-words {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 6px;
}

.pte-highlight-words .pte-instruction {
    margin-bottom: 15px;
    font-weight: 500;
    color: #555;
}

.pte-word-container {
    line-height: 2;
    font-size: 16px;
}

.pte-word {
    display: inline-block;
    padding: 3px 6px;
    margin: 2px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s ease;
    user-select: none;
}

.pte-word:hover {
    background: #e0e0e0;
}

.pte-word.highlighted {
    background: #bbdefb;
    color: #1565c0;
    font-weight: 500;
}

/* Submit Button */
.pte-quiz-submit {
    padding: 25px;
    text-align: center;
    border-top: 1px solid #e5e5e5;
}

.pte-submit-btn {
    background: #2196F3;
    color: #fff;
    border: none;
    padding: 14px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.pte-submit-btn:hover {
    background: #1976D2;
}

.pte-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Results Section */
.pte-quiz-results {
    margin-top: 30px;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.pte-quiz-results h3 {
    margin: 0 0 20px;
    text-align: center;
    font-size: 24px;
    color: #333;
}

.pte-score {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin-bottom: 25px;
}

.pte-score .score-value {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    display: block;
}

.pte-score .score-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 5px;
}

.pte-score .score-percentage {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 10px;
}

/* Feedback List */
.pte-feedback {
    margin-top: 20px;
}

.pte-feedback-item {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.pte-feedback-item.correct {
    background: #e8f5e9;
    border-left: 4px solid #4CAF50;
}

.pte-feedback-item.incorrect {
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.pte-feedback-item.partial {
    background: #fff3e0;
    border-left: 4px solid #ff9800;
}

.pte-feedback-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.pte-feedback-content {
    flex: 1;
}

.pte-feedback-question {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.pte-feedback-message {
    color: #666;
    font-size: 14px;
}

.pte-feedback-user-answer {
    color: #444;
    font-size: 14px;
    margin-bottom: 5px;
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    word-wrap: break-word;
}

.pte-feedback-points {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
}

.pte-feedback-item.correct .pte-feedback-points {
    color: #2e7d32;
}

.pte-feedback-item.incorrect .pte-feedback-points {
    color: #c62828;
}

.pte-feedback-item.partial .pte-feedback-points {
    color: #e65100;
}

/* Single Question Container */
.pte-question-single {
    max-width: 800px;
    margin: 20px auto;
}

.pte-question-single .pte-quiz-form {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 0;
}

.pte-question-result {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
}

.pte-question-result.success {
    background: #e8f5e9;
    border: 1px solid #4CAF50;
}

.pte-question-result.error {
    background: #ffebee;
    border: 1px solid #f44336;
}

/* Highlight Feedback Display */
.pte-highlight-feedback {
    padding: 15px;
    background: #fafafa;
    border-radius: 6px;
    line-height: 2.2;
    font-size: 16px;
    margin-top: 10px;
}

.pte-feedback-word {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

/* Green background for correctly selected words (user got it right) */
.pte-word-correct-selected {
    background-color: #c8e6c9;
    color: #1b5e20;
    font-weight: 500;
    padding-right: 24px;
}

/* Green background for words that should have been selected but weren't */
.pte-word-should-select {
    background-color: #a5d6a7;
    color: #2e7d32;
    border: 2px dashed #4caf50;
}

/* Red background for incorrectly selected words */
.pte-word-incorrect-selected {
    background-color: #ffcdd2;
    color: #c62828;
    font-weight: 500;
}

/* Checkmark icon for correctly selected words */
.pte-checkmark {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: #2e7d32;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 600px) {
    .pte-question {
        padding: 15px;
    }
    
    .pte-question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .pte-question-points {
        margin-left: 0;
    }
    
    .pte-blank-input {
        width: 80px;
    }
    
    .pte-submit-btn {
        width: 100%;
        padding: 15px 20px;
    }
    
    .pte-score .score-value {
        font-size: 36px;
    }
    
    .pte-highlight-feedback {
        font-size: 14px;
        line-height: 2;
    }
    
    .pte-feedback-word {
        padding: 3px 6px;
        margin: 1px;
    }
}
