/* Modern Grader Interface Styles */
/* Uses CSS variables from app.css for light/dark mode support */

.grader-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--fluent-bg-primary);
    overflow: hidden;
}

/* Ribbon Container */
.ribbon-container {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-bottom: 1px solid var(--fluent-border);
    box-shadow: var(--glass-shadow);
    z-index: 1000;
    min-height: 120px;
}

.ribbon-container .e-ribbon {
    background: transparent;
}

/* Workspace */
.workspace {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* Sidebar Panel */
.sidebar-panel {
    height: 100%;
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-right: 1px solid var(--fluent-border);
    display: flex;
    flex-direction: column;
}

.panel-header {
    padding: 16px;
    border-bottom: 1px solid var(--fluent-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg-subtle);
}

.panel-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--fluent-text-primary);
}

.btn-icon {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    color: var(--fluent-text-secondary);
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: rgba(0, 120, 212, 0.1);
    color: var(--fluent-primary);
}

.panel-content {
    flex: 1;
    overflow: auto;
    padding: 8px;
}

/* Custom TreeView Styling */
.custom-treeview .e-list-item {
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    color: var(--fluent-text-primary);
}

.custom-treeview .e-list-item:hover {
    background: rgba(0, 120, 212, 0.08);
}

.custom-treeview .e-list-item.e-active {
    background: rgba(0, 120, 212, 0.12);
    color: var(--fluent-primary);
    font-weight: 500;
}

/* Document Panel */
.document-panel {
    height: 100%;
    background: var(--card-bg);
}

.document-tabs {
    height: 100%;
}

.document-tabs .e-tab-header {
    background: var(--glass-bg-subtle);
    border-bottom: 1px solid var(--fluent-border);
}

.document-tabs .e-toolbar-item {
    border-radius: 6px 6px 0 0;
    margin-right: 2px;
    color: var(--fluent-text-secondary);
}

.document-tabs .e-toolbar-item.e-active {
    background: var(--card-bg);
    border-bottom: 2px solid var(--fluent-primary);
    color: var(--fluent-text-primary);
}

/* Document Viewer */
.document-viewer {
    height: 100%;
    padding: 20px;
    overflow: auto;
    background: #1e1e1e;
}

.code-editor {
    height: 100%;
}

.code-content {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #d4d4d4;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Checklist Viewer */
.checklist-viewer {
    padding: 24px;
    height: 100%;
    overflow: auto;
    background: var(--fluent-bg-primary);
}

.checklist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--fluent-border);
}

.checklist-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--fluent-text-primary);
}

.score-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgba(0, 120, 212, 0.1) 0%, rgba(0, 120, 212, 0.05) 100%);
    border-radius: 8px;
}

.score-label {
    font-size: 14px;
    color: var(--fluent-text-secondary);
    font-weight: 500;
}

.score-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--fluent-primary);
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checklist-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checklist-item:hover {
    border-color: var(--fluent-primary);
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.checklist-checkbox {
    width: 20px;
    height: 20px;
    margin-right: 16px;
    cursor: pointer;
    accent-color: var(--fluent-primary);
}

.checklist-label {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.task-description {
    font-size: 14px;
    color: var(--fluent-text-primary);
}

.task-points {
    font-size: 13px;
    font-weight: 600;
    color: var(--fluent-primary);
    background: rgba(0, 120, 212, 0.1);
    padding: 4px 12px;
    border-radius: 12px;
}

/* Student Info Viewer */
.student-info-viewer {
    padding: 24px;
    height: 100%;
    overflow: auto;
    background: var(--fluent-bg-primary);
}

.info-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
}

.info-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
    background: linear-gradient(135deg, #0078d4 0%, #106ebe 100%);
    color: white;
}

.student-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.student-details h3 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
}

.student-details p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.info-section {
    padding: 24px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--fluent-border);
}

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

.info-label {
    font-size: 14px;
    color: var(--fluent-text-secondary);
    font-weight: 500;
}

.info-value {
    font-size: 14px;
    color: var(--fluent-text-primary);
    font-weight: 500;
}

