/* Training Quiz System Styles */

/* Quiz Container */
.training-quiz-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 0;
}

/* Quiz Item */
.training-quiz-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    margin-bottom: 30px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.training-quiz-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* License Status Styles */
.quiz-license-status {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%) !important;
    color: white !important;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9em;
}

.license-awarded {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 2px solid #28a745;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
}

.license-badge {
    display: block;
    color: #28a745;
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 8px;
}

/* .license-number {
    display: block;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.2em;
    color: #495057;
    background: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    margin: 8px auto;
    border: 1px solid #dee2e6;
    max-width: 300px;
} */

.license-date {
    display: block;
    color: #6c757d;
    font-size: 0.9em;
    margin-top: 8px;
}

/* Quiz Header */
.quiz-header {
    padding: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.quiz-title {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.quiz-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.quiz-meta span {
    background: #f8f9fa;
    color: #495057;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 500;
}

.quiz-questions-count {
    background: #007cba !important;
    color: white !important;
}

.quiz-time-limit {
    background: #ffc107 !important;
    color: #212529 !important;
}

.quiz-passing-score {
    background: #28a745 !important;
    color: white !important;
}

/* Quiz Description */
.quiz-description {
    padding: 15px 20px;
    color: #666;
    line-height: 1.6;
    border-bottom: 1px solid #f0f0f0;
}

/* Quiz Status */
.quiz-status {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.status-passed {
    color: #28a745;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-attempted {
    color: #ffc107;
    font-weight: 500;
}

.status-not-attempted {
    color: #6c757d;
    font-style: italic;
}

/* Quiz Actions */
.quiz-actions {
    padding: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.quiz-actions .button {
    background: #007cba;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.quiz-actions .button:hover {
    background: #005a87;
    color: white;
    transform: translateY(-2px);
    /* box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3); */
}

.quiz-actions .start-quiz {
    background: #28a745;
}

.quiz-actions .start-quiz:hover {
    background: #218838;
    /* box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3); */
}

.quiz-actions .view-results {
    background: #6c757d;
}

.quiz-actions .view-results:hover {
    background: #545b62;
    /* box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3); */
}

.attempts-exhausted,
.no-questions {
    color: #dc3545;
    font-style: italic;
    font-weight: 500;
}

/* Quiz Container (When Taking Quiz) */
.quiz-container {
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e1e1e1;
}

/* Quiz Timer */
.quiz-timer {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
    text-align: center;
}

.timer-display {
    font-size: 18px;
    font-weight: 600;
    color: #856404;
}

.timer-warning {
    background: #f8d7da !important;
    border-color: #f5c6cb !important;
}

.timer-warning .timer-display {
    color: #721c24 !important;
}

/* Quiz Questions */
.quiz-questions {
    background: white;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.quiz-question {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.quiz-question:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.question-text {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
}

.option-label .option-letter {
    font-weight: bold;
    margin-right: 8px;
    color: #007cba;
}

/* Question Options */
.question-options {
    display: flex;
    flex-direction: column;
    gap: 0px;
}

.option-label {
    display: flex !important;
    align-items: center;
    padding: 12px 15px;
    /* background: #f8f9fa; */
    /* border: 1px solid #e9ecef; */
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0;
}

.option-label:hover {
    background: #e9ecef;
    border-color: #007cba;
}

.option-label input[type="radio"] {
    margin: 0 12px 0 0;

}

.option-label input[type="radio"]:checked + .option-text {
    font-weight: 600;
    color: #007cba;
}

.option-label:has(input[type="radio"]:checked) {
    background: #cce5ff;
    border-color: #007cba;
}

.option-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.4;
}

/* Quiz Submit */
.quiz-submit {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    display: flex;
    justify-content: start;
    gap:15px;
}

.quiz-submit .button {
    background: #28a745;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0 10px;
}

.quiz-submit .submit-quiz:hover {
    background: #218838;
    transform: translateY(-2px);
    /* box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3); */
}

.quiz-submit .cancel-quiz {
    background: #6c757d;
}

.quiz-submit .cancel-quiz:hover {
    background: #545b62;
    /* box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3); */
}

/* Quiz Results */
.quiz-results-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.quiz-results-container h3 {
    margin: 0 0 25px 0;
    font-size: 24px;
    color: #333;
    text-align: center;
    padding-bottom: 15px;
    border-bottom: 2px solid #007cba;
}

.quiz-result-item {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.quiz-result-item h4 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #333;
}

.attempts-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.attempt-result {
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.attempt-result.passed {
    border-left: 4px solid #28a745;
}

.attempt-result.failed {
    border-left: 4px solid #dc3545;
}

.attempt-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.attempt-number {
    font-weight: 600;
    color: #333;
}

.attempt-date {
    color: #6c757d;
    font-size: 14px;
}

.attempt-score {
    font-size: 18px;
    font-weight: 600;
}

.attempt-result.passed .attempt-score {
    color: #28a745;
}

.attempt-result.failed .attempt-score {
    color: #dc3545;
}

.attempt-status {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.attempt-result.passed .attempt-status {
    background: #d4edda;
    color: #155724;
}

.attempt-result.failed .attempt-status {
    background: #f8d7da;
    color: #721c24;
}

/* Quiz Results Modal/Popup */
.quiz-results-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.quiz-results-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.quiz-results-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 5px;
    line-height: 1;
}

.quiz-results-close:hover {
    color: #333;
}

.quiz-results-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.quiz-results-score {
    font-size: 48px;
    font-weight: 700;
    margin: 10px 0;
}

.quiz-results-score.passed {
    color: #28a745;
}

.quiz-results-score.failed {
    color: #dc3545;
}

.quiz-results-status {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.quiz-results-status.passed {
    color: #28a745;
}

.quiz-results-status.failed {
    color: #dc3545;
}

.quiz-results-summary {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.result-stat {
    text-align: center;
}

.result-stat-value {
    font-size: 24px;
    font-weight: 600;
    color: #333;
}

.result-stat-label {
    font-size: 14px;
    color: #6c757d;
    margin: 5px 0 0 0;
}

/* Access Denied */
.training-quiz-access-denied {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border: 2px solid #e74c3c;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.1);
}

.access-denied-content {
    max-width: 500px;
    margin: 0 auto;
}

.access-denied-icon {
    font-size: 48px;
    color: #e74c3c;
    margin-bottom: 20px;
}

.access-denied-icon .dashicons {
    width: 48px;
    height: 48px;
    font-size: 48px;
}

.access-denied-title {
    color: #e74c3c;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.access-denied-message {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 30px 0;
}

.access-denied-actions {
    margin-top: 25px;
}

.access-denied-actions .button {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 14px;
    margin: 0 5px;
}

.access-denied-actions .button:hover {
    background: #005a87;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.access-denied-actions .purchase-button {
    background: #28a745;
}

.access-denied-actions .purchase-button:hover {
    background: #218838;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* License Award Styles in Modal */
.quiz-license-awarded {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin: 20px 0;
}

.quiz-license-awarded .license-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.quiz-license-awarded h4 {
    color: #856404;
    font-size: 1.4em;
    margin: 10px 0;
    font-weight: bold;
}

.quiz-license-awarded .license-number-display {
    background: #fff;
    border: 2px solid #ffc107;
    border-radius: 8px;
    padding: 12px 20px;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.3em;
    color: #495057;
    margin: 15px auto;
    max-width: 300px;
    letter-spacing: 1px;
}

.quiz-license-awarded p {
    color: #856404;
    margin: 10px 0 0 0;
    font-weight: 500;
}

/* Error and Empty States */
.quiz-results-error,
.quiz-results-empty,
.training-quiz-no-quizzes,
.quiz-no-questions {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 40px 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin: 20px 0;
}

/* Loading States */
.quiz-loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.quiz-loading .dashicons {
    animation: spin 1s linear infinite;
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .training-quiz-container {
        margin: 15px;
        padding: 0;
    }
    
    .quiz-header {
        padding: 15px;
    }
    
    .quiz-title {
        font-size: 20px;
    }
    
    .quiz-meta {
        gap: 8px;
    }
    
    .quiz-meta span {
        font-size: 12px;
        padding: 3px 8px;
    }
    
    .quiz-description,
    .quiz-status,
    .quiz-actions {
        padding: 15px;
    }
    
    .quiz-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .quiz-actions .button {
        margin: 5px 0;
        text-align: center;
    }
    
    .quiz-container {
        padding: 15px;
    }
    
    .quiz-questions {
        padding: 15px;
    }
    
    .question-text {
        font-size: 16px;
    }
    
    .option-text {
        font-size: 14px;
    }
    
    .quiz-submit .button {
        width: 100%;
        margin: 5px 0;
    }
    
    .attempt-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .quiz-results-summary {
        gap: 15px;
    }
    
    .quiz-results-modal {
        padding: 10px;
    }
    
    .quiz-results-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .quiz-title {
        font-size: 18px;
    }
    
    .quiz-header,
    .quiz-description,
    .quiz-status,
    .quiz-actions,
    .quiz-container {
        padding: 12px;
    }
    
    .quiz-questions {
        padding: 12px;
    }
    
    .question-text {
        font-size: 15px;
    }
    
    .option-label {
        padding: 10px 12px;
    }
    
    .option-text {
        font-size: 13px;
    }
    
    .access-denied-content {
        padding: 0 10px;
    }
    
    .access-denied-title {
        font-size: 20px;
    }
    
    .access-denied-message {
        font-size: 14px;
    }
}
