/**
 * Russian Quiz Plugin - Frontend Styles
 */

/* Quiz Container */
.russian-quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Quiz Header */
.quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e1e5e9;
}

.quiz-title {
    color: #2c3e50;
    font-size: 28px;
    margin-bottom: 10px;
    font-weight: 600;
}

.quiz-description {
    color: #5a6c7d;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.quiz-timer {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 10px 15px;
    display: inline-block;
    font-weight: 500;
}

.timer-label {
    color: #856404;
    margin-right: 8px;
}

.timer-display {
    color: #d63031;
    font-weight: 700;
    font-size: 18px;
}

/* Quiz Questions */
.quiz-questions {
    margin-bottom: 30px;
}

.quiz-question {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    transition: box-shadow 0.3s ease;
}

.quiz-question:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.question-number {
    background: #007cba;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.question-difficulty {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.question-text h4 {
    color: #2c3e50;
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.question-content {
    color: #5a6c7d;
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Question Options */
.question-options {
    margin-top: 15px;
}

.option-item {
    margin-bottom: 12px;
    transition: background-color 0.2s ease;
}

.option-item label {
    display: flex;
    align-items: flex-start;
    padding: 12px 15px;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    line-height: 1.5;
}

.option-item label:hover {
    background: #f1f3f4;
    border-color: #007cba;
}

.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    margin-right: 12px;
    margin-top: 2px;
    transform: scale(1.2);
}

.option-item input[type="radio"]:checked + .option-text,
.option-item input[type="checkbox"]:checked + .option-text {
    font-weight: 600;
    color: #007cba;
}

.option-item label:has(input:checked) {
    background: #e3f2fd;
    border-color: #007cba;
}

.option-text {
    flex: 1;
}

/* User Information */
.quiz-user-info {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.quiz-user-info h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 18px;
}

.user-info-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.field-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #2c3e50;
}

.field-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s ease;
}

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

/* Quiz Submit */
.quiz-submit {
    text-align: center;
    padding-top: 20px;
    border-top: 2px solid #e1e5e9;
}

.quiz-submit-btn {
    background: #007cba;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quiz-submit-btn:hover {
    background: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.quiz-submit-btn:active {
    transform: translateY(0);
}

/* Quiz Results */
.russian-quiz-results {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.results-header {
    text-align: center;
    margin-bottom: 30px;
}

.results-header h2 {
    color: #2c3e50;
    font-size: 32px;
    margin-bottom: 10px;
}

.results-header h3 {
    color: #5a6c7d;
    font-size: 20px;
    font-weight: 400;
}

/* Results Summary */
.results-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

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

.score-main {
    font-size: 24px;
    margin-bottom: 10px;
}

.score-number,
.total-number {
    font-size: 36px;
    font-weight: 700;
}

.score-separator,
.score-label {
    font-size: 18px;
    margin: 0 8px;
}

.percentage-display {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 10px;
}

.cefr-level {
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    padding-top: 20px;
}

.level-label {
    font-size: 18px;
    margin-bottom: 5px;
}

.level-value {
    font-size: 32px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    display: inline-block;
}

/* Answer Breakdown */
.results-breakdown h3 {
    color: #2c3e50;
    font-size: 24px;
    margin-bottom: 20px;
    text-align: center;
}

.question-breakdown {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.question-breakdown.correct {
    border-left: 5px solid #28a745;
}

.question-breakdown.incorrect {
    border-left: 5px solid #dc3545;
}

.breakdown-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.breakdown-header .question-number {
    background: #6c757d;
}

.result-indicator {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.correct-icon {
    color: #28a745;
    font-size: 18px;
    margin-right: 5px;
}

.incorrect-icon {
    color: #dc3545;
    font-size: 18px;
    margin-right: 5px;
}

.question-breakdown .question-text {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
}

.question-breakdown .question-text h4 {
    margin-bottom: 10px;
}

.answer-options {
    padding: 15px 20px;
}

.option-breakdown {
    padding: 10px 15px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.option-breakdown.correct-answer {
    background: #d4edda;
    border-color: #28a745;
}

.option-breakdown.user-answer {
    background: #cce5ff;
    border-color: #007cba;
}

.option-breakdown.wrong-choice {
    background: #f8d7da;
    border-color: #dc3545;
}

.user-choice-indicator,
.correct-choice-indicator {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    margin-right: 8px;
    padding: 2px 6px;
    border-radius: 3px;
}

.user-choice-indicator {
    background: #007cba;
    color: white;
}

.correct-choice-indicator {
    background: #28a745;
    color: white;
}

.option-explanation {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    font-style: italic;
    font-size: 14px;
    color: #5a6c7d;
}

/* Results Actions */
.results-actions {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e1e5e9;
}

.results-actions .button {
    background: #007cba;
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.results-actions .button:hover {
    background: #005a87;
}

/* Error Messages */
.russian-quiz-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 20px 0;
}

/* Loading State */
.quiz-loading {
    text-align: center;
    padding: 40px;
    color: #5a6c7d;
}

.quiz-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .russian-quiz-container {
        padding: 15px;
        margin: 10px;
    }
    
    .quiz-title {
        font-size: 24px;
    }
    
    .user-info-fields {
        grid-template-columns: 1fr;
    }
    
    .question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .quiz-submit-btn {
        width: 100%;
        padding: 15px;
    }
    
    .score-main {
        font-size: 18px;
    }
    
    .score-number,
    .total-number {
        font-size: 28px;
    }
    
    .percentage-display {
        font-size: 36px;
    }
    
    .level-value {
        font-size: 24px;
    }
    
    .breakdown-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .quiz-question {
        padding: 15px;
    }
    
    .option-item label {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .quiz-user-info {
        padding: 15px;
    }
    
    .results-summary {
        padding: 20px;
    }
    
    .question-breakdown .question-text,
    .answer-options {
        padding: 15px;
    }
}
