/* Simple Course Manager - Frontend Styles */

/* Course Container */
.scm-course-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Registration Form */
.scm-registration-form {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scm-registration-form h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 28px;
    color: #333;
}

.scm-course-description {
    margin-bottom: 25px;
    padding: 15px;
    background: #f9f9f9;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
}

.scm-form-group {
    margin-bottom: 20px;
}

.scm-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.scm-form-group .required {
    color: #d63638;
}

.scm-field-hint {
    display: block;
    margin-top: 5px;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

.scm-form-control {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.scm-form-control select {
    width: 100%;
}

.scm-form-control:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.scm-form-control:invalid {
    border-color: #d63638;
}

.scm-form-actions {
    margin-top: 25px;
}

.scm-btn {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    display: inline-block;
    text-decoration: none;
}

.scm-btn-primary {
    background: #0073aa;
    color: #fff;
}

.scm-btn-primary:hover {
    background: #005a87;
    color: #fff;
}

.scm-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.scm-form-message {
    margin-top: 20px;
    padding: 12px 15px;
    border-radius: 4px;
    display: none;
}

.scm-form-message.success {
    display: block;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.scm-form-message.error {
    display: block;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Video Container */
.scm-video-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scm-video-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 28px;
    color: #333;
}

.scm-video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin-bottom: 25px;
    border-radius: 8px;
    background: #000;
}

.scm-video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.scm-video-actions {
    text-align: center;
}

.scm-video-actions p {
    margin-bottom: 15px;
    color: #666;
}

/* Exam Container */
.scm-exam-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scm-exam-container h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 28px;
    color: #333;
}

.scm-exam-info {
    padding: 15px;
    margin-bottom: 25px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

.scm-exam-info p {
    margin: 5px 0;
}

.scm-question {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid #0073aa;
}

.scm-question-title {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 18px;
    color: #0073aa;
}

.scm-question-text {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}

.scm-choices {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scm-choice {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.scm-choice:hover {
    border-color: #0073aa;
    background: #f0f8ff;
}

.scm-choice.selected {
    border-color: #0073aa;
    background: #f0f8ff;
}

.scm-choice input[type="radio"] {
    margin-right: 12px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.scm-choice span {
    flex: 1;
    font-size: 15px;
    color: #333;
    cursor: pointer;
}

/* Results Container */
.scm-results-container {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scm-results-container h2 {
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 28px;
    color: #333;
    text-align: center;
}

.scm-result-card {
    padding: 30px;
    border-radius: 8px;
    text-align: center;
}

.scm-result-card.scm-passed {
    background: #d4edda;
    border: 2px solid #28a745;
}

.scm-result-card.scm-failed {
    background: #f8d7da;
    border: 2px solid #dc3545;
}

.scm-result-status {
    margin-bottom: 25px;
}

.scm-status-icon {
    display: inline-block;
    width: 60px;
    height: 60px;
    line-height: 60px;
    font-size: 36px;
    border-radius: 50%;
    margin-bottom: 15px;
}

.scm-passed .scm-status-icon {
    background: #28a745;
    color: #fff;
}

.scm-failed .scm-status-icon {
    background: #dc3545;
    color: #fff;
}

.scm-result-status h3 {
    margin: 10px 0;
    font-size: 26px;
}

.scm-passed .scm-result-status h3 {
    color: #155724;
}

.scm-failed .scm-result-status h3 {
    color: #721c24;
}

.scm-result-score {
    margin: 25px 0;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
}

.scm-result-score p {
    margin: 10px 0;
    font-size: 18px;
}

.scm-result-score-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(0,0,0,0.1);
}

.scm-result-score-header .scm-result-status {
    margin-bottom: 0;
}

.scm-result-score-header .scm-result-score {
    text-align: left;
    margin: 0;
    padding: 0;
    background: transparent;
}

.scm-score-value {
    font-size: 32px;
    font-weight: bold;
}

.scm-passed .scm-score-value {
    color: #28a745;
}

.scm-failed .scm-score-value {
    color: #dc3545;
}

.scm-result-content {
    padding: 20px;
    background: #fff;
    border-radius: 6px;
}

.scm-result-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.scm-result-content h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #0073aa;
}

.scm-result-content ul {
    list-style: disc;
    padding-left: 25px;
    margin: 10px 0;
}

.scm-result-content ul li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.scm-result-content p {
    line-height: 1.8;
    margin-bottom: 15px;
}

.scm-certificate-message {
    margin-top: 25px;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.scm-failed-message {
    margin-top: 25px;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    border-left: 4px solid #dc3545;
}

.scm-retry-section {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    border: 2px dashed #ffc107;
    text-align: center;
}

.scm-retry-section p {
    margin-bottom: 15px;
    font-size: 16px;
}

#scm-retry-form {
    margin-top: 15px;
}

/* Loading Spinner */
.scm-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: scm-spin 0.8s linear infinite;
}

@keyframes scm-spin {
    to { transform: rotate(360deg); }
}

/* Button Loading State */
.scm-btn.loading {
    position: relative;
    color: transparent;
}

.scm-btn.loading .scm-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Progress Indicator */
.scm-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.scm-progress-step {
    flex: 1;
    text-align: center;
    padding: 10px;
    position: relative;
}

.scm-progress-step::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -50%;
    width: 100%;
    height: 2px;
    background: #ddd;
    z-index: -1;
}

.scm-progress-step:last-child::after {
    display: none;
}

.scm-progress-step.active {
    color: #0073aa;
    font-weight: bold;
}

.scm-progress-step.completed {
    color: #28a745;
}

/* Responsive */
@media (max-width: 768px) {
    .scm-course-container {
        padding: 15px;
    }
    
    .scm-registration-form,
    .scm-video-container,
    .scm-exam-container,
    .scm-results-container {
        padding: 20px;
    }
    
    .scm-registration-form h2,
    .scm-video-container h2,
    .scm-exam-container h2,
    .scm-results-container h2 {
        font-size: 24px;
    }
    
    .scm-form-control {
        font-size: 16px; /* Prevent zoom on mobile */
    }
    
    .scm-choice {
        padding: 10px 12px;
    }
    
    .scm-choice input[type="radio"] {
        width: 16px;
        height: 16px;
    }
    
    .scm-choice span {
        font-size: 14px;
    }
}

/* Print Styles for Results */
@media print {
    .scm-course-container {
        max-width: 100%;
    }
    
    .scm-result-card {
        border: 2px solid #000 !important;
    }
}