/**
 * Course Monitoring CSS
 * Styles for course selection and progress monitoring modals
 */

/* Modal Base Styles */
.eai-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    overflow-y: auto;
}

.eai-modal-content {
    background-color: #fff;
    margin: 50px auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.eai-modal-content.eai-modal-large {
    max-width: 1200px;
    margin: 30px auto;
}

.eai-modal-header {
    background-color: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eai-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.eai-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.eai-modal-close:hover {
    color: #333;
}

.eai-modal-body {
    padding: 20px;
}

/* Loading State */
#course-selection-loading,
#course-progress-loading,
#student-course-progress-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Course Selection List */
.eai-modal-description {
    margin-bottom: 20px;
    color: #555;
}

#course-checkboxes {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.eai-course-checkbox {
    display: block;
    padding: 12px 15px;
    margin-bottom: 8px;
    background-color: #f8f9fa;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.eai-course-checkbox:hover {
    background-color: #e9ecef;
}

.eai-course-checkbox input[type="checkbox"] {
    margin-right: 10px;
    transform: scale(1.2);
}

.eai-course-checkbox span {
    font-size: 1rem;
    color: #333;
}

/* Modal Actions */
.eai-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #dee2e6;
}

/* Buttons */
.eai-btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.eai-btn-primary {
    background-color: #007bff;
    color: white;
}

.eai-btn-primary:hover {
    background-color: #0056b3;
}

.eai-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.eai-btn-secondary:hover {
    background-color: #545b62;
}

.eai-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Empty State */
#course-progress-empty,
#student-course-progress-empty {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Course Tabs */
.eai-course-tabs {
    margin-top: 20px;
}

.eai-tab-buttons {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.eai-course-tab-btn {
    padding: 12px 20px;
    background-color: #f8f9fa;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    color: #666;
    transition: all 0.2s;
    white-space: nowrap;
}

.eai-course-tab-btn:hover {
    background-color: #e9ecef;
    color: #333;
}

.eai-course-tab-btn.active {
    background-color: #fff;
    color: #007bff;
    border-bottom-color: #007bff;
    font-weight: 500;
}

.eai-tab-content {
    min-height: 300px;
}

.eai-course-tab-panel {
    display: none;
}

.eai-course-tab-panel.active {
    display: block;
}

/* Course Progress Content */
.eai-course-progress-content,
.eai-student-course-progress {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 4px;
    min-height: 200px;
}

/* Error Messages */
.eai-error {
    color: #dc3545;
    padding: 15px;
    background-color: #f8d7da;
    border-radius: 4px;
    margin: 10px 0;
}

/* Student Dashboard Course Progress Section */
.student-course-progress-section {
    margin: 20px 0;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    text-align: center;
}

.student-course-progress-section .eai-btn {
    font-size: 1.1rem;
    padding: 12px 30px;
}

/* Teacher Dashboard Buttons */
.dashboard-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 20px 0;
}

.dashboard-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
}

.dashboard-button:hover {
    background-color: #e9ecef;
    border-color: #007bff;
    transform: translateY(-2px);
}

.dashboard-button img {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
}

.dashboard-button span {
    font-size: 0.9rem;
    color: #333;
    text-align: center;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .eai-modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .eai-modal-content.eai-modal-large {
        width: 95%;
        margin: 10px auto;
    }
    
    .eai-tab-buttons {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
    
    .dashboard-buttons {
        justify-content: center;
    }
    
    .dashboard-button {
        min-width: 100px;
        padding: 10px;
    }
}

/* Progress Table Styles (for course engine output) */
.eai-progress-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.eai-progress-table th,
.eai-progress-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.eai-progress-table th {
    background-color: #e9ecef;
    font-weight: 600;
}

.eai-progress-table tr:hover {
    background-color: #f8f9fa;
}

/* Progress Status Indicators */
.eai-status-complete {
    color: #28a745;
    font-weight: 500;
}

.eai-status-in-progress {
    color: #ffc107;
    font-weight: 500;
}

.eai-status-not-started {
    color: #6c757d;
}

/* Activity Completion Badges */
.eai-activity-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
}

.eai-activity-badge.mcq-complete {
    background-color: #d4edda;
    color: #155724;
}

.eai-activity-badge.mcq-incomplete {
    background-color: #f8d7da;
    color: #721c24;
}

.eai-activity-badge.written-complete {
    background-color: #d4edda;
    color: #155724;
}

.eai-activity-badge.written-pending {
    background-color: #fff3cd;
    color: #856404;
}

/* Clickable cells for viewing attempts */
.eai-clickable-cell {
    cursor: pointer;
    color: #007bff;
    text-decoration: underline;
}

.eai-clickable-cell:hover {
    background-color: #e7f3ff;
}
