/* Base styles */
html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  background-color: #f5f5f5;
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}


/* Layout */
.main-container {
    height: calc(100vh - 56px);
    overflow: hidden;
}

#splitContainer {
    width: 100%;
    height: 100%;
}

.sidebar {
    height: 100%;
    overflow-y: auto;
    background-color: #ffffff;
    border-right: 1px solid #e0e0e0;
    padding: 8px;
}

/* Split.js gutter styles */
.gutter {
    background-color: #f0f0f0;
    background-repeat: no-repeat;
    background-position: 50%;
}

.gutter.gutter-horizontal {
    background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAeCAYAAADkftS9AAAAIklEQVQoU2M4c+bMfxAGAgYYmwGrIIiDjrELjpo5aiZeMwF+yNnOs5KSvgAAAABJRU5ErkJggg==');
    cursor: col-resize;
}

.gutter:hover {
    background-color: #e0e0e0;
}

.main-panel {
    height: 100%;
    background-color: #ffffff;
}

/* Student Card Styles */
.student-card-wrapper {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.student-card-wrapper:hover {
    border-color: #2196F3;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.student-card-wrapper.selected {
    border-color: #2196F3;
    border-width: 2px;
    background-color: #f0f7ff;
}

/* Re-Grade All highlighting */
.student-card-wrapper.regrade-all-current {
    border-color: #ffc107 !important;
    border-width: 3px !important;
    background-color: #fff3cd !important;
    animation: currentCardPulse 1.5s ease-in-out infinite;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3) !important;
    transform: translateY(-2px);
}

.student-card-wrapper.regrade-all-completed {
    border-color: #28a745 !important;
    border-width: 2px !important;
    background-color: #d4edda !important;
    opacity: 0.8;
}

.student-card-wrapper.regrade-all-completed::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    color: #28a745;
    font-weight: bold;
    font-size: 16px;
    animation: checkmarkAppear 0.5s ease-out;
}

@keyframes currentCardPulse {
    0%, 100% { 
        box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
        transform: translateY(-2px);
    }
    50% { 
        box-shadow: 0 6px 16px rgba(255, 193, 7, 0.5);
        transform: translateY(-3px);
    }
}

@keyframes checkmarkAppear {
    from { 
        opacity: 0; 
        transform: scale(0.5) rotate(180deg); 
    }
    to { 
        opacity: 1; 
        transform: scale(1) rotate(0deg); 
    }
}

.student-card-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.student-info {
    flex: 1;
}

.student-name {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.student-status {
    font-size: 12px;
    color: #666;
    display: flex;
    align-items: center;
}

.status-text {
    margin-left: 4px;
}

.score-badge-wrapper {
    display: flex;
    align-items: center;
}

.score-badge {
    background-color: #2196F3;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

/* PDF Viewer Styles */
.pdf-panel, #pdfPanel {
    height: 100%;
    overflow: hidden;
    background-color: #f8f8f8;
    padding: 0;
    margin: 0;
}

.pdf-panel > div, #pdfPanel > div {
    height: 100%;
    padding: 0;
    margin: 0;
}

#pdfViewer {
    height: 100%;
    width: 100%;
    padding: 0;
    margin: 0;
}

#pdfViewer iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.pdf-viewer-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.pdf-info-bar {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 12px;
    font-size: 14px;
}

.pdf-content-area {
    flex: 1;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pdf-placeholder {
    text-align: center;
    padding: 40px;
}

.pdf-icon {
    font-size: 64px;
    color: #dc3545;
    margin-bottom: 16px;
}

.pdf-title {
    color: #333;
    margin-bottom: 8px;
}

.pdf-subtitle {
    color: #666;
    margin-bottom: 12px;
}

.pdf-path {
    color: #999;
    font-size: 12px;
}

.pdf-empty-state {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #999;
}

/* Grading Panel Styles */
.grading-panel, #gradingPanel {
    height: 100%;
    overflow-y: auto;
    background-color: #f8f8f8;
    padding: 16px;
}

#gradingContent {
    height: 100%;
}

/* Grading Summary Card */
.grading-summary-card {
    background: white;
    border-radius: 8px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.grading-summary-header {
    background-color: #2196F3;
    color: white;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    font-size: 16px;
}

.grading-summary-body {
    padding: 16px;
}

.summary-row {
    display: flex;
    gap: 24px;
    margin-bottom: 16px;
}

.summary-item {
    flex: 1;
}

.summary-item label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
    display: block;
    margin-bottom: 6px;
}

.score-display {
    font-size: 24px;
    font-weight: 500;
    color: #333;
}

.score-max {
    color: #666;
    font-size: 18px;
}

.percentage-badge {
    display: inline-block;
    background-color: #4CAF50;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.status-badge.graded {
    background-color: #17a2b8;
    color: white;
}

