/**
 * Tutor Dashboard Styles for Assignment Manager
 */

/* Dashboard Wrapper */
.am-tutor-dashboard-wrapper {
    max-width: 1400px;
    margin: 30px auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Header Section */
.am-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.am-header-left h1 {
    margin: 0 0 10px 0;
    font-size: 2em;
}

.welcome-message {
    margin: 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.am-stats-badge {
    display: flex;
    gap: 30px;
    background: rgba(255, 255, 255, 0.2);
    padding: 15px 25px;
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9em;
}

.stat-item strong {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.stat-item.pending strong {
    color: #ffd700;
}

/* Section Headers */
.am-section {
    margin-bottom: 50px;
}

.am-section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #e9ecef;
    color: #2c3e50;
}

.section-icon {
    font-size: 1.5em;
}

.section-count {
    margin-left: auto;
    background: #e9ecef;
    padding: 5px 15px;
    border-radius: 50px;
    font-size: 0.8em;
    font-weight: normal;
    color: #666;
}

/* Assignment Grid */
.am-assignment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
}

/* Assignment Cards */
.am-assignment-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.am-assignment-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.am-assignment-card.pending {
    border-left: 4px solid #ffc107;
}

.am-assignment-card.in-progress {
    border-left: 4px solid #17a2b8;
}

.am-assignment-card.completed {
    border-left: 4px solid #28a745;
}

.card-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assignment-id {
    font-weight: 600;
    color: #2c3e50;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.85em;
    font-weight: 500;
}

.status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.status-badge.in-progress {
    background: #d1ecf1;
    color: #0c5460;
}

.status-badge.completed {
    background: #d4edda;
    color: #155724;
}

.card-body {
    padding: 20px;
    flex: 1;
}

.assignment-title {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #2c3e50;
}

.assignment-meta {
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #666;
}

.assignment-meta p {
    margin: 5px 0;
}

.submission-preview {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9em;
}

.preview-content {
    margin-top: 8px;
    color: #555;
    line-height: 1.5;
    max-height: 100px;
    overflow-y: auto;
}

.tutor-notes {
    margin-top: 15px;
    padding: 12px;
    background: #e8f4fd;
    border-radius: 8px;
    font-size: 0.9em;
}

.card-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
}

/* Buttons */
.am-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.am-btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.am-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.am-btn-secondary {
    background: #6c757d;
    color: white;
}

.am-btn-secondary:hover {
    background: #5a6268;
}

.am-btn-small {
    padding: 6px 12px;
    font-size: 0.85em;
}

/* Completed Table */
.am-completed-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
}

.am-completed-table th {
    background: #2c3e50;
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 500;
}

.am-completed-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #e9ecef;
}

.am-completed-table tr:last-child td {
    border-bottom: none;
}

.am-completed-table tr:hover {
    background: #f8f9fa;
}

.status-sent {
    color: #28a745;
    font-weight: 500;
}

.status-pending-review {
    color: #ffc107;
    font-weight: 500;
}

/* Modals */
.am-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.am-modal-content {
    background: white;
    border-radius: 12px;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalSlideIn 0.3s;
}

.am-modal-lg {
    max-width: 1400px;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.am-modal-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.am-modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #2c3e50;
}

.am-modal-close {
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #666;
    padding: 0 10px;
}

.am-modal-close:hover {
    color: #333;
}

.am-modal-body {
    padding: 20px;
}

.am-loading {
    text-align: center;
    padding: 50px;
    color: #666;
}

.am-loading:after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Submission Viewer */
.am-submission-viewer {
    padding: 20px;
}

.am-viewer-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.am-viewer-header h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
}

.am-meta-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.am-meta-info p {
    margin: 0;
}

.am-split-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.am-submission-column,
.am-reference-column {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
}

.am-submission-column h4,
.am-reference-column h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    padding-bottom: 10px;
    border-bottom: 2px solid #dee2e6;
}

.am-reference-section {
    margin-bottom: 20px;
    padding: 15px;
    background: white;
    border-radius: 6px;
}

.am-reference-section h5 {
    margin: 0 0 10px 0;
    color: #495057;
}

