/* Simple Quiz System - Public Quiz Styles */

/* ==========================================
   GENERAL CONTAINER
   ========================================== */

.sqs-quiz-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sqs-quiz-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f1;
}

.sqs-quiz-header h2 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 32px;
}

.sqs-quiz-instructions {
    background: #f0f0f1;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
    line-height: 1.6;
    text-align: left;
}

/* ==========================================
   QUIZ INFO & META
   ========================================== */

.sqs-quiz-info, .sqs-quiz-meta {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.sqs-info-item, .sqs-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #666;
}

.sqs-info-item .dashicons, .sqs-meta-item .dashicons {
    color: #2271b1;
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* ==========================================
   STUDENT FORM
   ========================================== */

.sqs-student-form {
    margin-top: 30px;
}

.sqs-student-form h3 {
    margin-bottom: 20px;
    color: #333;
}

.sqs-form-group {
    margin-bottom: 20px;
}

.sqs-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.sqs-form-group .required {
    color: #d63638;
}

.sqs-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.sqs-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

/* ==========================================
   BUTTONS
   ========================================== */

.sqs-button {
    padding: 12px 24px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.sqs-button .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.sqs-button-primary {
    background: #2271b1;
    color: #fff;
}

.sqs-button-primary:hover:not(:disabled) {
    background: #135e96;
}

.sqs-button-secondary {
    background: #f0f0f1;
    color: #333;
}

.sqs-button-secondary:hover:not(:disabled) {
    background: #dcdcde;
}

.sqs-button-large {
    padding: 15px 30px;
    font-size: 18px;
}

.sqs-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.sqs-form-actions {
    text-align: center;
    margin-top: 30px;
}

/* ==========================================
   PROGRESS BAR
   ========================================== */

.sqs-progress-container {
    margin: 30px 0;
}

.sqs-progress-bar {
    width: 100%;
    height: 30px;
    background: #f0f0f1;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.sqs-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2271b1, #135e96);
    transition: width 0.3s ease;
    border-radius: 15px;
}

.sqs-progress-text {
    text-align: center;
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

/* ==========================================
   TIMER
   ========================================== */

.sqs-timer-container {
    background: #f0f0f1;
    padding: 15px 20px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.sqs-timer-container .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #2271b1;
}

#sqs-timer-display {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    font-family: monospace;
}

.sqs-timer-container.warning {
    background: #fcf0f1;
    border: 2px solid #f0b849;
}

.sqs-timer-container.warning #sqs-timer-display {
    color: #f0b849;
}

.sqs-timer-container.critical {
    background: #fcf0f1;
    border: 2px solid #d63638;
    animation: pulse 1s infinite;
}

.sqs-timer-container.critical #sqs-timer-display {
    color: #d63638;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* ==========================================
   QUESTIONS
   ========================================== */

.sqs-questions-container {
    margin: 30px 0;
}

.sqs-question-item {
    background: #fff;
    border: 2px solid #dcdcde;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    transition: border-color 0.3s;
}

.sqs-question-item.saved {
    border-color: #46b450;
}

.sqs-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.sqs-question-number {
    font-weight: bold;
    color: #2271b1;
    font-size: 14px;
}

.sqs-question-category {
    background: #f0f0f1;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.sqs-question-points {
    background: #2271b1;
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
}

.sqs-question-text {
    font-size: 18px;
    line-height: 1.6;
    margin: 15px 0 20px 0;
    color: #333;
}

.sqs-question-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sqs-option-label {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 2px solid #dcdcde;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    background: #fff;
}

.sqs-option-label:hover {
    border-color: #2271b1;
    background: #f6f7f7;
}

.sqs-option-input {
    margin-right: 15px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.sqs-option-input:checked + .sqs-option-marker {
    background: #2271b1;
    color: #fff;
}

.sqs-option-label:has(.sqs-option-input:checked) {
    border-color: #2271b1;
    background: #f0f6ff;
}

.sqs-option-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f1;
    color: #666;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
    transition: all 0.3s;
}

.sqs-option-text {
    flex: 1;
    line-height: 1.5;
    color: #333;
}

/* ==========================================
   SUBMIT SECTION
   ========================================== */

.sqs-submit-section {
    background: #f6f7f7;
    padding: 25px;
    border-radius: 8px;
    margin-top: 30px;
    text-align: center;
}

.sqs-submit-info {
    margin-bottom: 20px;
}

.sqs-warning-text, .sqs-info-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 10px 0;
}

.sqs-warning-text {
    color: #d63638;
    font-weight: bold;
}

.sqs-info-text {
    color: #666;
}

/* ==========================================
   AUTO-SAVE INDICATOR
   ========================================== */

.sqs-autosave-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
}

.sqs-autosave-indicator .dashicons {
    color: #2271b1;
    animation: pulse-cloud 1s infinite;
}

@keyframes pulse-cloud {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==========================================
   MODAL
   ========================================== */

.sqs-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.sqs-modal-content {
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.sqs-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #dcdcde;
}

.sqs-modal-header h3 {
    margin: 0;
    color: #333;
}

.sqs-modal-body {
    padding: 25px;
}

.sqs-modal-body p {
    margin: 10px 0;
    line-height: 1.6;
}

.sqs-modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #dcdcde;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==========================================
   RESULTS PAGE
   ========================================== */

.sqs-results-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.sqs-results-header {
    text-align: center;
    margin-bottom: 30px;
}

.sqs-results-header h2 {
    margin: 0 0 20px 0;
    color: #333;
}

.sqs-student-info {
    background: #f6f7f7;
    padding: 20px;
    border-radius: 4px;
    margin: 20px 0;
}

.sqs-info-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
    color: #666;
}