.feedback-section {
    margin-top: 16px;
}

.feedback-section label {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    display: block;
    margin-bottom: 8px;
}

.feedback-text {
    background-color: #f8f9fa;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

/* Detailed Grading Card */
.detailed-grading-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.detailed-grading-header {
    background-color: #6c757d;
    color: white;
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    font-weight: 500;
    font-size: 16px;
}

.detailed-grading-body {
    padding: 0;
}

.grading-table {
    width: 100%;
    border-collapse: collapse;
}

.criterion-row {
    border-bottom: 1px solid #e0e0e0;
}

.criterion-row td {
    padding: 12px 16px;
    vertical-align: middle;
}

.criterion-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
    width: 50%;
}

.criterion-score {
    text-align: right;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.criterion-max {
    text-align: left;
    font-size: 14px;
    color: #666;
    padding-left: 4px !important;
}

.criterion-percentage {
    text-align: right;
    font-size: 12px;
    color: #666;
}

.feedback-row td {
    padding: 0 16px 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.criterion-feedback {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    background-color: #f8f9fa;
    padding: 8px 12px;
    border-radius: 4px;
}

/* File Sub-Navigation */
#fileSubNav {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Re-Grade Button Styling */
#regradeBtn {
    border: 1px solid #28a745;
    box-shadow: inset 0 0 0 0.5px #28a745;
    color: #28a745;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#regradeBtn:hover {
    background-color: #28a745;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.3);
}

#regradeBtn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

/* Add a subtle animation to draw attention */
#regradeBtn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(40, 167, 69, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

#regradeBtn:hover::before {
    width: 100px;
    height: 100px;
}

/* Icon animation on hover */
#regradeBtn:hover i {
    animation: rotate 0.5s ease-in-out;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/* Top Navigation Button Styling */
.navbar .btn-outline-light {
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: inset 0 0 0 0.5px rgba(255,255,255,0.4);
    color: white;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.navbar .btn-outline-light:hover {
    background-color: rgba(255,255,255,0.2);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 255, 255, 0.2);
}

.navbar .btn-outline-light:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(255, 255, 255, 0.2);
}

/* Add ripple effect */
.navbar .btn-outline-light::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.navbar .btn-outline-light:hover::before {
    width: 100px;
    height: 100px;
}

/* Icon animations for each button */
.navbar .btn-outline-light:hover i.fa-edit {
    animation: editPulse 0.5s ease-in-out;
}

.navbar .btn-outline-light:hover i.fa-redo {
    animation: rotate 0.5s ease-in-out;
}

.navbar .btn-outline-light:hover i.fa-download {
    animation: downloadBounce 0.5s ease-in-out;
}

@keyframes editPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Navigation bar adjustments */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: 500;
}

/* Button styles */
.btn-outline-light {
    border-color: rgba(255,255,255,0.5);
}

.btn-outline-light:hover {
    background-color: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.8);
}

/* Panel styles */
#contentSplitContainer {
    width: 100%;
    background-color: #f8f8f8;
}

/* Override Bootstrap focus styles */
.btn:focus, .btn:active:focus {
    box-shadow: none !important;
}

/* JavaScript interaction classes */
.student-card {
    cursor: pointer;
}

/* Category selection styles for rubric editor */
.card[data-category-index] {
    cursor: pointer;
    transition: all 0.2s ease;
}

.card[data-category-index]:hover {
    border-color: #2196F3;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.card[data-category-index].selected {
    border-color: #2196F3;
    border-width: 2px;
    background-color: #f0f7ff;
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
}

/* Rubric Editor Alignment Styles */
.rubric-controls-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rubric-points-input {
    width: 80px !important;
    flex-shrink: 0;
}

.rubric-points-label {
    white-space: nowrap;
    margin-bottom: 0;
    font-weight: 500;
    color: #495057;
}

/* Ensure consistent button spacing in rubric editor */
.btn-group-rubric {
    display: flex;
    gap: 4px;
    align-items: center;
}

/* Integrated delete icon styles */
.position-relative .btn-link.text-danger {
    opacity: 0.6;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.position-relative .btn-link.text-danger:hover {
    opacity: 1;
    color: #dc3545 !important;
}

.position-relative .btn-link.text-danger:focus {
    box-shadow: none;
    outline: none;
}

/* Ensure delete icons are properly positioned for textareas that grow */
.position-relative textarea + .btn-link.text-danger {
    top: 8px !important;
    align-self: flex-start;
}

/* Add some breathing room to inputs with integrated delete icons */
.pe-5 {
    padding-right: 2.5rem !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .main-container {
        height: auto;
    }
    
    .sidebar {
        height: auto;
        max-height: 300px;
    }
    
    .pdf-panel, .grading-panel {
        height: 500px;
    }
    
    .summary-row {
        flex-direction: column;
        gap: 12px;
    }
}