/* Student Grades Styles */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
}

.font-inter {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Course Cards - Enhanced Gradebook Style */
.course-card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    border: 1px solid #e5e7eb;
    transition: all 0.2s;
    cursor: pointer;
    overflow: hidden;
    min-height: 320px;
    display: flex;
    flex-direction: column;
}

.course-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateY(-4px);
}

.course-card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    padding-bottom: 1rem;
}

.course-icon {
    height: 4rem;
    width: 4rem;
    border-radius: 0.75rem;
    background: linear-gradient(to bottom right, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.course-icon i {
    color: white;
}

.course-code {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
}

.course-name {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin-bottom: 1rem;
    line-height: 1.625;
}

.course-details {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.course-details .detail-item {
    display: inline-block;
    margin: 0 0.25rem;
}

.course-details .detail-item i {
    margin-right: 0.25rem;
    color: #d1d5db;
}

.course-stats {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background-color: #f9fafb;
    border-top: 1px solid #f3f4f6;
}

.course-stat {
    text-align: center;
    flex: 1;
}

.course-stat:first-child {
    text-align: center;
}

.course-stat-label {
    color: #6b7280;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
}

.course-stat-value {
    font-weight: 700;
    color: #111827;
    font-size: 1.125rem;
    margin-top: 0.25rem;
}

.course-grade-section {
    padding: 1.5rem;
    padding-top: 1rem;
    text-align: center;
}

.course-grade {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.course-grade.excellent {
    color: #059669;
}

.course-grade.good {
    color: #2563eb;
}

.course-grade.average {
    color: #d97706;
}

.course-grade.poor {
    color: #ea580c;
}

.course-grade.danger {
    color: #dc2626;
}

.grade-progress {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    height: 0.75rem;
    margin-bottom: 0.5rem;
}

.grade-progress-bar {
    height: 0.75rem;
    border-radius: 9999px;
    transition: all 0.3s;
}

.grade-progress-excellent {
    background: linear-gradient(to right, #10b981, #059669);
}

.grade-progress-good {
    background: linear-gradient(to right, #3b82f6, #2563eb);
}

.grade-progress-average {
    background: linear-gradient(to right, #f59e0b, #d97706);
}

.grade-progress-poor {
    background: linear-gradient(to right, #f97316, #ea580c);
}

.grade-progress-danger {
    background: linear-gradient(to right, #ef4444, #dc2626);
}

/* Report Card Styling - Gradebook Style */
.report-card {
    @apply bg-white rounded-lg shadow-sm border border-gray-200 overflow-hidden;
}

.report-card-header {
    @apply bg-gradient-to-r from-blue-600 to-purple-600 text-white p-6;
}

.report-card-body {
    @apply p-6;
}

.overall-grade-display {
    @apply text-center mb-8;
}

.overall-grade-number {
    @apply text-6xl font-bold mb-2;
}

.overall-grade-label {
    @apply text-lg text-gray-600 uppercase tracking-wide;
}

.category-section {
    @apply mb-8;
}

.category-header {
    @apply bg-gray-50 px-6 py-4 border-b border-gray-200 font-semibold text-gray-900 text-lg;
}

.assignment-row {
    @apply border-b border-gray-100 hover:bg-gray-50 transition-colors;
}

.assignment-row:last-child {
    @apply border-b-0;
}

.assignment-cell {
    @apply px-6 py-4 text-sm;
}

.assignment-name {
    @apply font-semibold text-gray-900 text-base;
}

.assignment-weight {
    @apply text-xs text-gray-500 mt-1;
}

.assignment-grade {
    @apply font-bold text-lg;
}

.assignment-grade.excellent {
    @apply text-green-600;
}

.assignment-grade.good {
    @apply text-blue-600;
}

.assignment-grade.average {
    @apply text-yellow-600;
}

.assignment-grade.poor {
    @apply text-orange-600;
}

.assignment-grade.danger {
    @apply text-red-600;
}

.assignment-grade.missing {
    @apply text-gray-400;
}

.assignment-due-date {
    @apply text-gray-600;
}




/* Animations */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

.scale-in {
    animation: scaleIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Loading States */
.loading {
    @apply opacity-50 pointer-events-none;
}

.skeleton {
    @apply animate-pulse bg-gray-200 rounded;
}

/* Toast Notifications */
.toast {
    @apply max-w-sm w-full bg-white shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden;
}

.toast-success {
    @apply border-l-4 border-green-400;
}

.toast-error {
    @apply border-l-4 border-red-400;
}

.toast-warning {
    @apply border-l-4 border-yellow-400;
}

.toast-info {
    @apply border-l-4 border-blue-400;
}

/* Dropdown Menu */
.dropdown {
    @apply relative;
}

.dropdown-menu {
    @apply absolute right-0 z-10 mt-2 w-48 origin-top-right rounded-md bg-white py-1 shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none;
}

.dropdown-item {
    @apply block px-4 py-2 text-sm text-gray-700 hover:bg-gray-100 cursor-pointer;
}

/* Responsive Design */
@media (max-width: 640px) {
    .course-card {
        @apply p-4;
    }
    
    .course-icon {
        @apply h-10 w-10 text-lg;
    }
    
    .course-grade {
        @apply text-xl;
    }
    
    .report-card-body {
        @apply p-4;
    }
    
    .assignment-cell {
        @apply px-2 py-2 text-xs;
    }
}

/* Print styles */
@media print {
    .no-print {
        @apply hidden;
    }
    
    .print-only {
        @apply block;
    }
    
    .course-card {
        @apply shadow-none border border-gray-300;
    }
    
    .report-card {
        @apply shadow-none border border-gray-300;
    }
}

/* Focus states for accessibility */
*:focus {
    @apply outline-none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    @apply ring-2 ring-blue-500 ring-offset-2;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Assignment Card Layout Enhancements */
.assignment-card {
    @apply flex items-center justify-between p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors;
}

.assignment-info {
    @apply flex-1;
}

.assignment-title {
    @apply font-semibold text-gray-900 text-base mb-1;
}

.assignment-dates {
    @apply text-sm text-gray-500;
}

.assignment-score-detail {
    @apply text-xs text-gray-400 mt-1;
}

.assignment-grade-display {
    @apply ml-4 text-right;
}

.assignment-grade-large {
    @apply text-2xl font-bold;
}

/* Recent Grades Section - Enhanced Gradebook Style */
.recent-assignments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .recent-assignments-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .recent-assignments-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.recent-assignment-card {
    background-color: white;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: all 0.2s;
    overflow: hidden;
    min-height: 180px;
    display: flex;
    flex-direction: column;
}

.recent-assignment-card:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transform: translateY(-4px);
}

.recent-assignment-card.overdue {
    border-color: #fca5a5;
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
}

.recent-assignment-card.overdue:hover {
    border-color: #f87171;
    background-color: #fee2e2;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    transform: translateY(-4px);
}

.assignment-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    padding-bottom: 1rem;
}

.assignment-title {
    font-weight: 700;
    color: #111827;
    font-size: 1.125rem;
    line-height: 1.25;
    flex: 1;
    margin-right: 12px;
}

.assignment-course {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1d4ed8;
    background-color: #dbeafe;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    white-space: nowrap;
}

.assignment-details {
    padding: 0 1.5rem 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.assignment-due-date {
    font-size: 0.875rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.assignment-due-date i {
    margin-right: 0.5rem;
    color: #9ca3af;
}

.assignment-grade-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.assignment-grade {
    font-size: 1.5rem;
    font-weight: 700;
}

.assignment-grade.excellent {
    color: #059669;
}

.assignment-grade.good {
    color: #2563eb;
}

.assignment-grade.average {
    color: #d97706;
}

.assignment-grade.poor {
    color: #ea580c;
}

.assignment-grade.danger {
    color: #dc2626;
}

.assignment-grade.missing {
    color: #9ca3af;
}

.assignment-score-detail {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.5rem;
    padding: 0 1.5rem 1rem 1.5rem;
}

.assignment-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.assignment-status-overdue {
    background-color: #fee2e2;
    color: #991b1b;
}

.assignment-status-upcoming {
    background-color: #dcfce7;
    color: #166534;
}

.assignment-status-completed {
    background-color: #dbeafe;
    color: #1e40af;
}

/* Overdue assignment special styling */
.recent-assignment-card.overdue .assignment-title {
    color: #991b1b;
}

.recent-assignment-card.overdue .assignment-due-date {
    color: #dc2626;
}

.recent-assignment-card.overdue .assignment-due-date i {
    color: #ef4444;
}

.recent-assignment-card.overdue .assignment-grade.missing {
    color: #ef4444;
    font-weight: 700;
}

/* Responsive adjustments for recent grades */
@media (max-width: 768px) {
    .recent-assignments-grid {
        @apply grid-cols-1 gap-4;
    }
    
    .recent-assignment-card {
        min-height: 160px;
    }
    
    .assignment-card-header {
        @apply p-4 pb-3;
    }
    
    .assignment-details {
        @apply px-4 pb-3;
    }
    
    .assignment-score-detail {
        @apply px-4 pb-3;
    }
    
    .assignment-title {
        @apply text-base;
    }
    
    .assignment-grade {
        @apply text-xl;
    }
}

/* Overdue Tasks Section */
.overdue-tasks-section {
    border-left: 4px solid #ef4444;
}

.overdue-task-item {
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    transition: all 0.2s;
}

.overdue-task-item:hover {
    background-color: #fee2e2;
    border-color: #fca5a5;
}

/* Assignment percentage breakdown styling */
.assignment-percentage-breakdown {
    color: #2563eb;
    font-weight: 500;
}

/* Responsive adjustments for course cards */
@media (max-width: 640px) {
    .course-card {
        @apply p-4;
        min-height: 280px;
    }
    
    .course-card-header {
        @apply p-4 pb-3;
    }
    
    .course-stats {
        @apply px-4 py-2;
    }
    
    .course-grade-section {
        @apply p-4 pt-3;
    }
    
    .course-icon {
        @apply h-12 w-12 text-lg mb-3;
    }
    
    .course-grade {
        @apply text-3xl;
    }
}

/* Rubric Modal Styles */
#rubricBreakdownModal {
    backdrop-filter: blur(4px);
}

#rubricBreakdownModal .bg-white {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Rubric table styling */
.rubric-table {
    @apply w-full border-collapse;
}

.rubric-table th {
    @apply px-4 py-3 text-left text-xs font-medium text-gray-700 uppercase tracking-wider border-b border-gray-200 bg-gray-50;
}

.rubric-table td {
    @apply px-4 py-3 text-sm border-b border-gray-100;
}

.rubric-table tbody tr:hover {
    @apply bg-gray-50;
}

/* Sticky header for rubric modal */
#rubricBreakdownModal .sticky {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

#rubricBreakdownModal thead.sticky th {
    background-color: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
}

/* Answer styling */
.answer-correct {
    @apply bg-green-100 text-green-800 px-2 py-1 rounded-full text-sm font-medium;
}

.answer-incorrect {
    @apply bg-red-100 text-red-800 px-2 py-1 rounded-full text-sm font-medium;
}

.answer-partial {
    @apply bg-yellow-100 text-yellow-800 px-2 py-1 rounded-full text-sm font-medium;
}

/* Category collapse/expand styling */
.category-icon {
    transition: transform 0.2s ease-in-out;
}

.category-assignments {
    transition: opacity 0.2s ease-in-out, max-height 0.3s ease-in-out;
    overflow: hidden;
}

.category-assignments.hidden {
    opacity: 0;
    max-height: 0;
    margin-top: 0;
}
}

/* Score styling */
.score-correct {
    @apply text-green-600 font-bold;
}

.score-incorrect {
    @apply text-red-600 font-bold;
}

.score-partial {
    @apply text-yellow-600 font-bold;
}

/* Section headers */
.rubric-section-header {
    @apply bg-gray-100 px-4 py-3 text-sm font-semibold text-gray-900 border-b border-gray-200;
}

/* Total row styling */
.rubric-total-row {
    @apply bg-gray-50 border-t-2 border-gray-300;
}

.rubric-total-row td {
    @apply font-bold;
}

/* Hover effects for clickable assignments */
.assignment-with-rubric {
    @apply cursor-pointer transition-all duration-200;
}

.assignment-with-rubric:hover {
    @apply bg-blue-50 border-blue-200;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* Rubric icon styling */
.rubric-icon {
    @apply text-blue-500 ml-2 transition-colors duration-200;
}

.assignment-with-rubric:hover .rubric-icon {
    @apply text-blue-600;
}

/* Modal animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#rubricBreakdownModal .bg-white {
    animation: modalSlideIn 0.2s ease-out;
}

/* Responsive modal adjustments */
@media (max-width: 768px) {
    #rubricBreakdownModal .max-w-4xl {
        @apply max-w-full mx-2;
    }
    
    .rubric-table th,
    .rubric-table td {
        @apply px-2 py-2 text-xs;
    }
    
    .rubric-table th:first-child,
    .rubric-table td:first-child {
        @apply min-w-0;
    }
}

/* Section Header and Collapse Styles */
.section-header {
    user-select: none;
}

.section-header .section-icon {
    transition: transform 0.2s ease;
}

.section-question {
    transition: opacity 0.2s ease;
}

/* Light indentation for questions within sections */
.section-question td:first-child {
    padding-left: 2rem !important;
}