/* Assignment Creation Page Styles */

/* Loading overlay - shown while authenticating */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background-primary, #f5f5f5);
    z-index: 9999;
}

.loading-spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid #e0e0e0;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

[data-theme="dark"] .loading-overlay {
    background: var(--background-primary, #1a1a1a);
}

[data-theme="dark"] .loading-spinner-large {
    border-color: #333;
    border-top-color: #0078d4;
}

.assignment-creation-container {
    padding: 24px;
    max-width: 1800px;
    margin: 0 auto;
    background: transparent;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Form Groups */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 8px;
}

/* Assignment Content Grid */
.assignment-content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.assignment-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Mode Toggle Container */
.mode-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #f9f9f9;
}

.mode-toggle-label {
    font-size: 14px;
    color: #666;
    font-weight: 400;
}

.mode-toggle-buttons {
    display: flex;
    gap: 8px;
}

.mode-toggle-buttons .e-btn {
    font-size: 13px;
}

/* Legacy mode-toggle for backwards compat */
.mode-toggle {
    display: flex;
    gap: 8px;
}

.mode-toggle .e-btn {
    font-size: 13px;
}

/* Upload Section */
.upload-section {
    min-height: 300px;
}

.upload-drop-area {
    border: 2px dashed rgba(0, 120, 212, 0.3);
    border-radius: 12px;
    padding: 60px 40px;
    text-align: center;
    background: rgba(0, 120, 212, 0.02);
    transition: all 0.3s ease;
}

.upload-drop-area:hover {
    border-color: rgba(0, 120, 212, 0.5);
    background: rgba(0, 120, 212, 0.05);
}

.upload-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.upload-drop-area h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.upload-drop-area p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

/* Upload Controls Layout */
.upload-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.browse-button-container {
    position: relative;
}

.browse-btn {
    min-width: 120px;
}

.hidden-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Drag-over visual feedback */
.upload-drop-area.drag-over {
    border-color: #0078d4;
    border-width: 3px;
    background: rgba(0, 120, 212, 0.15);
    transform: scale(1.01);
    box-shadow: 0 0 20px rgba(0, 120, 212, 0.3), inset 0 0 30px rgba(0, 120, 212, 0.1);
}

.upload-drop-area.drag-over .upload-icon {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

.upload-drop-area.drag-over p {
    color: #0078d4;
    font-weight: 500;
}

/* Pending files section drag-over state */
.pending-files-section.drag-over {
    border-color: #0078d4;
    border-width: 2px;
    background: rgba(0, 120, 212, 0.1);
    box-shadow: 0 0 15px rgba(0, 120, 212, 0.25), inset 0 0 20px rgba(0, 120, 212, 0.08);
}

.supported-formats {
    font-size: 12px;
    color: #888;
    display: block;
    margin-top: 8px;
}

/* Pending Files Section */
.pending-files-section {
    margin-top: 24px;
    border: 1px solid rgba(0, 120, 212, 0.2);
    border-radius: 8px;
    background: rgba(0, 120, 212, 0.02);
    overflow: hidden;
}

.pending-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(0, 120, 212, 0.05);
    border-bottom: 1px solid rgba(0, 120, 212, 0.1);
}

.pending-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
}

.pending-files-list {
    max-height: 200px;
    overflow-y: auto;
}

.pending-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: background 0.2s ease;
}

.pending-file-item:last-child {
    border-bottom: none;
}

.pending-file-item:hover {
    background: rgba(0, 120, 212, 0.05);
}