.sqs-score-display {
    text-align: center;
    padding: 50px 30px;
    border-radius: 8px;
    margin: 30px 0;
}

.sqs-score-display.passed {
    background: linear-gradient(135deg, #edfaef 0%, #c3e6cb 100%);
    border: 3px solid #46b450;
}

.sqs-score-display.failed {
    background: linear-gradient(135deg, #fcf0f1 0%, #f5c6cb 100%);
    border: 3px solid #d63638;
}

.sqs-score-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.sqs-score-icon .dashicons {
    width: 64px;
    height: 64px;
}

.passed .sqs-score-icon .dashicons {
    color: #46b450;
}

.failed .sqs-score-icon .dashicons {
    color: #d63638;
}

.sqs-score-main {
    margin: 20px 0;
}

.sqs-score-fraction {
    font-size: 48px;
    font-weight: bold;
    color: #333;
}

.sqs-score-percentage {
    font-size: 36px;
    color: #666;
    margin-top: 10px;
}

.sqs-score-status {
    margin-top: 20px;
}

.sqs-status-badge {
    display: inline-block;
    padding: 8px 24px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 18px;
    margin-bottom: 15px;
}

.sqs-status-pass {
    background: #46b450;
    color: #fff;
}

.sqs-status-fail {
    background: #d63638;
    color: #fff;
}

.sqs-status-message {
    font-size: 18px;
    font-weight: 500;
}

.sqs-pass-message {
    color: #155724;
}

.sqs-fail-message {
    color: #721c24;
}

.sqs-result-details {
    background: #f6f7f7;
    padding: 25px;
    border-radius: 8px;
    margin: 30px 0;
}

.sqs-result-details h3 {
    margin-top: 0;
    color: #333;
}

.sqs-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.sqs-detail-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sqs-detail-label {
    font-weight: 600;
    color: #666;
    font-size: 14px;
}

.sqs-detail-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

/* ==========================================
   ANSWER REVIEW
   ========================================== */

.sqs-answers-review {
    margin-top: 40px;
}

.sqs-answers-review h3 {
    margin-bottom: 20px;
    color: #333;
}

.sqs-answer-item {
    background: #fff;
    border: 2px solid #dcdcde;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.sqs-answer-item.correct {
    border-color: #46b450;
    background: #f0faf1;
}

.sqs-answer-item.incorrect {
    border-color: #d63638;
    background: #fcf0f1;
}

.sqs-answer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.sqs-answer-number {
    font-weight: bold;
    color: #666;
}

.sqs-answer-result {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: bold;
}

.correct .sqs-answer-result {
    color: #46b450;
}

.incorrect .sqs-answer-result {
    color: #d63638;
}

.sqs-answer-question {
    font-size: 16px;
    margin: 15px 0;
    color: #333;
    line-height: 1.6;
}

.sqs-review-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: 8px 0;
    border-radius: 4px;
    background: #fff;
}

.sqs-review-option.correct-answer {
    background: #edfaef;
    border: 2px solid #46b450;
}

.sqs-review-option.wrong-answer {
    background: #fcf0f1;
    border: 2px solid #d63638;
}

.sqs-review-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #f0f0f1;
    color: #666;
    font-weight: bold;
    flex-shrink: 0;
}

.correct-answer .sqs-review-marker {
    background: #46b450;
    color: #fff;
}

.wrong-answer .sqs-review-marker {
    background: #d63638;
    color: #fff;
}

.sqs-review-text {
    flex: 1;
}

.sqs-review-badge {
    background: #f0f0f1;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    color: #666;
}

.sqs-badge-correct {
    background: #46b450;
    color: #fff;
}

.sqs-results-actions {
    margin-top: 40px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* ==========================================
   ERROR MESSAGES
   ========================================== */

.sqs-error {
    background: #fcf0f1;
    border-left: 4px solid #d63638;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 4px;
}

.sqs-error p {
    margin: 0;
    color: #721c24;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .sqs-quiz-container,
    .sqs-results-container {
        padding: 20px;
        margin: 20px 10px;
    }

    .sqs-quiz-header h2 {
        font-size: 24px;
    }

    .sqs-question-text {
        font-size: 16px;
    }

    .sqs-option-label {
        padding: 12px;
    }

    .sqs-score-fraction {
        font-size: 36px;
    }

    .sqs-score-percentage {
        font-size: 28px;
    }

    .sqs-details-grid {
        grid-template-columns: 1fr;
    }

    .sqs-modal-content {
        margin: 20px;
    }

    .sqs-results-actions {
        flex-direction: column;
    }

    .sqs-results-actions .sqs-button {
        width: 100%;
    }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .sqs-results-actions,
    .sqs-timer-container,
    .sqs-autosave-indicator {
        display: none !important;
    }

    .sqs-results-container,
    .sqs-quiz-container {
        box-shadow: none;
        border: 1px solid #dcdcde;
    }
}
