/* Quiz2 Plugin Styles */

.quiz2-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: Arial, sans-serif;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.quiz2-section {
    margin-bottom: 30px;
}

.quiz2-section h3 {
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

/* User Info Form */
.quiz2-field {
    margin-bottom: 15px;
}

.quiz2-field label {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.quiz2-field input {
    width: 100%;
    max-width: 400px;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.quiz2-field input:focus {
    border-color: #0073aa;
    outline: none;
}

/* Timer */
.quiz2-timer {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #ff4444;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 18px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.quiz2-timer.warning {
    background: #ff8800;
    animation: shake 0.5s infinite;
}

.quiz2-timer.critical {
    background: #cc0000;
    animation: shake 0.2s infinite;
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
    75% { transform: translateX(-5px); }
    100% { transform: translateX(0); }
}

/* Questions */
.quiz2-question {
    background: #f9f9f9;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.quiz2-question h4 {
    color: #0073aa;
    margin: 0 0 10px 0;
    font-size: 18px;
}

.quiz2-question-text {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 15px;
    color: #333;
}

/* Options */
.quiz2-option {
    display: block;
    margin-bottom: 10px;
    padding: 10px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    user-select: none;
}

.quiz2-option:hover {
    background: #f0f8ff;
    border-color: #0073aa;
}

.quiz2-option input[type="radio"] {
    margin-right: 10px;
}

.quiz2-option input[type="radio"]:checked + span,
.quiz2-option:has(input[type="radio"]:checked) {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Text Inputs */
.quiz2-text-input,
.quiz2-number-input {
    width: 100%;
    max-width: 400px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.quiz2-text-input:focus,
.quiz2-number-input:focus {
    border-color: #0073aa;
    outline: none;
}


/* Buttons */
.quiz2-btn {
    background: #0073aa;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.quiz2-btn:hover {
    background: #005a87;
}

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

/* 8-bit Character */
.quiz2-character {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    max-width: 200px;
}

.character-sprite {
    width: 64px;
    height: 64px;
    background: #4CAF50;
    border-radius: 8px;
    position: relative;
    margin: 0 auto 10px;
    background-image: 
        linear-gradient(45deg, #4CAF50 25%, transparent 25%),
        linear-gradient(-45deg, #4CAF50 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #4CAF50 75%),
        linear-gradient(-45deg, transparent 75%, #4CAF50 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
}

.character-sprite:before {
    content: '';
    position: absolute;
    top: 15px;
    left: 20px;
    width: 8px;
    height: 8px;
    background: #333;
    border-radius: 50%;
    box-shadow: 16px 0 0 #333;
}

.character-sprite:after {
    content: '';
    position: absolute;
    top: 35px;
    left: 25px;
    width: 14px;
    height: 4px;
    background: #333;
    border-radius: 2px;
}

.character-sprite.dancing {
    animation: dance 1s ease-in-out infinite alternate;
}

@keyframes dance {
    0% { transform: translateY(0) rotate(-2deg); }
    100% { transform: translateY(-8px) rotate(2deg); }
}

.character-sprite.celebration {
    animation: celebrate 0.5s ease-in-out infinite;
    background: #FFD700;
}

@keyframes celebrate {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(10deg); }
}

.character-speech {
    text-align: center;
    font-size: 14px;
    color: #333;
    font-weight: bold;
    background: #f0f8ff;
    padding: 8px;
    border-radius: 15px;
    border: 2px solid #0073aa;
    position: relative;
}

.character-speech:before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #0073aa;
}

.character-speech:after {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #f0f8ff;
}

/* Results */
.quiz2-results-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.results-character {
    margin-bottom: 20px;
}

.results-character .character-sprite {
    position: relative;
    margin: 0 auto;
}

.character-message {
    font-size: 18px;
    color: #0073aa;
    font-weight: bold;
    margin-top: 15px;
    background: #f0f8ff;
    padding: 10px 20px;
    border-radius: 20px;
    display: inline-block;
}

.quiz2-score-display {
    text-align: center;
    padding: 30px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    border-radius: 15px;
    border: 3px solid #0073aa;
    box-shadow: 0 8px 32px rgba(0,115,170,0.2);
    margin-bottom: 30px;
}

.quiz2-score-main h4 {
    font-size: 28px;
    color: #0073aa;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.quiz2-score-main .score {
    font-size: 56px;
    font-weight: bold;
    color: #333;
    margin: 25px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.quiz2-score-main .percentage {
    font-size: 36px;
    color: #0073aa;
    font-weight: bold;
}

/* Copy Protection */
.quiz2-container {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
}

.quiz2-container * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text input fields to be selectable */
.quiz2-text-input,
.quiz2-number-input,
.quiz2-field input {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Admin Styles */
.option-row {
    margin-bottom: 10px;
}

.option-row strong {
    display: inline-block;
    width: 30px;
}

.option-row input {
    margin-left: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .quiz2-container {
        margin: 10px;
        padding: 15px;
    }
    
    .quiz2-timer {
        position: relative;
        top: 0;
        right: 0;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .quiz2-field input,
    .quiz2-text-input,
    .quiz2-number-input {
        max-width: 100%;
    }
    
    .quiz2-option {
        padding: 15px;
    }
    
    .quiz2-question {
        padding: 15px;
    }
    
    .quiz2-score-display .score {
        font-size: 36px;
    }
    
    .quiz2-score-display .percentage {
        font-size: 24px;
    }
}

/* Loading Animation */
.quiz2-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Detailed Report Styles */
.quiz2-detailed-report {
    margin-top: 30px;
}

.report-section {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border: 2px solid #e0e0e0;
}

.report-section h4 {
    color: #0073aa;
    margin-bottom: 20px;
    font-size: 22px;
    text-align: center;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.report-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 2px solid #dee2e6;
    transition: transform 0.3s ease;
}

.report-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.report-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.report-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

.report-value {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
}

.performance-analysis {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    border: 2px solid #dee2e6;
}

.performance-analysis h5 {
    color: #0073aa;
    margin-bottom: 15px;
    font-size: 18px;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745 0%, #20c997 50%, #17a2b8 100%);
    transition: width 2s ease-in-out;
    border-radius: 10px;
}

.performance-text {
    font-size: 16px;
    color: #495057;
    line-height: 1.6;
}

.certificate-section {
    text-align: center;
}

.certificate {
    background: linear-gradient(135deg, #fff8e1 0%, #fffbf0 100%);
    border: 3px solid #ffa000;
    border-radius: 15px;
    padding: 30px;
    display: inline-block;
    max-width: 400px;
    position: relative;
    box-shadow: 0 8px 32px rgba(255,160,0,0.2);
}

.certificate:before {
    content: '';
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    bottom: 15px;
    border: 2px solid #ffa000;
    border-radius: 8px;
}

.certificate h5 {
    color: #e65100;
    margin-bottom: 20px;
    font-size: 20px;
}

.certificate-content p {
    margin: 10px 0;
    color: #5d4037;
    font-size: 16px;
}

.certificate-content p:first-child {
    font-size: 22px;
    font-weight: bold;
    color: #e65100;
}

/* Score Performance Colors */
.score.excellent {
    color: #28a745;
}

.score.good {
    color: #17a2b8;
}

.score.fair {
    color: #ffc107;
}

.score.poor {
    color: #dc3545;
}

/* Warning Messages */
.quiz2-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.quiz2-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.quiz2-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}