.pending-file-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.pending-file-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.pending-file-details {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.pending-file-name {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-file-size {
    font-size: 11px;
    color: #666;
}

.upload-actions {
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

/* When inside pending-files-section, add background/border */
.pending-files-section .upload-actions {
    background: rgba(0, 120, 212, 0.03);
    border-top: 1px solid rgba(0, 120, 212, 0.1);
    margin-top: 0;
}

/* Browse Button Container */
.uploader-container {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

.browse-button-label {
    cursor: pointer;
    display: inline-block;
}

/* File count badge in header */
.file-count-badge {
    font-size: 14px;
    font-weight: 400;
    color: #0078d4;
    margin-left: 8px;
}

/* Style the InputFile component - hide the "n files" text */
.browse-file-input {
    color: transparent;
    width: 120px;
}

.browse-file-input::file-selector-button {
    background-color: #0078d4;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.browse-file-input::file-selector-button:hover {
    background-color: #106ebe;
}

/* Smaller InputFile for "Add More" in the pending list header */
.browse-file-input-small {
    color: transparent;
    width: 100px;
}

.browse-file-input-small::file-selector-button {
    background-color: transparent;
    color: #0078d4;
    border: 1px solid #0078d4;
    padding: 4px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.browse-file-input-small::file-selector-button:hover {
    background-color: #0078d4;
    color: white;
}

/* Pending header actions */
.pending-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Pending file actions */
.pending-file-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Edit file button */
.edit-file-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
    line-height: 1;
}

.edit-file-btn:hover {
    background-color: #e6f2ff;
    color: #0078d4;
}

/* Remove file button */
.remove-file-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
    line-height: 1;
}

.remove-file-btn:hover {
    background-color: #fee;
    color: #c00;
}

.uploader-container .e-upload {
    border: none;
    background: transparent;
}

.uploader-container .e-upload .e-file-drop {
    display: none;
}

.uploader-container .e-upload .e-upload-files {
    display: none;
}

/* SfUploader adds this class when dragging over the drop area */
#assignmentDropArea.e-upload-drag-hover {
    border-color: #0078d4 !important;
    background: rgba(0, 120, 212, 0.15) !important;
    transform: scale(1.02);
}

/* Editor Section */
.editor-section {
    min-height: 400px;
}

/* Files List */
.files-list {
    max-height: 600px;
    overflow-y: auto;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
    cursor: pointer;
    background: transparent;
}

.file-item:last-child {
    border-bottom: none;
}

.file-item:hover {
    background: rgba(0, 120, 212, 0.05);
}

.file-item.selected {
    background: rgba(0, 120, 212, 0.1);
    border-left: 3px solid #0078d4;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.file-icon {
    font-size: 32px;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(0, 120, 212, 0.08);
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 12px;
    color: #666;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Tag Badges */
.tag-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.tag-badge.tag-primary {
    background: rgba(0, 120, 212, 0.15);
    color: #0078d4;
    border: 1px solid rgba(0, 120, 212, 0.3);
}

.tag-badge.tag-important {
    background: rgba(16, 124, 16, 0.15);
    color: #107c10;
    border: 1px solid rgba(16, 124, 16, 0.3);
}

.tag-badge.tag-secondary {
    background: rgba(255, 140, 0, 0.15);
    color: #ff8c00;
    border: 1px solid rgba(255, 140, 0, 0.3);
}

.tag-badge.tag-exclude {
    background: rgba(232, 17, 35, 0.15);
    color: #e81123;
    border: 1px solid rgba(232, 17, 35, 0.3);
}

/* Empty State */
.empty-state {
    padding: 80px 40px;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #666;
}

.empty-state p {
    margin: 0;
    font-size: 14px;
    color: #999;
}

/* Priority Rules */
.priority-rules {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
}

.rule-desc {
    font-size: 13px;
    color: #666;
}

/* File Viewer Dialog */
.dialog-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.dialog-header .file-icon {
    font-size: 24px;
    background: none;
}

.file-viewer {
    padding: 20px;
}

.file-viewer-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px;
    background: rgba(0, 120, 212, 0.05);
    border-radius: 8px;
}

.info-item {
    font-size: 14px;
}

.info-item strong {
    display: inline-block;
    min-width: 80px;
    color: #666;
}

.file-preview {
    min-height: 300px;
    border: 2px dashed rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
}

.preview-note {
    font-size: 16px;
    color: #666;
    margin-bottom: 16px;
}

.preview-path {
    font-size: 13px;
    color: #999;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .assignment-content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .assignment-creation-container {
        padding: 16px;
    }

    .header-actions {
        width: 100%;
        display: flex;
        gap: 8px;
    }

    .header-actions .e-btn {
        flex: 1;
    }

    .mode-toggle {
        flex-direction: column;
    }

    .mode-toggle .e-btn {
        width: 100%;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .file-viewer-info {
        grid-template-columns: 1fr;
        gap: 12px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .form-label,
    .file-name {
        color: #ffffff;
    }

    .file-meta,
    .rule-desc {
        color: rgba(255, 255, 255, 0.7);
    }

    .upload-drop-area {
        border-color: rgba(0, 120, 212, 0.4);
        background: rgba(0, 120, 212, 0.08);
    }

    .upload-drop-area:hover {
        border-color: rgba(0, 120, 212, 0.6);
        background: rgba(0, 120, 212, 0.12);
    }

    .upload-drop-area.drag-over {
        border-color: #3b82f6;
        border-width: 3px;
        background: rgba(59, 130, 246, 0.25);
        box-shadow: 0 0 25px rgba(59, 130, 246, 0.4), inset 0 0 30px rgba(59, 130, 246, 0.15);
    }

    .upload-drop-area.drag-over p {
        color: #60a5fa;
    }

    .pending-files-section.drag-over {
        border-color: #3b82f6;
        border-width: 2px;
        background: rgba(59, 130, 246, 0.15);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), inset 0 0 20px rgba(59, 130, 246, 0.1);
    }

    .supported-formats {
        color: rgba(255, 255, 255, 0.5);
    }

    .pending-files-section {
        border-color: rgba(0, 120, 212, 0.3);
        background: rgba(0, 120, 212, 0.05);
    }

    .pending-header {
        background: rgba(0, 120, 212, 0.1);
        border-bottom-color: rgba(0, 120, 212, 0.2);
    }

    .pending-header h4 {
        color: #ffffff;
    }

    .pending-file-item {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }

    .pending-file-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .pending-file-name {
        color: #ffffff;
    }

    .pending-file-size {
        color: rgba(255, 255, 255, 0.6);
    }

    .upload-actions {
        background: rgba(0, 120, 212, 0.08);
        border-top-color: rgba(0, 120, 212, 0.2);
    }

    .uploader-container .e-upload {
        background: transparent;
    }

    #assignmentDropArea.e-upload-drag-hover {
        border-color: #0078d4 !important;
        background: rgba(0, 120, 212, 0.25) !important;
    }

    .upload-drop-area h3 {
        color: #ffffff;
    }

    .upload-drop-area p {
        color: rgba(255, 255, 255, 0.7);
    }

    .file-item {
        border-bottom-color: rgba(255, 255, 255, 0.06);
    }

    .file-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .file-item.selected {
        background: rgba(0, 120, 212, 0.2);
    }

    .file-icon {
        background: rgba(0, 120, 212, 0.15);
    }

    .empty-state h3 {
        color: rgba(255, 255, 255, 0.7);
    }

    .empty-state p {
        color: rgba(255, 255, 255, 0.5);
    }

    .file-viewer-info {
        background: rgba(0, 120, 212, 0.1);
    }

    .info-item strong {
        color: rgba(255, 255, 255, 0.7);
    }

    .file-preview {
        border-color: rgba(255, 255, 255, 0.1);
        background: rgba(255, 255, 255, 0.03);
    }

    .preview-note {
        color: rgba(255, 255, 255, 0.7);
    }

    .preview-path {
        color: rgba(255, 255, 255, 0.5);
    }

    /* Mode toggle dark mode */
    .mode-toggle-container {
        border-color: rgba(255, 255, 255, 0.2);
        background: rgba(255, 255, 255, 0.05);
    }

    .mode-toggle-label {
        color: rgba(255, 255, 255, 0.7);
    }

    /* Confirmation dialog dark mode */
    .confirm-dialog-content p {
        color: rgba(255, 255, 255, 0.85);
    }

    .clear-warning-list {
        background: rgba(232, 17, 35, 0.1);
        border-color: rgba(232, 17, 35, 0.3);
    }

    .clear-warning-list li {
        color: rgba(255, 255, 255, 0.8);
    }

    .clear-warning-note {
        color: #f87171 !important;
    }
}

/* Support for data-theme attribute */
[data-theme="dark"] .form-label,
[data-theme="dark"] .file-name {
    color: #ffffff;
}

[data-theme="dark"] .file-meta,
[data-theme="dark"] .rule-desc {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .upload-drop-area {
    border-color: rgba(0, 120, 212, 0.4);
    background: rgba(0, 120, 212, 0.08);
}

[data-theme="dark"] .upload-drop-area:hover {
    border-color: rgba(0, 120, 212, 0.6);
    background: rgba(0, 120, 212, 0.12);
}

[data-theme="dark"] .upload-drop-area.drag-over {
    border-color: #3b82f6;
    border-width: 3px;
    background: rgba(59, 130, 246, 0.25);
    box-shadow: 0 0 25px rgba(59, 130, 246, 0.4), inset 0 0 30px rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .upload-drop-area.drag-over p {
    color: #60a5fa;
}

[data-theme="dark"] .pending-files-section.drag-over {
    border-color: #3b82f6;
    border-width: 2px;
    background: rgba(59, 130, 246, 0.15);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), inset 0 0 20px rgba(59, 130, 246, 0.1);
}

[data-theme="dark"] .uploader-container .e-upload {
    background: transparent;
}

[data-theme="dark"] #assignmentDropArea.e-upload-drag-hover {
    border-color: #0078d4 !important;
    background: rgba(0, 120, 212, 0.25) !important;
}

[data-theme="dark"] .supported-formats {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .pending-files-section {
    border-color: rgba(0, 120, 212, 0.3);
    background: rgba(0, 120, 212, 0.05);
}

[data-theme="dark"] .pending-header {
    background: rgba(0, 120, 212, 0.1);
    border-bottom-color: rgba(0, 120, 212, 0.2);
}

[data-theme="dark"] .pending-header h4 {
    color: #ffffff;
}

[data-theme="dark"] .pending-file-item {
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .pending-file-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .pending-file-name {
    color: #ffffff;
}

[data-theme="dark"] .pending-file-size {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .upload-actions {
    background: rgba(0, 120, 212, 0.08);
    border-top-color: rgba(0, 120, 212, 0.2);
}

[data-theme="dark"] .upload-drop-area h3 {
    color: #ffffff;
}

[data-theme="dark"] .upload-drop-area p {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .file-item {
    border-bottom-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .file-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .file-item.selected {
    background: rgba(0, 120, 212, 0.2);
}

[data-theme="dark"] .file-icon {
    background: rgba(0, 120, 212, 0.15);
}

[data-theme="dark"] .empty-state h3 {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .empty-state p {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .file-viewer-info {
    background: rgba(0, 120, 212, 0.1);
}

[data-theme="dark"] .info-item strong {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .file-preview {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .preview-note {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .preview-path {
    color: rgba(255, 255, 255, 0.5);
}

/* Mode toggle dark mode (data-theme) */
[data-theme="dark"] .mode-toggle-container {
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .mode-toggle-label {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .confirm-dialog-content p {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .clear-warning-list {
    background: rgba(232, 17, 35, 0.1);
    border-color: rgba(232, 17, 35, 0.3);
}

[data-theme="dark"] .clear-warning-list li {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .clear-warning-note {
    color: #f87171 !important;
}

/* Confirmation Dialog Styles */
.confirm-dialog-content {
    padding: 8px 0;
}

.confirm-dialog-content p {
    margin: 0 0 12px 0;
    color: #333;
    line-height: 1.5;
}

.clear-warning-list {
    margin: 16px 0;
    padding: 12px 12px 12px 32px;
    background: rgba(232, 17, 35, 0.08);
    border: 1px solid rgba(232, 17, 35, 0.2);
    border-radius: 8px;
    list-style-type: disc;
}

.clear-warning-list li {
    color: #555;
    padding: 4px 0;
    font-size: 14px;
}

.clear-warning-note {
    color: #c00 !important;
    font-weight: 500;
    font-size: 13px;
    margin-top: 16px !important;
}

/* SyncFusion Component Overrides */
.e-upload {
    border: none;
    background: transparent;
}

.e-upload .e-upload-files {
    border: none;
}

.e-richtexteditor {
    border-radius: 8px;
    overflow: hidden;
}

.e-dropdown-btn {
    border-radius: 6px;
}

/* Scrollbar Styling */
.files-list::-webkit-scrollbar {
    width: 8px;
}

.files-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb {
    background: rgba(0, 120, 212, 0.3);
    border-radius: 4px;
}

.files-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 120, 212, 0.5);
}

/* Course Association Section Styles */
.course-association-card {
    margin-top: 20px;
}

.course-association-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.optional-badge {
    font-size: 11px;
    font-weight: 500;
    color: #666;
    background: rgba(0, 0, 0, 0.08);
    padding: 4px 10px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loading-courses {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px;
    color: #666;
}

.loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0, 120, 212, 0.2);
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.course-association-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-help {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 6px;
    line-height: 1.4;
}

/* Section count badge - with spacing from label */
.section-count {
    font-weight: 400;
    color: #0078d4;
    font-size: 13px;
    margin-left: 8px;
}

/* Course dropdown item styling - single line: Code — Title */
.course-dropdown-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.course-dropdown-item .course-code {
    font-size: 13px;
    color: #0078d4;
    font-weight: 600;
    font-family: 'Segoe UI', system-ui, sans-serif;
    flex-shrink: 0;
}

.course-dropdown-item .course-separator {
    color: #999;
    margin: 0 8px;
    flex-shrink: 0;
}

.course-dropdown-item .course-title {
    font-weight: 400;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Section dropdown item styling - compact single row */
.section-dropdown-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
}

.section-dropdown-item .section-name {
    font-weight: 500;
    color: #1a1a1a;
    flex-shrink: 0;
}

.section-dropdown-item .section-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.section-dropdown-item .section-term {
    color: #0078d4;
    font-weight: 500;
}

.section-dropdown-item .section-dates {
    color: #888;
}

/* Separator between term and dates */
.section-dropdown-item .section-term + .section-dates::before {
    content: "•";
    margin-right: 8px;
    color: #ccc;
}

.no-sections-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    background: rgba(255, 140, 0, 0.1);
    border-radius: 8px;
    color: #b86e00;
    font-size: 13px;
}

.no-sections-message .info-icon {
    flex-shrink: 0;
}

/* MultiSelect chip/box hover improvements */
.course-association-form .e-multi-select-wrapper .e-chips {
    background: rgba(0, 120, 212, 0.1);
    border: 1px solid rgba(0, 120, 212, 0.3);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.course-association-form .e-multi-select-wrapper .e-chips:hover {
    background: #0078d4;
    border-color: #0078d4;
    box-shadow: 0 4px 12px rgba(0, 120, 212, 0.35);
    transform: translateY(-1px);
}

.course-association-form .e-multi-select-wrapper .e-chips .e-chipcontent {
    color: #0078d4;
    font-weight: 500;
    transition: color 0.2s ease;
}

.course-association-form .e-multi-select-wrapper .e-chips:hover .e-chipcontent {
    color: #ffffff;
}

.course-association-form .e-multi-select-wrapper .e-chips .e-chips-close {
    color: #0078d4;
    transition: all 0.2s ease;
}

.course-association-form .e-multi-select-wrapper .e-chips:hover .e-chips-close {
    color: rgba(255, 255, 255, 0.8);
}

.course-association-form .e-multi-select-wrapper .e-chips .e-chips-close:hover {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    color: #ffffff;
}

/* Dark mode for course association */
@media (prefers-color-scheme: dark) {
    .optional-badge {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 0.7);
    }

    .loading-courses {
        color: rgba(255, 255, 255, 0.7);
    }

    .form-help {
        color: rgba(255, 255, 255, 0.6);
    }

    .course-dropdown-item .course-title,
    .section-dropdown-item .section-name {
        color: #ffffff;
    }

    .course-dropdown-item .course-code {
        color: #60a5fa;
    }

    .course-dropdown-item .course-separator {
        color: rgba(255, 255, 255, 0.4);
    }

    .section-dropdown-item .section-meta,
    .section-dropdown-item .section-dates {
        color: rgba(255, 255, 255, 0.5);
    }

    .section-dropdown-item .section-term {
        color: #60a5fa;
    }

    .section-dropdown-item .section-term + .section-dates::before {
        color: rgba(255, 255, 255, 0.3);
    }

    .no-sections-message {
        background: rgba(255, 140, 0, 0.15);
        color: #ffaa44;
    }

    /* MultiSelect chips dark mode */
    .course-association-form .e-multi-select-wrapper .e-chips {
        background: rgba(96, 165, 250, 0.15);
        border-color: rgba(96, 165, 250, 0.3);
    }

    .course-association-form .e-multi-select-wrapper .e-chips:hover {
        background: #3b82f6;
        border-color: #3b82f6;
        box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    }

    .course-association-form .e-multi-select-wrapper .e-chips .e-chipcontent {
        color: #93c5fd;
    }

    .course-association-form .e-multi-select-wrapper .e-chips:hover .e-chipcontent {
        color: #ffffff;
    }

    .course-association-form .e-multi-select-wrapper .e-chips .e-chips-close {
        color: #93c5fd;
    }

    .course-association-form .e-multi-select-wrapper .e-chips:hover .e-chips-close {
        color: rgba(255, 255, 255, 0.8);
    }
}

[data-theme="dark"] .optional-badge {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .loading-courses {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] .form-help {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .course-dropdown-item .course-title,
[data-theme="dark"] .section-dropdown-item .section-name {
    color: #ffffff;
}

[data-theme="dark"] .course-dropdown-item .course-code {
    color: #60a5fa;
}

[data-theme="dark"] .course-dropdown-item .course-separator {
    color: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .section-dropdown-item .section-meta,
[data-theme="dark"] .section-dropdown-item .section-dates {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .section-dropdown-item .section-term {
    color: #60a5fa;
}

[data-theme="dark"] .section-dropdown-item .section-term + .section-dates::before {
    color: rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .no-sections-message {
    background: rgba(255, 140, 0, 0.15);
    color: #ffaa44;
}

/* MultiSelect chips dark mode (data-theme) */
[data-theme="dark"] .course-association-form .e-multi-select-wrapper .e-chips {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .course-association-form .e-multi-select-wrapper .e-chips:hover {
    background: #3b82f6;
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

[data-theme="dark"] .course-association-form .e-multi-select-wrapper .e-chips .e-chipcontent {
    color: #93c5fd;
}

[data-theme="dark"] .course-association-form .e-multi-select-wrapper .e-chips:hover .e-chipcontent {
    color: #ffffff;
}

[data-theme="dark"] .course-association-form .e-multi-select-wrapper .e-chips .e-chips-close {
    color: #93c5fd;
}

[data-theme="dark"] .course-association-form .e-multi-select-wrapper .e-chips:hover .e-chips-close {
    color: rgba(255, 255, 255, 0.8);
}

/* Validation Error Banner */
.validation-error-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
    background: rgba(232, 17, 35, 0.1);
    border: 1px solid rgba(232, 17, 35, 0.3);
    border-left: 4px solid #e81123;
    border-radius: 8px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.validation-error-banner .error-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.validation-error-banner .error-message {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #c41e3a;
}

.validation-error-banner .dismiss-error {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    transition: all 0.2s;
}

.validation-error-banner .dismiss-error:hover {
    background: rgba(232, 17, 35, 0.15);
    color: #c41e3a;
}

/* Success Banner */
.success-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: rgba(16, 124, 16, 0.1);
    border: 1px solid rgba(16, 124, 16, 0.3);
    border-left: 4px solid #107c10;
    border-radius: 8px;
    animation: slideDown 0.3s ease-out;
}

.success-banner .success-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.success-banner .success-message {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
    color: #0e6b0e;
}

.success-banner .success-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

[data-theme="dark"] .success-banner {
    background: rgba(16, 124, 16, 0.15);
    border-color: rgba(16, 124, 16, 0.4);
}

[data-theme="dark"] .success-banner .success-message {
    color: #47d147;
}

/* Pending Files Actions - Upload/Clear buttons area */
.pending-files-actions {
    margin-bottom: 12px;
}

/* Pending Files Status */
.pending-files-status {
    display: flex;
    justify-content: center;
    padding: 12px 16px;
    margin-top: 12px;
    margin-bottom: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.pending-files-status .status-checking {
    color: #666;
}

.pending-files-status .status-password-needed {
    color: #b8860b;
}

.pending-files-status .status-error {
    color: #c41e3a;
}

.pending-files-status .status-ready {
    color: #107c10;
}

[data-theme="dark"] .pending-files-status {
    background: #2a2a2a;
}

[data-theme="dark"] .pending-files-status .status-checking {
    color: #aaa;
}

[data-theme="dark"] .pending-files-status .status-password-needed {
    color: #daa520;
}

[data-theme="dark"] .pending-files-status .status-error {
    color: #ff6b6b;
}

[data-theme="dark"] .pending-files-status .status-ready {
    color: #47d147;
}

/* Improved Delete Button Visibility */
.file-actions .e-btn.e-danger,
.file-actions .e-btn.e-small.e-danger {
    background-color: rgba(232, 17, 35, 0.1);
    border: 1px solid rgba(232, 17, 35, 0.3);
    color: #c41e3a;
    min-width: 36px;
    min-height: 32px;
}

.file-actions .e-btn.e-danger:hover,
.file-actions .e-btn.e-small.e-danger:hover {
    background-color: #e81123;
    border-color: #e81123;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(232, 17, 35, 0.3);
}

.file-actions .e-btn.e-danger .e-icons.e-trash,
.file-actions .e-btn.e-small.e-danger .e-icons.e-trash {
    font-size: 14px;
}

/* Dark mode for validation error banner */
@media (prefers-color-scheme: dark) {
    .validation-error-banner {
        background: rgba(248, 113, 113, 0.15);
        border-color: rgba(248, 113, 113, 0.3);
        border-left-color: #f87171;
    }

    .validation-error-banner .error-message {
        color: #fca5a5;
    }

    .validation-error-banner .dismiss-error {
        color: rgba(255, 255, 255, 0.6);
    }

    .validation-error-banner .dismiss-error:hover {
        background: rgba(248, 113, 113, 0.2);
        color: #fca5a5;
    }

    /* Delete button dark mode */
    .file-actions .e-btn.e-danger,
    .file-actions .e-btn.e-small.e-danger {
        background-color: rgba(248, 113, 113, 0.15);
        border-color: rgba(248, 113, 113, 0.3);
        color: #f87171;
    }

    .file-actions .e-btn.e-danger:hover,
    .file-actions .e-btn.e-small.e-danger:hover {
        background-color: #dc2626;
        border-color: #dc2626;
        color: #ffffff;
        box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
    }
}

[data-theme="dark"] .validation-error-banner {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.3);
    border-left-color: #f87171;
}

[data-theme="dark"] .validation-error-banner .error-message {
    color: #fca5a5;
}

[data-theme="dark"] .validation-error-banner .dismiss-error {
    color: rgba(255, 255, 255, 0.6);
}

[data-theme="dark"] .validation-error-banner .dismiss-error:hover {
    background: rgba(248, 113, 113, 0.2);
    color: #fca5a5;
}

[data-theme="dark"] .file-actions .e-btn.e-danger,
[data-theme="dark"] .file-actions .e-btn.e-small.e-danger {
    background-color: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.3);
    color: #f87171;
}

[data-theme="dark"] .file-actions .e-btn.e-danger:hover,
[data-theme="dark"] .file-actions .e-btn.e-small.e-danger:hover {
    background-color: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.4);
}

/* ===== Password Protection Badges ===== */

/* Base password badge styles */
.password-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* Checking state - spinner */
.password-badge.checking {
    background: rgba(0, 120, 212, 0.1);
    border: 1px solid rgba(0, 120, 212, 0.3);
    color: #0078d4;
    padding: 6px 12px;
}

.password-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(0, 120, 212, 0.2);
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Locked state - needs password */
.password-badge.locked {
    background: rgba(255, 140, 0, 0.12);
    border: 1px solid rgba(255, 140, 0, 0.4);
    color: #b86e00;
    cursor: pointer;
    font-weight: 600;
}

.password-badge.locked:hover {
    background: #ff8c00;
    border-color: #ff8c00;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(255, 140, 0, 0.35);
    transform: translateY(-1px);
}

.password-badge.locked:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(255, 140, 0, 0.3);
}

/* Unlocked state - password set */
.password-badge.unlocked {
    background: rgba(16, 124, 16, 0.12);
    border: 1px solid rgba(16, 124, 16, 0.3);
    color: #107c10;
    padding: 4px 8px;
}

/* Highlight files that need password */
.pending-file-item.needs-password {
    background: rgba(255, 140, 0, 0.06);
    border-left: 3px solid #ff8c00;
}

.pending-file-item.needs-password:hover {
    background: rgba(255, 140, 0, 0.12);
}

/* Password Dialog Styles */
.password-dialog-content {
    padding: 8px 0;
    text-align: center;
}

.password-dialog-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.password-dialog-message {
    color: #333;
    line-height: 1.6;
    margin-bottom: 20px;
}

.password-dialog-message strong {
    color: #1a1a1a;
    word-break: break-all;
}

.password-dialog-error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    background: rgba(232, 17, 35, 0.1);
    border: 1px solid rgba(232, 17, 35, 0.3);
    border-radius: 6px;
    color: #c41e3a;
    font-size: 13px;
}

.password-dialog-error .error-icon {
    flex-shrink: 0;
}

.password-input-container {
    max-width: 320px;
    margin: 0 auto;
}

.password-input-container .password-input {
    text-align: center;
}

/* Dark mode for password badges */
@media (prefers-color-scheme: dark) {
    .password-badge.checking {
        background: rgba(96, 165, 250, 0.15);
        border-color: rgba(96, 165, 250, 0.3);
        color: #93c5fd;
    }

    .password-spinner {
        border-color: rgba(96, 165, 250, 0.2);
        border-top-color: #93c5fd;
    }

    .password-badge.locked {
        background: rgba(251, 191, 36, 0.15);
        border-color: rgba(251, 191, 36, 0.4);
        color: #fbbf24;
    }

    .password-badge.locked:hover {
        background: #f59e0b;
        border-color: #f59e0b;
        color: #1a1a1a;
        box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
    }

    .password-badge.unlocked {
        background: rgba(34, 197, 94, 0.15);
        border-color: rgba(34, 197, 94, 0.3);
        color: #4ade80;
    }

    .pending-file-item.needs-password {
        background: rgba(251, 191, 36, 0.08);
        border-left-color: #fbbf24;
    }

    .pending-file-item.needs-password:hover {
        background: rgba(251, 191, 36, 0.15);
    }

    .password-dialog-message {
        color: rgba(255, 255, 255, 0.85);
    }

    .password-dialog-message strong {
        color: #ffffff;
    }

    .password-dialog-error {
        background: rgba(248, 113, 113, 0.15);
        border-color: rgba(248, 113, 113, 0.3);
        color: #fca5a5;
    }
}

[data-theme="dark"] .password-badge.checking {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.3);
    color: #93c5fd;
}

[data-theme="dark"] .password-spinner {
    border-color: rgba(96, 165, 250, 0.2);
    border-top-color: #93c5fd;
}

[data-theme="dark"] .password-badge.locked {
    background: rgba(251, 191, 36, 0.15);
    border-color: rgba(251, 191, 36, 0.4);
    color: #fbbf24;
}

[data-theme="dark"] .password-badge.locked:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #1a1a1a;
    box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
}

[data-theme="dark"] .password-badge.unlocked {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.3);
    color: #4ade80;
}

[data-theme="dark"] .pending-file-item.needs-password {
    background: rgba(251, 191, 36, 0.08);
    border-left-color: #fbbf24;
}

[data-theme="dark"] .pending-file-item.needs-password:hover {
    background: rgba(251, 191, 36, 0.15);
}

[data-theme="dark"] .password-dialog-message {
    color: rgba(255, 255, 255, 0.85);
}

[data-theme="dark"] .password-dialog-message strong {
    color: #ffffff;
}

[data-theme="dark"] .password-dialog-error {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.3);
    color: #fca5a5;
}

/* ===== RTL (Right-to-Left) Support for Hebrew ===== */

/* Global RTL support - applied when body has rtl class */
body.rtl {
    direction: rtl;
    text-align: right;
}

body.rtl .assignment-creation-container {
    direction: rtl;
}

/* Main container and header */
body.rtl .dashboard-header {
    flex-direction: row-reverse;
}

body.rtl .header-content {
    text-align: right;
}

body.rtl .header-actions {
    flex-direction: row-reverse;
    gap: 12px;
}

/* Dashboard cards */
body.rtl .dashboard-card {
    direction: rtl;
}

body.rtl .card-content {
    direction: rtl;
    text-align: right;
}

/* Card headers */
body.rtl .card-header {
    flex-direction: row-reverse;
}

body.rtl .card-title {
    text-align: right;
}

/* Form elements */
body.rtl .form-group {
    text-align: right;
}

body.rtl .form-group label {
    text-align: right;
}

body.rtl .form-label {
    text-align: right;
}

body.rtl .form-help {
    text-align: right;
}

/* Course association form */
body.rtl .course-association-form {
    direction: rtl;
}

/* Mode toggle */
body.rtl .mode-toggle-container {
    flex-direction: row-reverse;
}

body.rtl .mode-toggle-buttons {
    flex-direction: row-reverse;
}

body.rtl .mode-toggle-label {
    text-align: right;
}

/* Assignment content grid - reverse column order */
body.rtl .assignment-content-grid {
    direction: rtl;
}

body.rtl .assignment-panel {
    direction: rtl;
}

/* File items */
body.rtl .file-item {
    flex-direction: row-reverse;
}

body.rtl .file-item.selected {
    border-left: none;
    border-right: 3px solid #0078d4;
}

body.rtl .file-info {
    flex-direction: row-reverse;
}

body.rtl .file-details {
    text-align: right;
}

body.rtl .file-actions {
    flex-direction: row-reverse;
}

/* Pending files */
body.rtl .pending-header {
    flex-direction: row-reverse;
}

body.rtl .pending-header-actions {
    flex-direction: row-reverse;
}

body.rtl .pending-file-item {
    flex-direction: row-reverse;
}

body.rtl .pending-file-item.needs-password {
    border-left: none;
    border-right: 3px solid #ff8c00;
}

body.rtl .pending-file-info {
    flex-direction: row-reverse;
}

body.rtl .pending-file-details {
    text-align: right;
}

body.rtl .pending-file-actions {
    flex-direction: row-reverse;
}

body.rtl .pending-files-section {
    direction: rtl;
}

body.rtl .pending-files-list {
    direction: rtl;
}

/* Priority rules */
body.rtl .priority-rules {
    text-align: right;
    direction: rtl;
}

body.rtl .rule-item {
    flex-direction: row-reverse;
}

/* Empty state */
body.rtl .empty-state {
    text-align: right;
}

/* Validation error banner */
body.rtl .validation-error-banner {
    flex-direction: row-reverse;
    border-left: none;
    border-right: 4px solid #e81123;
}

/* File count badge */
body.rtl .file-count-badge {
    margin-left: 0;
    margin-right: 8px;
}

/* Section count badge */
body.rtl .section-count {
    margin-left: 0;
    margin-right: 8px;
}

/* Upload section */
body.rtl .upload-section {
    text-align: right;
    direction: rtl;
}

body.rtl .upload-drop-area {
    text-align: right;
}

body.rtl .uploader-container {
    text-align: right;
}

body.rtl .upload-actions {
    justify-content: flex-start;
}

/* Dialog header */
body.rtl .dialog-header {
    flex-direction: row-reverse;
}

/* File viewer info */
body.rtl .file-viewer-info .info-item {
    text-align: right;
}

/* Confirmation dialogs */
body.rtl .confirm-dialog-content {
    text-align: right;
}

body.rtl .clear-warning-list {
    padding: 12px 32px 12px 12px;
}

/* Password dialog */
body.rtl .password-dialog-content {
    text-align: right;
}

body.rtl .password-dialog-error {
    flex-direction: row-reverse;
}

/* Course dropdown items */
body.rtl .course-dropdown-item {
    flex-direction: row-reverse;
}

body.rtl .section-dropdown-item {
    flex-direction: row-reverse;
}

body.rtl .section-dropdown-item .section-meta {
    flex-direction: row-reverse;
}

/* No sections message */
body.rtl .no-sections-message {
    flex-direction: row-reverse;
    text-align: right;
}

/* Loading courses */
body.rtl .loading-courses {
    flex-direction: row-reverse;
}

/* Tag badges */
body.rtl .tag-badge {
    flex-direction: row-reverse;
}

/* Optional badge */
body.rtl .optional-badge {
    margin-left: 0;
    margin-right: 8px;
}

/* SyncFusion components RTL overrides */
body.rtl .e-textbox-container,
body.rtl .e-input-group {
    direction: rtl;
}

body.rtl .e-ddl,
body.rtl .e-multiselect {
    direction: rtl;
}

body.rtl .e-dialog .e-dlg-header-content {
    flex-direction: row-reverse;
}

body.rtl .e-dialog .e-footer-content {
    flex-direction: row-reverse;
}

body.rtl .e-btn {
    direction: rtl;
}

/* SyncFusion button icons RTL fix */
body.rtl .e-btn .e-btn-icon {
    margin-left: 8px;
    margin-right: 0;
}

body.rtl .e-btn.e-icon-left .e-btn-icon {
    margin-left: 8px;
    margin-right: 0;
}

/* ===== Upload Progress Styles ===== */

/* Upload progress banner - shown during upload */
.upload-progress-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
    background: rgba(0, 120, 212, 0.1);
    border: 1px solid rgba(0, 120, 212, 0.3);
    border-left: 4px solid #0078d4;
    border-radius: 8px;
    animation: slideDown 0.3s ease-out;
}

.upload-spinner-icon {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 120, 212, 0.2);
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

.upload-progress-message {
    color: #0078d4;
    font-weight: 500;
    font-size: 14px;
}

/* Button spinner for save button */
.button-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

/* Pending file upload states */
.pending-file-item.uploading {
    background: rgba(0, 120, 212, 0.08);
    border-left: 3px solid #0078d4;
}

.pending-file-item.uploaded {
    background: rgba(16, 124, 16, 0.08);
    border-left: 3px solid #107c10;
}

.pending-file-item.upload-error {
    background: rgba(232, 17, 35, 0.08);
    border-left: 3px solid #e81123;
}

/* Upload spinner in file actions */
.upload-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
}

.upload-spinner .spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 120, 212, 0.2);
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Upload status text */
.upload-progress-text {
    color: #0078d4;
    font-weight: 500;
}

.upload-success-text {
    color: #107c10;
    font-weight: 500;
}

.upload-error-text {
    color: #e81123;
    font-weight: 500;
    cursor: help;
}

/* Dark mode for upload progress */
@media (prefers-color-scheme: dark) {
    .upload-progress-banner {
        background: rgba(96, 165, 250, 0.15);
        border-color: rgba(96, 165, 250, 0.3);
        border-left-color: #60a5fa;
    }

    .upload-progress-message {
        color: #93c5fd;
    }

    .upload-spinner-icon {
        border-color: rgba(96, 165, 250, 0.2);
        border-top-color: #93c5fd;
    }

    .pending-file-item.uploading {
        background: rgba(96, 165, 250, 0.1);
        border-left-color: #60a5fa;
    }

    .pending-file-item.uploaded {
        background: rgba(34, 197, 94, 0.1);
        border-left-color: #4ade80;
    }

    .pending-file-item.upload-error {
        background: rgba(248, 113, 113, 0.1);
        border-left-color: #f87171;
    }

    .upload-spinner .spinner {
        border-color: rgba(96, 165, 250, 0.2);
        border-top-color: #93c5fd;
    }

    .upload-progress-text {
        color: #93c5fd;
    }

    .upload-success-text {
        color: #4ade80;
    }

    .upload-error-text {
        color: #f87171;
    }
}

[data-theme="dark"] .upload-progress-banner {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.3);
    border-left-color: #60a5fa;
}

[data-theme="dark"] .upload-progress-message {
    color: #93c5fd;
}

[data-theme="dark"] .upload-spinner-icon {
    border-color: rgba(96, 165, 250, 0.2);
    border-top-color: #93c5fd;
}

[data-theme="dark"] .pending-file-item.uploading {
    background: rgba(96, 165, 250, 0.1);
    border-left-color: #60a5fa;
}

[data-theme="dark"] .pending-file-item.uploaded {
    background: rgba(34, 197, 94, 0.1);
    border-left-color: #4ade80;
}

[data-theme="dark"] .pending-file-item.upload-error {
    background: rgba(248, 113, 113, 0.1);
    border-left-color: #f87171;
}

[data-theme="dark"] .upload-spinner .spinner {
    border-color: rgba(96, 165, 250, 0.2);
    border-top-color: #93c5fd;
}

[data-theme="dark"] .upload-progress-text {
    color: #93c5fd;
}

[data-theme="dark"] .upload-success-text {
    color: #4ade80;
}

[data-theme="dark"] .upload-error-text {
    color: #f87171;
}