.status-badge {
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending {
    background: rgba(255, 140, 0, 0.15);
    color: #ff8c00;
}

.status-graded {
    background: rgba(16, 124, 16, 0.15);
    color: #107c10;
}

/* Results Panel */
.results-panel {
    background: var(--card-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid var(--fluent-border);
    transition: all 0.3s ease;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.results-panel.collapsed {
    height: 40px;
}

.results-panel.expanded {
    height: 250px;
}

.results-header {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    background: var(--glass-bg-subtle);
    border-bottom: 1px solid var(--fluent-border);
    cursor: pointer;
    user-select: none;
}

.results-header:hover {
    background: var(--glass-bg-hover);
}

.results-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fluent-text-primary);
}

.results-title .e-icons {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.results-count {
    font-size: 12px;
    color: var(--fluent-text-secondary);
    font-weight: 500;
    background: rgba(0, 120, 212, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

.results-content {
    height: calc(100% - 40px);
    overflow: auto;
}

.results-tabs {
    height: 100%;
}

/* Validation Results */
.validation-results {
    padding: 16px;
}

.validation-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 3px solid;
}

.validation-item.severity-error {
    background: rgba(220, 53, 69, 0.05);
    border-left-color: #dc3545;
}

.validation-item.severity-warning {
    background: rgba(255, 140, 0, 0.05);
    border-left-color: #ff8c00;
}

.validation-item.severity-success {
    background: rgba(16, 124, 16, 0.05);
    border-left-color: #107c10;
}

.validation-item.severity-info {
    background: rgba(0, 120, 212, 0.05);
    border-left-color: #0078d4;
}

.validation-icon {
    font-size: 20px;
    line-height: 1;
}

.validation-content {
    flex: 1;
}

.validation-message {
    font-size: 13px;
    color: var(--fluent-text-primary);
    margin-bottom: 4px;
}

.validation-location {
    font-size: 12px;
    color: var(--fluent-text-secondary);
    font-family: 'Consolas', monospace;
}

/* Output Viewer */
.output-viewer {
    padding: 16px;
    height: 100%;
}

.output-content {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    color: var(--fluent-text-primary);
    background: var(--glass-bg-subtle);
    padding: 16px;
    border-radius: 6px;
    margin: 0;
    white-space: pre-wrap;
    border: 1px solid var(--fluent-border);
}

/* Syncfusion Overrides for Modern Look */
.e-ribbon {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.e-ribbon .e-ribbon-tab {
    border-radius: 6px 6px 0 0;
}

.e-splitter .e-split-bar {
    background: var(--fluent-border);
}

.e-splitter .e-split-bar:hover {
    background: var(--fluent-primary);
}

/* Sidebar Tab Styles - minimal overrides for layout only */
.sidebar-panel .e-tab {
    height: 100%;
}

.sidebar-panel .e-tab .e-content {
    flex: 1;
    overflow: hidden;
}

.sidebar-panel .e-tab .e-item {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.tab-content {
    padding: 2px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

/* Special handling for submission tree - let it manage its own scrolling */
.tab-content.submission-tree-panel {
    padding: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important; /* Allow inner scroll container to manage scrollbars */
}

.tab-content.submission-tree-panel > .submission-tree-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Assignment Files List */
.assignment-toolbar {
    padding: 8px;
    border-bottom: 1px solid var(--fluent-border);
    background: var(--glass-bg-subtle);
}

.btn-small {
    background: var(--card-bg);
    border: 1px solid var(--fluent-border);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fluent-text-primary);
}

.btn-small:hover {
    background: var(--fluent-primary);
    color: white;
    border-color: var(--fluent-primary);
}

.btn-small .e-icons {
    font-size: 14px;
}

/* Clean assignment list styling - matches WPF layout */
.assignment-list {
    background: transparent;
    border: none;
    margin: 0px;
}

.assignment-list .e-list-parent {
    background: transparent;
    border: none;
}

/* Hide checkboxes but maintain functionality */
.assignment-list .e-checkbox-wrapper,
.assignment-list .e-frame,
.assignment-list .e-check {
    display: none !important;
}

/* List item styling - clean and compact like WPF */
.assignment-list .e-list-item {
    padding: 3px 2px !important;
    margin: 0 !important;
    cursor: pointer;
    transition: background 0.15s ease;
    border: none !important;
    border-radius: 0 !important;
    background: transparent;
    min-height: 22px;
    display: flex !important;
    align-items: center !important;
}

.assignment-list .e-list-item:hover {
    background: rgba(0, 120, 212, 0.05) !important;
}

.assignment-list .e-list-item.e-active {
    background: rgba(0, 120, 212, 0.15) !important;
}

.assignment-list .e-list-text {
    flex: 1 !important;
    width: auto !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
}

/* Assignment File Item with Tags - simplified flat structure */
.assignment-file-item {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    min-width: 0;
    margin: 0;
    padding: 0;
    flex-direction: row !important;
    gap: 6px;
}

/* Tag icon - fixed width on left */
.assignment-file-item .tag-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* File icon - fixed width */
.assignment-file-item .file-icon {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: var(--fluent-primary);
    flex-shrink: 0;
}

/* File name - stretches to fill remaining width */
.assignment-file-item .file-name {
    flex: 1;
    font-size: 13px;
    color: var(--fluent-text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--fluent-text-secondary);
}

.empty-message {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 8px 0;
    color: var(--fluent-text-muted);
}

.empty-hint {
    font-size: 12px;
    margin: 0;
    color: var(--fluent-text-muted);
}

/* TreeView in Tab Styling */
.tab-content .custom-treeview {
    background: transparent;
}

.tab-content .custom-treeview .e-list-item {
    padding: 6px 10px;
    font-size: 13px;
}

.tab-content .custom-treeview .e-text-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-content .custom-treeview .e-icons {
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .results-panel.expanded {
        height: 200px;
    }

    .checklist-viewer,
    .student-info-viewer {
        padding: 16px;
    }

    .tab-content {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .ribbon-container {
        font-size: 12px;
    }

    .results-panel.expanded {
        height: 150px;
    }

    .tab-content {
        max-height: none;
    }
}