.am-reference-content {
    max-height: 300px;
    overflow-y: auto;
    font-size: 0.9em;
    line-height: 1.6;
}

.am-reference-content pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.am-text-submission pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    background: white;
    padding: 15px;
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
}

.am-file-link {
    margin-bottom: 15px;
}

.am-extracted-text {
    background: white;
    padding: 15px;
    border-radius: 6px;
}

.am-extracted-text h5 {
    margin: 0 0 10px 0;
    color: #495057;
}

.am-extracted-text pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

/* Grading Form */
.am-grading-form {
    margin-top: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
}

.am-grading-form h4 {
    margin: 0 0 20px 0;
    color: #2c3e50;
}

.am-form-row {
    margin-bottom: 20px;
}

.am-form-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
}

.am-form-row input[type="number"],
.am-form-row input[type="text"],
.am-form-row textarea,
.am-form-row select {
    width: 100%;
    padding: 10px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 1em;
    transition: border-color 0.3s;
}

.am-form-row input:focus,
.am-form-row textarea:focus,
.am-form-row select:focus {
    border-color: #667eea;
    outline: none;
}

.am-form-row input[type="file"] {
    padding: 10px;
    background: white;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    width: 100%;
}

.am-note {
    margin: 5px 0 0 0;
    font-size: 0.85em;
    color: #6c757d;
}

.am-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .am-dashboard-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .am-split-view {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .am-assignment-grid {
        grid-template-columns: 1fr;
    }
    
    .am-stats-badge {
        flex-direction: column;
        gap: 15px;
    }
    
    .am-completed-table {
        display: block;
        overflow-x: auto;
    }
    
    .am-modal-content {
        width: 95%;
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .am-dashboard-header {
        padding: 15px;
    }
    
    .card-footer {
        flex-direction: column;
    }
    
    .am-form-actions {
        flex-direction: column;
    }
}

/* Additional tutor dashboard styles */
.am-grading-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

.am-grading-left, .am-grading-right {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.am-file-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.am-file-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.am-file-preview img {
    max-width: 100%;
    max-height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

.am-file-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.am-extracted-text-content {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 6px;
    max-height: 300px;
    overflow-y: auto;
    font-family: monospace;
    white-space: pre-wrap;
}

.am-tab-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 10px;
}

.am-tab-btn {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-radius: 4px;
    transition: all 0.3s;
}

.am-tab-btn:hover {
    background: #e9ecef;
}

.am-tab-btn.active {
    background: #667eea;
    color: white;
}

.am-tab-content {
    display: none;
}

.am-tab-content.active {
    display: block;
}

.am-reference-content {
    background: white;
    padding: 15px;
    border-radius: 6px;
    max-height: 400px;
    overflow-y: auto;
    font-family: monospace;
    white-space: pre-wrap;
    font-size: 14px;
    border: 1px solid #e0e0e0;
}

.am-grading-form {
    margin-top: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
}

.am-grading-form label {
    color: white;
    font-weight: 600;
    display: block;
    margin-bottom: 5px;
}

.am-grading-form input,
.am-grading-form textarea,
.am-grading-form select {
    width: 100%;
    padding: 10px;
    border: 2px solid white;
    border-radius: 4px;
    background: rgba(255,255,255,0.9);
    font-size: 14px;
}

.am-grading-form input:focus,
.am-grading-form textarea:focus,
.am-grading-form select:focus {
    outline: none;
    border-color: #ffc107;
}

.am-grading-form .form-help {
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    margin-top: 5px;
}

.am-form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Modal styles */
.am-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.am-modal-content {
    background: white;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 12px;
    position: relative;
    animation: modalSlideIn 0.3s;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.am-modal-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1;
}

.am-modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #2c3e50;
}

.am-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0 10px;
}

.am-modal-close:hover {
    color: #333;
}

.am-modal-body {
    padding: 20px;
}

.am-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.file-badge {
    background: #e3f2fd;
    color: #1976d2;
}

.text-badge {
    background: #f3e5f5;
    color: #7b1fa2;
}

/* Error message */
.am-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
}



