/* Global Styles */
:root {
    /* Default theme — "Coffee" (the ΤΟΜΗ brand look) */
    --primary-color: #5a3a22;
    --secondary-color: #9b6a43;
    --background-light: #f5efe8;
    --background-white: #ffffff;
    --text-color: #2c1e14;
    --footer-bg: #3a2517;

    /* Accents: 1 = high-contrast anchor, 2 = brand highlight, 3 = soft highlight */
    --accent-color-1: #2c1e14;
    --accent-color-2: #c8762d;
    --accent-color-3: #e0a458;

    /* Secondary/muted text + borders + headings (theme-aware) */
    --text-muted: #7a6552;
    --border-color: #e4d8cc;
    --heading-color: #5a3a22;

    /* Typography */
    --base-font-size: 16px;
    --font-family: 'Arial', sans-serif;

    /* Borders and Shadows */
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition-speed: 0.3s;
}

/* Dark theme — charcoal + teal */
[data-theme="dark"] {
    --primary-color: #11161d;
    --secondary-color: #4b5563;
    --background-light: #1c2530;
    --background-white: #263241;
    --text-color: #e8edf2;
    --footer-bg: #0d1117;

    --accent-color-1: #e8edf2;
    --accent-color-2: #2dd4bf;
    --accent-color-3: #fbbf24;

    --text-muted: #9aa7b4;
    --border-color: #36424f;
    --heading-color: #eaf1f8;

    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Light theme — lavender / violet */
[data-theme="light"] {
    --primary-color: #6d28d9;
    --secondary-color: #9d6ae0;
    --background-light: #f6f3fc;
    --background-white: #ffffff;
    --text-color: #2a2433;
    --footer-bg: #4c1d95;

    --accent-color-1: #2a2433;
    --accent-color-2: #db2777;
    --accent-color-3: #f59e0b;

    --text-muted: #6f6880;
    --border-color: #e7ddf5;
    --heading-color: #6d28d9;
}

/* Blue theme — ocean / azure */
[data-theme="blue"] {
    --primary-color: #1d4ed8;
    --secondary-color: #3b82f6;
    --background-light: #eaf2fe;
    --background-white: #ffffff;
    --text-color: #14233f;
    --footer-bg: #15326b;

    --accent-color-1: #14233f;
    --accent-color-2: #06b6d4;
    --accent-color-3: #f59e0b;

    --text-muted: #5e7297;
    --border-color: #d3e2f7;
    --heading-color: #1d4ed8;
}


body {
    font-family: var(--font-family);
    font-size: var(--base-font-size);
    background-color: var(--background-light);
    color: var(--text-color);
    margin: 0;
    padding: 0;
}
.students-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.students-table th, .students-table td {
    border: 1px solid var(--primary-color);
    padding: 8px;
    text-align: left;
}

.students-table th {
    background-color: var(--secondary-color);
    color: white;
}

.course-list {
    list-style: none;
    padding: 0;
}

.course-list li {
    background: var(--background-white);
    padding: 10px;
    margin: 5px 0;
    border-left: 5px solid var(--primary-color);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}
.main-content {
    flex: 1;
    padding: 20px;
}

.loading-container {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
}
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--primary-color);
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}


/* Navigation Bar Styles */
.top-nav {
    background-color: var(--primary-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-family);
    font-size: var(--base-font-size);
}

/* Menu Button Styles */
.menu-button {
    background-color: transparent;
    border: none;
    color: var(--background-white);
    font-size: 24px;
    cursor: pointer;
    display: none; /* Hide by default for larger screens */
}

.menu-button:hover {
    color: var(--text-muted);
}

/* Navigation Links Styles */
.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.nav-links li {
    color: var(--background-white);
    cursor: pointer;
    transition: color 0.3s ease;
}

.nav-links li:hover {
    color: var(--text-muted);
}

.nav-links li a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links li a i {
    font-size: 18px;
}




.student-program-section {
    color: white;
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}
.student-program-section h2{
    color: var(--text-color);
}
.table-container {
    max-width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.weekly-schedule {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9em;
}

.weekly-schedule th {
    background-color: var(--primary-color);
    padding: 10px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.weekly-schedule td {
    border: 1px solid black;
    height: 50px;
    vertical-align: center;
}

.hour-label {
    background-color: var(--primary-color);
    font-weight: bold;
    text-align: center;
    padding: 5px;
    white-space: nowrap;
    border: none !important ;
}

.course-slot {
    background-color: var(--background-white);
    padding: 0 !important;
    position: relative;
    transition: 0.3s;

}

.course-blocks {
    cursor: pointer;
    color: var(--text-color);
    padding: 5px;
    height: 100%;
    overflow: hidden;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    word-break: break-word;
}
.course-blocks:hover{
    color: var(--accent-color-1);

}
.course-slot:hover {
    scale: 115%;
    z-index: 100;
    background-color: var(--accent-color-2);
    border-radius: 15px;
}

.course-block.inactive {
    opacity: 0.7;
    background-color: var(--background-light);
}
.course-tooltip {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: var(--background-white);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    border: 1px solid #e0e0e0;
    /* Arrow styling */
    margin-top: 10px;
}

.course-tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent white transparent;
}

.course-blocks:hover .course-tooltip {
    opacity: 1;
    visibility: visible;
    top: calc(100% + 5px);
    z-index: 100;
}

.course-tooltip h4 {
    margin: 0 0 10px 0;
    color: var(--heading-color);
    font-size: 1.1em;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.tooltip-row {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 0.9em;
}

.tooltip-row i {
    width: 20px;
    color: #3498db;
    margin-right: 10px;
    text-align: center;
}

.tooltip-notes {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #eee;
    font-size: 0.85em;
    color: #7f8c8d;
}
/* Responsive adjustments */
@media (max-width: 768px) {
    .weekly-schedule {
        font-size: 0.8em;
    }
    
    .hour-label {
        padding: 5px 2px;
    }
}



/* .weekly-schedule {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}
.student-program-section{
    width: 100%;
    overflow-x: auto;
    margin-top: 20px;
}
.weekly-schedule th, .weekly-schedule td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.weekly-schedule th {
    background-color: var(--primary-color);
    color: white;
}

.weekly-schedule td {
    background-color: var(--background-white);
}

.inactive-class {
    background-color: var(--background-light);
    color: var(--text-muted);
} */
.edit_info{
    position: relative;
    scale: 150%;
    cursor: pointer;
    float:right;
    margin-right: 20px;
    margin-top: -20px;
}
/* Modal background */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensures it appears above other elements */
}

/* Modal content */
.modal-content {
    background: var(--background-white);
    padding: 20px;
    border-radius: 10px;
    width: 350px;
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    animation: fadeIn 0.3s ease-in-out;
}

/* Close button (X) */
.close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: var(--text-color);
    transition: 0.3s ease;
}

.close:hover {
    scale: 120%;
    color: red;
}

/* Input fields */
.modal-content input {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 16px;
}

/* Save button */
#save_teacher {
    width: 100%;
    padding: 10px;
    background: var(--secondary-color); /* Green button */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.3s ease;
}

#save_teacher:hover {
    background: var(--primary-color); /* Darker green on hover */
}
/* Grid layout for courses */
.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

/* Course block style */
.course-block {
    background: #007bff;
    color: white;
    padding: 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: 0.3s;
    text-align: center;
}

.course-block:hover {
    background: #0056b3;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    background: #ddd;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.progress {
    height: 20px;
    background: #28a745;
    width: 0;
}

/* Student grid */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

/* Student block */
.student-block {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: 0.3s;
}

.student-block:hover {
    background: var(--secondary-color);
}

/* Missing tests */
.missing {
    color: red;
    font-weight: bold;
}

/* Grade input */
#gradeInput {
    display: block;
    margin: 10px 0;
    padding: 5px;
    font-size: 16px;
    width: 100px;
}

#saveGrade {
    background: #28a745;
    color: white;
    padding: 20px;
    border: none;
    cursor: pointer;
    transition: 0.3s;
}

#saveGrade:hover {
    background: #218838;
}
/* General styling for the content section */
#content-section {
    font-family: Arial, sans-serif;
    padding: 20px;
    background-color: var(--background-light);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Styling for the student name and course title */
#content-section h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    font-size: 24px;
}

/* Styling for the grade input and save button */
#content-section label {
    font-weight: bold;
    margin-right: 10px;
}

#content-section #gradeInput {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    width: 60px;
}

#content-section #saveGrade {
    padding: 5px 10px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
}

#content-section #saveGrade:hover {
    background-color: #45a049;
}

/* Styling for the completed tests section */


#content-section ul {
    list-style-type: none;
    padding: 0;
}

#content-section ul li {
    padding: 5px 0;
    color: var(--text-color);
}

/* Styling for the missing tests section */
#content-section ul li.missing {
    color: #d9534f; /* Red color for missing tests */
    font-weight: bold;
}

/* Styling for the "No completed tests" and "No missing tests" messages */
#content-section ul li:not(.missing) {
    color: var(--text-muted);
    font-style: italic;
}
.card-header1 h3{
    color: var(--background-light);
}
.card-footer{
    color: var(--background-light);
}
.course-card {
    background: var(--secondary-color);
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    cursor: pointer;
    transition: 0.3s;
}

.course-card:hover {
    transform: translateY(-3px);
    background: var(--primary-color);
}
.course-card:hover .card-footer{
    color: white;
}
.course-card:hover .progress-bar{
    background-color: var(--secondary-color);
}
.course-card:hover .card-header{
    color: white;
}

.progress-container {
    height: 8px;
    background: var(--background-light);
    border-radius: 4px;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    background: var(--primary-color);
    transition: width 0.5s ease;
}
/* Progress pill styles */
.pill {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.progress-high {
    background-color: #4CAF50; /* Green */
}

.progress-medium {
    background-color: #FFC107; /* Yellow */
}

.progress-low {
    background-color: #F44336; /* Red */
}

/* Student Header */
/* .student-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.back-button {
    background: none;
    border: none;
    font-size: 18px;
    color: #3498db;
    cursor: pointer;
    margin-right: 10px;
    transition: color 0.3s ease;
}

.back-button:hover {
    color: #2980b9;
}

.student-header h2 {
    font-size: 24px;
    color: var(--heading-color);
}

/* Student Details Container */
.student-details-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.student-header {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.student-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.student-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
}

/* Progress Section */
.progress-card {
    display: flex;
    align-items: center;
    gap: 30px;
    background: var(--background-white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.circular-progress {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(var(--secondary-color) var(--progress), #f0f0f0 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.circular-progress::before {
    content: "";
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--background-white);
}


.progress-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.progress-card {
    display: flex;
    align-items: center;
    gap: 30px;
    background: var(--background-white);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.circular-progress {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: conic-gradient(#4CAF50 var(--progress), #e0e0e0 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
}

.circular-progress::before {
    content: "";
    position: absolute;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--background-white);
}

.progress-value {
    position: relative;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-color);
}

.progress-stats {
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

.stat-item {
    display: flex;
    justify-content: space-between;
}

.stat-label {
    font-weight: 600;
    color: var(--text-muted);
}

.stat-value {
    font-weight: bold;
    color: var(--text-color);
}

.grade-value {
    color: #4CAF50;
}

.analytics-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
    margin-top: 20px;
}
.toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: var(--border-radius);
    cursor: pointer;
    margin-bottom: 15px;
    margin-top: 15px;
    font-weight: 500;
    transition: background-color var(--transition-speed) ease;
}
.analytics-section {
    transition: 
        opacity var(--transition-speed) ease,
        max-height var(--transition-speed) ease,
        transform var(--transition-speed) ease;
    transform-origin: top;
}

/* Hidden state */
[aria-expanded="false"] + .analytics-section {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: scaleY(0);
    margin-bottom: 0;
}

[aria-expanded="false"] .toggle-icon {
    transform: rotate(180deg);
}

[aria-expanded="false"] .btn-text {
    content: "Show Analytics";
}

/* Accessibility focus styles */
.toggle-btn:focus-visible {
    outline: 2px solid var(--accent-color-2);
    outline-offset: 2px;
}
.toggle-btn:hover {
    background: var(--secondary-color);
}

.toggle-icon {
    transition: transform var(--transition-speed) ease;
}
.analytics-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.analytics-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.mistakes-card {
    /* Takes less vertical space */
    padding: 16px;
}

.mistakes-compact {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mistake-compact-item {
    background: var(--background-light);
    border-radius: var(--border-radius);
    padding: 12px;
    border-left: 4px solid var(--accent-color-1);
}

.mistake-compact-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.mistake-category {
    font-weight: 600;
    color: var(--heading-color);
    font-size: 0.95rem;
}

.mistake-points {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
}

.mistake-description {
    margin: 0 0 6px 0;
    font-size: 0.9rem;
    color: var(--text-color);
    line-height: 1.4;
}

.mistake-explanation {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.mistake-explanation svg.info-icon {
    flex-shrink: 0;
    margin-top: 2px;
}

.points-lost {
    font-size: 0.9rem;
    color: #ff3b30;
    font-weight: 500;
    margin-left: 8px;
}

/* Make the card take less vertical space when few items */
@media (min-width: 768px) {
    .analytics-container {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    }
    
    .mistakes-card {
        grid-row: span 1; /* Takes only one row */
    }
}
.card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--text-muted);
    flex-grow: 1;
}

/* Trends Card Styles */
.trend-grid {
    display: grid;
    gap: 16px;
}

.trend-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trend-label {
    font-weight: 500;
    color: var(--text-muted);
}

.trend-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.trend-badge.improved, .trend-badge.positive {
    background-color: rgba(0, 200, 83, 0.1);
    color: #00c853;
}

.trend-badge.declined, .trend-badge.negative {
    background-color: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.trend-arrow {
    margin-left: 4px;
}

.confidence-meter {
    width: 120px;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.meter-bar {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: var(--accent-color-2);
    border-radius: 4px;
}

.meter-value {
    position: absolute;
    right: -40px;
    top: -6px;
    font-size: 0.9rem;
    color: var(--text-color);
}

/* Engagement Card Styles */
.engagement-score {
    margin-left: auto;
}

.score-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: conic-gradient(var(--accent-color-2) calc(var(--score) * 1%), #f0f0f0 0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.engagement-details {
    background: var(--background-light);
    padding: 12px;
    border-radius: var(--border-radius);
    margin-bottom: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
}

.engagement-tags {
    display: flex;
    gap: 8px;
}

.engagement-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.engagement-tag.high {
    background-color: rgba(0, 200, 83, 0.1);
    color: #00c853;
}

.engagement-tag.medium {
    background-color: rgba(255, 171, 0, 0.1);
    color: #ffab00;
}

.engagement-tag.low {
    background-color: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

/* Recommendations Card Styles */
.recommendations-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 12px;
}

.recommendation-item {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.recommendation-number {
    background: var(--accent-color-2);
    color: white;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
}

.recommendation-text {
    font-size: 0.95rem;
    line-height: 1.4;
    color: var(--text-color);
}

/* Icons */
.trend-icon, .engagement-icon, .recommendations-icon {
    flex-shrink: 0;
}






.progress-value {
    position: relative;
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--heading-color);
}

.progress-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    flex-grow: 1;
}
.stat-item {
    background: var(--background-light);
    padding: 12px;
    border-radius: 8px;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.7;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--heading-color);
}

/* Grade Editor */
.grade-editor {
    background: var(--background-white);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.grade-controls {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.grade-input-container {
    position: relative;
    flex-grow: 1;
}

.grade-input-container input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.grade-scale {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Test Results */
.test-results-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-muted);
}

.tab-btn.active {
    color: var(--text-muted);
    border-bottom-color: var(--secondary-color);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Main container styles */
#completed-tests {
    padding: 20px;
    background-color: var(--background-light);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    font-family: var(--font-family);
}

/* Test item base styles */
.test-item {
    display: flex;
    flex-direction: column;
    background-color: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 16px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.test-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Status indicator bars */
.test-item.submitted {
    border-left: 5px solid var(--accent-color-2); /* Yellow-orange for submitted */
}

.test-item.graded {
    border-left: 5px solid var(--secondary-color); /* Brown for graded */
}

/* Test info section */
.test-info {
    padding: 18px 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.test-name {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--heading-color);
    flex-grow: 1;
}

.test-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.test-date::before {
    content: "📅";
    font-size: 0.9em;
}

/* Submission actions */
.download-file, 
.view-answer {
    padding: 6px 12px;
    border-radius: var(--border-radius);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
}

.download-file {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.download-file:hover {
    background-color: var(--secondary-color);
}

.view-answer {
    background-color: var(--background-light);
    color: var(--text-color);
    border: 1px solid var(--secondary-color);
}

.view-answer:hover {
    background-color: var(--accent-color-3);
}

/* Grade badge */
.grade-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
    background-color: var(--secondary-color);
    display: inline-flex;
    align-items: center;
}

/* Grading section */
.grading-section {
    padding: 16px 20px;
    background-color: var(--background-light);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.grade-input {
    width: 70px;
    padding: 8px 10px;
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    color: var(--heading-color);
    background-color: var(--background-white);
}

.grade-input:focus {
    border-color: var(--accent-color-2);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color-2) 30%, transparent);
}

.feedback-input {
    flex: 1;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--secondary-color);
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    color: var(--text-color);
    background-color: var(--background-white);
    transition: all 0.2s ease;
}

.feedback-input:focus {
    border-color: var(--accent-color-2);
    outline: none;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-color-2) 30%, transparent);
}

/* Button styles */
.submit-grade, 
.edit-feedback, 
.save-feedback {
    padding: 8px 16px;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-grade {
    background-color: var(--primary-color);
    color: white;
}

.submit-grade:hover {
    background-color: var(--secondary-color);
}

.edit-feedback, 
.save-feedback {
    background-color: var(--accent-color-2);
    color: var(--heading-color);
}

.edit-feedback:hover,
.save-feedback:hover {
    background-color: var(--accent-color-3);
}

/* Marking a handed-in task: the AI review badges, the feedback, the mark and
   feedback fields and their buttons (built by enhanceGradingSections). */
.ai-mark-badge,
.ai-original {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1;
}

.ai-mark-badge {
    padding: 5px 10px;
    border: 1px solid transparent;
    border-radius: 20px;
}

.ai-mark-badge.is-unreviewed {
    background-color: color-mix(in srgb, var(--accent-color-3) 22%, var(--background-white));
    border-color: var(--accent-color-3);
    color: var(--heading-color);
}

.ai-mark-badge.is-reviewed {
    background-color: var(--background-light);
    border-color: var(--border-color);
    color: var(--text-muted);
}

.ai-original {
    color: var(--text-muted);
    font-weight: 500;
    font-style: italic;
}

.grading-feedback {
    flex: 1 1 260px;
    margin: 0;
    padding: 0;
    list-style: none;
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.5;
}

.grading-feedback li {
    position: relative;
    padding-left: 18px;
}

.grading-feedback li + li {
    margin-top: 4px;
}

.grading-feedback li::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 0.62em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-color-2);
}

.grading-feedback.is-empty {
    color: var(--text-muted);
    font-style: italic;
}

.grading-mark {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.grading-max {
    color: var(--text-muted);
    font-weight: 600;
}

.grading-section textarea.feedback-input {
    flex: 1 1 260px;
    min-height: 64px;
    resize: vertical;
    font-size: 0.95rem;
    line-height: 1.4;
}

.grading-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-left: auto;
}

.grading-confirm,
.grading-save,
.grading-change,
.grading-cancel,
.grading-ai {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-family: var(--font-family);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-speed) ease,
                border-color var(--transition-speed) ease,
                color var(--transition-speed) ease,
                transform 0.15s ease;
}

.grading-confirm,
.grading-save {
    background-color: var(--primary-color);
    /* A faint edge in the text colour: invisible on the light themes, and on
       dark it keeps a near-black button from melting into its row. */
    border-color: color-mix(in srgb, var(--text-color) 14%, transparent);
    color: #ffffff;
}

.grading-confirm:hover,
.grading-save:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
}

.grading-change {
    background-color: var(--background-white);
    border-color: var(--secondary-color);
    color: var(--heading-color);
}

.grading-change i {
    color: var(--accent-color-2);
}

.grading-change:hover {
    background-color: color-mix(in srgb, var(--accent-color-2) 15%, var(--background-white));
    border-color: var(--accent-color-2);
    transform: translateY(-1px);
}

/* Asking the AI to mark work that is waiting: an offer, not the main action,
   so it is outlined in the accent rather than filled like Save. */
.grading-ai {
    background-color: color-mix(in srgb, var(--accent-color-2) 12%, var(--background-white));
    border-color: var(--accent-color-2);
    color: var(--heading-color);
}

.grading-ai i {
    color: var(--accent-color-2);
}

.grading-ai:hover {
    background-color: color-mix(in srgb, var(--accent-color-2) 24%, var(--background-white));
    transform: translateY(-1px);
}

.grading-cancel {
    background-color: transparent;
    color: var(--text-muted);
}

.grading-cancel:hover {
    background-color: var(--background-white);
    border-color: var(--border-color);
    color: var(--heading-color);
}

.grading-actions button:focus-visible {
    outline: 2px solid var(--accent-color-2);
    outline-offset: 2px;
}

.grading-actions button:disabled {
    opacity: 0.6;
    cursor: progress;
    transform: none;
}

@media (max-width: 600px) {
    .grading-actions {
        width: 100%;
        margin-left: 0;
    }

    .grading-actions button {
        flex: 1;
        justify-content: center;
    }
}

/* No tests message */
.no-tests {
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
    font-style: italic;
}

/* Score color classes */
.grade-badge.excellent {
    background-color: #2e7d32; /* Dark green for excellent */
}

.grade-badge.good {
    background-color: #689f38; /* Medium green for good */
}

.grade-badge.average {
    background-color: #f9a825; /* Yellow for average */
}

.grade-badge.poor {
    background-color: #ef6c00; /* Orange for poor */
}

.grade-badge.fail {
    background-color: #c62828; /* Red for fail */
}

.test-meta {
    display: flex;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.time-remaining {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
}

.time-remaining.normal {
    background: #e6f7ee;
    color: #28a745;
}

.time-remaining.warning {
    background: #fff8e6;
    color: #fd7e14;
}

.time-remaining.urgent {
    background: #ffebee;
    color: #dc3545;
    font-weight: 500;
}

.time-remaining.overdue {
    background: #f8f9fa;
    color: #dc3545;
    font-weight: 600;
    border: 1px dashed #dc3545;
}

.btn-remind {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    border-radius: 6px;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-remind:hover {
    background: #e9ecef;
    color: #495057;
}

.btn-remind i {
    font-size: 0.9rem;
}

.btn-remind {
    background: var(--background-light);
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
}

.no-tests {
    text-align: center;
    color: var(--text-muted);
    padding: 20px 0;
}
/* Progress Section */
.progress-chart {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.progress-chart .chart-circle span {
    font-size: 18px;
    font-weight: bold;
    color: var(--heading-color);
}

.progress-details {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
}

.progress-item {
    text-align: center;
}

.progress-item .label {
    font-size: 14px;
    color: var(--text-muted);
}

.progress-item .value {
    font-size: 18px;
    font-weight: bold;
    color: var(--heading-color);
}

/* Grade Editor */
.grade-editor {
    background: var(--background-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.grade-editor label {
    font-size: 16px;
    font-weight: bold;
    color: var(--heading-color);
    margin-bottom: 10px;
    display: block;
}

.grade-input {
    display: flex;
    align-items: center;
    gap: 10px;
}
.section-title{
    color: var(--text-color);
}
.grade-input input {
    width: 80px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}

.grade-input input:focus {
    border-color: #3498db;
    outline: none;
}

.btn-primary {
    background-color: var(--secondary-color);
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-color);
} */

/* Test Results */
.test-results {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.test-list {
    background: var(--background-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.test-list h3 {
    font-size: 18px;
    color: var(--heading-color);
    margin-bottom: 15px;
}

.test-list ul {
    list-style: none;
}

.test-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.test-list li:last-child {
    border-bottom: none;
}

.test-name {
    font-size: 14px;
    color: var(--text-color);
}

.test-score {
    font-size: 14px;
    font-weight: bold;
    color: #27ae60;
}

.btn-remind {
    background-color: #e74c3c;
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-remind:hover {
    background-color: #c0392b;
}
/* Course Header */
.course-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.back-button {
    background: none;
    border: none;
    font-size: 18px;
    color: #3498db;
    cursor: pointer;
    margin-right: 10px;
}

/* Analytics Grid */
.analytics-grid {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.analytics-card {
    background: var(--background-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    text-align: center;
    flex: 1;
}

.analytics-card .stat {
    font-size: 24px;
    font-weight: bold;
    color: var(--heading-color);
}

.analytics-card .label {
    font-size: 14px;
    color: var(--text-muted);
}

/* Milestone Container */
.milestone-container {
    margin-bottom: 20px;
}

.milestone {
    background: var(--background-white);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    cursor: pointer;
}
.milestone:hover {
    translate: 0.3s;
    transform: translateY(-5px); 
}

.milestone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.milestone-header h2 {
    font-size: 18px;
    color: var(--text-colors);
}

.due-date {
    font-size: 14px;
    color: var(--text-muted);
}

.progress-container {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.progress-bar {
    height: 100%;
    border-radius: 4px;
    background: var(--primary-color);
}

.tasks {
    font-size: 14px;
    color: var(--text-muted);
}

/* Student Grid */
.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.student-block {
    background: var(--background-white);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease;
}

.student-block:hover {
    transform: translateY(-3px);
}
.student-block:hover p {
    color: #ffffff;
}

.student-block p {
    font-size: 16px;
    color: var(--heading-color);
    margin-bottom: 5px;
}

.student-block .grade {
    font-size: 14px;
    color: var(--text-muted);
}
.milestone-form {
    background: var(--background-white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 400px;
}

.milestone-form h3 {
    margin-bottom: 20px;
    font-size: 20px;
    color: var(--heading-color);
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    color: var(--text-color);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

.btn-cancel {
    background: #e74c3c;
    color: #fff;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-cancel:hover {
    background: #c0392b;
}
.milestone-details-container {
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin: 1rem 0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 1.5rem 0;
}

.task-item {
    background: var(--background-white);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    padding: 16px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    border-left: 4px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
}

.task-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left-color: var(--accent-color-2);
}

/* Task Type Badges */
.task-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-right: 8px;
    background-color: var(--background-light);
    color: var(--heading-color);
}

.task-type-badge i {
    margin-right: 5px;
    font-size: 10px;
}

.task-type-badge.exam {
    background: #ffebee;
    color: #f44336; /* Keeping red for exams as it's important */
}

.task-type-badge.test {
    background: #fff8e1;
    color: #ff9800; /* Keeping orange for tests */
}

.task-type-badge.exercise {
    background: var(--background-light);
    color: var(--heading-color);
}

/* Task Header */
.task-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.task-due-date {
    font-size: 12px;
    color: var(--heading-color);
    opacity: 0.8;
    display: flex;
    align-items: center;
}

.task-due-date i {
    margin-right: 5px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Task Content */
.task-content h4 {
    margin: 0 0 8px 0;
    color: var(--heading-color);
    font-size: 16px;
}

.task-description {
    color: var(--heading-color);
    opacity: 0.8;
    font-size: 14px;
    margin: 8px 0;
    line-height: 1.5;
}

/* Attachments */
.task-attachment {
    display: flex;
    align-items: center;
    margin: 8px 0;
    font-size: 13px;
}

.task-attachment i {
    margin-right: 8px;
    color: var(--text-muted);
}

.attachment-link {
    color: var(--text-muted);
    text-decoration: none;
    word-break: break-all;
}

.attachment-link:hover {
    text-decoration: underline;
    color: var(--heading-color);
}

/* Task Footer */
.task-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed rgba(0, 0, 0, 0.1);
}

.task-points {
    font-size: 13px;
    color: var(--heading-color);
    opacity: 0.7;
    display: flex;
    align-items: center;
}

.task-points i {
    margin-right: 5px;
    color: var(--accent-color-3);
}

.task-actions {
    display: flex;
    gap: 8px;
}

.task-actions button {
    background: none;
    border: none;
    color: var(--heading-color);
    opacity: 0.7;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.task-actions button:hover {
    background: var(--background-light);
    color: var(--heading-color);
    opacity: 1;
}

.btn-delete:hover {
    color: #e74c3c !important; /* Keeping red for delete action */
}

.btn-edit:hover {
    color: var(--text-muted) !important;
}

/* Priority Indicators */
.task-priority {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 10px;
    background: var(--accent-color-3);
    color: var(--heading-color);
}

/* Progress Indicator */
.task-progress {
    height: 4px;
    background: var(--background-light);
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--secondary-color);
    transition: width 0.3s ease;
}
.theory-card {
    background: var(--background-light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.btn-add {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.3s ease;
}

.btn-add:hover {
    background: var(--secondary-color);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.hidden {
    display: none;
}

.progress-wrapper {
    background: #f1f2f6;
    border-radius: var(--border-radius);
    height: 1.5rem;
    position: relative;
    margin: 1rem 0;
}

.progress-bar {
    background: var(--primary-color);
    height: 100%;
    border-radius: var(--border-radius);
    transition: width 0.5s ease;
}

.progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.8rem;
}
.btn-go-back {
    background: none;
    border: none;
    color: var(--heading-color);
    cursor: pointer;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.btn-go-back:hover {
    color: var(--text-muted);
}

.btn-go-back i {
    margin-right: 0.5rem;
}
.btn-save{
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: background 0.3s ease;
}
.btn-save:hover{
    background: var(--secondary-color);
}
.theory-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    padding: 16px;
    align-items: start; /* Prevent card height misalignment */
}

/* Tablet view (2 columns) */
@media (max-width: 1024px) {
    .theory-list {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 20px;
        padding: 12px;
    }
}

/* Mobile view (1 column) */
@media (max-width: 640px) {
    .theory-list {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 8px;
    }
}

/* Optional: Add scroll snapping for mobile */
@media (max-width: 640px) {
    .theory-list {
        scroll-snap-type: y proximity;
    }
    .theory-card {
        scroll-snap-align: start;
    }
}

.theory-card {
    background: var(--background-white);
    border: 1px solid var(--background-light);
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
    padding: 20px;
    width: 300px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border-left: 4px solid var(--secondary-color); /* Teal accent */
}

.theory-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 98, 204, 0.1);
    border-left-color: var(--accent-color-2);
}

.theory-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.theory-title {
    font-size: 1.25rem;
    margin: 0;
    color: var(--heading-color);
    line-height: 1.4;
}

.theory-type-badge {
    background: var(--background-light);
    color: var(--heading-color);
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
}

.theory-content {
    font-size: 0.95rem;
    color: var(--heading-color);
    opacity: 0.9;
    line-height: 1.6;
    margin: 12px 0;
}

.theory-details {
    background: var(--background-light);
    border-radius: 8px;
    padding: 12px;
    margin: 15px 0;
}

.detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.detail-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-weight: 600;
    color: var(--heading-color);
    min-width: 80px;
    margin-right: 10px;
}

.detail-value, .pretty-link {
    color: var(--text-muted);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pretty-link {
    padding: 6px 10px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 6px;
    transition: all 0.2s;
}

.pretty-link:hover {
    background: rgba(74, 144, 226, 0.2);
    text-decoration: none;
}

.pretty-link i {
    font-size: 0.9rem;
}

.theory-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(30, 58, 95, 0.1);
}

.btn-edit-material, .btn-delete-theory {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.btn-edit-material {
    background: rgba(46, 204, 113, 0.1);
    color: var(--heading-color);
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.btn-delete-theory {
    background: rgba(231, 76, 60, 0.1);
    color: var(--heading-color);
    border: 1px solid rgba(231, 76, 60, 0.3);
}

.btn-edit-material:hover {
    background: rgba(46, 204, 113, 0.2);
}

.btn-delete-theory:hover {
    background: rgba(231, 76, 60, 0.2);
}

.theory-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 40px;
    background: var(--accent-color-2);
    opacity: 0.1;
    border-radius: 0 0 0 40px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .theory-card {
        width: 100%;
    }
}
.btn-edit-material, .btn-delete-theory {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.btn-edit-material {
    background-color: #28a745;
    color: white;
}

.btn-delete-theory {
    background-color: #dc3545;
    color: white;
}

.btn-edit-material:hover {
    background-color: #218838;
}

.btn-delete-theory:hover {
    background-color: #c82333;
}
.no-theory {
    font-size: 1.2rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 20px;
}
.modal-content-edit-task {
    background: var(--background-white);
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    /* Scrolls inside the window on a short screen instead of running off it. */
    max-height: 90vh;
    overflow-y: auto;
}

/* "Remove the current file" in the study material editor: the box beside
   its text, not stretched onto a line of its own like the other inputs. */
.material-remove-file {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    font-weight: normal;
    cursor: pointer;
}

.material-remove-file input[type="checkbox"] {
    width: auto;
    margin: 0;
}

#material-edit-form small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
}
.modal-edit-task{
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
/* The class grade: a number the app works out, with the parts it is made of
   and the months behind it, so a teacher can explain it to a parent. */
.class-grade-headline {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 4px 0 2px;
}

.class-grade-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--heading-color);
    line-height: 1;
}

.class-grade-max {
    color: var(--text-muted);
    font-weight: 600;
}

.class-grade-note {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.class-grade-parts {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.class-grade-parts li {
    flex: 1 1 200px;
    padding: 10px 12px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--background-light);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.class-grade-parts span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.class-grade-parts strong {
    color: var(--heading-color);
    font-size: 1.25rem;
}

.class-grade-parts small {
    color: var(--text-muted);
    font-size: 0.78rem;
}

.class-grade-history {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed var(--border-color);
}

.class-grade-history h4 {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.class-grade-history ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.class-grade-history li {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--background-light);
    border: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.class-grade-history strong {
    color: var(--accent-color-2);
}

/* The filled part of every progress bar, in the accent rather than the primary
   colour: in dark mode primary (#11161d) sits on a track of #1c2530, so a bar
   at 100% looked exactly like a bar at 0%. */
.progress-container > .progress-bar,
.milestone .progress-bar,
.course-card .progress-bar {
    background: var(--accent-color-2);
}

/* And the track it sits in, so an empty bar still reads as a bar. */
.progress-container {
    background: color-mix(in srgb, var(--text-color) 14%, var(--background-white));
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px;
    border-radius: 5px;
    color: white;
    z-index: 1000;
}
.notification.success {
    background-color: green;
}
.notification.error {
    background-color: red;
}
.right-click-menu {
    background-color: var(--background-white);
    border: 1px solid #ccc;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1001;
}
.right-click-actions button {
    display: block;
    width:  100%;
    padding: 10px;
    border: none;
    background: none;
    cursor: pointer;
}
.right-click-actions button:hover {
    background-color: var(--background-light);
}
/* Responsive Design */
@media (max-width: 768px) {
    .test-results {
        flex-direction: column;
    }

    .grade-input {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .grade-input input {
        width: 100%;
    }
}
/* Fade-in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        display: none; /* Sidebar hidden by default on mobile */
    }

    .main-content {
        padding: 15px;
    }

    .profile-card {
        padding: 15px;
    }

    .students-table th,
    .students-table td {
        padding: 8px;
    }

    .students-table {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .profile-card p {
        font-size: 0.9rem;
    }

    .course-list li {
        font-size: 0.9rem;
    }

    .students-table {
        display: block;
        overflow-x: scroll;
    }
}
@media (max-width: 480px) {
    .modal-content {
        padding: 15px; /* Less padding on smaller screens */
        width: 95%; /* Wider on very small screens */
    }

    .modal-content input {
        font-size: 14px; /* Slightly smaller font for inputs */
    }

    .modal-content button {
        font-size: 14px; /* Slightly smaller font for buttons */
    }

    .close {
        font-size: 20px; /* Smaller close button */
        top: 5px;
        right: 10px;
    }
}
/* Responsive Design */
@media (max-width: 768px) {
    .top-nav {
        position: relative; /* anchor the dropdown to the bar */
        padding: 8px 14px;
    }

    .menu-button {
        display: block; /* Show menu button on smaller screens */
        font-size: 22px;
        line-height: 1;
        padding: 6px 10px;
        border-radius: 10px;
        transition: background 0.2s ease;
    }

    .menu-button:active {
        background: rgba(255, 255, 255, 0.15);
    }

    /* A floating card rather than a full-width slab. */
    .nav-links {
        display: none;
        flex-direction: column;
        gap: 2px;
        background-color: var(--background-white);
        position: absolute;
        top: calc(100% + 6px);
        left: 10px;
        right: 10px;
        width: auto;
        padding: 8px;
        border: 1px solid var(--border-color);
        border-radius: 14px;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
        z-index: 1000;
    }

    .nav-links.active {
        display: flex; /* Show nav links when menu is toggled */
        animation: nav-drop 0.16s ease-out;
    }

    .nav-links li {
        color: var(--text-color);
        padding: 12px 14px;
        border-radius: 10px;
        font-size: 0.95rem;
        transition: background 0.15s ease;
    }

    .nav-links li:hover,
    .nav-links li:active {
        background: var(--background-light);
        color: var(--text-color);
    }

    .nav-links li a {
        color: inherit;
    }

    /* The theme switcher sits in the same list, so match the rows. */
    .nav-links .sunbutt {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 6px 10px;
        border-radius: 10px;
    }

    .nav-links .sunbutt svg {
        width: 26px;
        height: 26px;
        fill: var(--text-color);
    }
}

@keyframes nav-drop {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin {
    100% { transform: rotate(360deg); }
}
/* Sidebar */
/* Profile Box Styles */
.profile-box {
    padding: 20px;
    border-bottom: 2px solid var(--secondary-color);
    margin-bottom: 15px;
}

.profile-box h2 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-direction: column;
}

.avatar {
    width: 50px;
    height: 50px;
    background-color: var(--accent-color-2);
    color: var(--heading-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    flex-shrink: 0;
}

.teacher-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.teacher-name {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.teacher-email {
    font-size: 0.8rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .profile-box {
        padding: 15px;
    }
    
    .avatar {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .teacher-name {
        font-size: 0.9rem;
    }
    
    .teacher-email {
        font-size: 0.7rem;
    }
}


.sidebar {
    width: 250px;
    background: var(--primary-color);
    color: white;
    padding: 20px;
    position: fixed; /* Changed from static to fixed */
    top: 0;
    bottom: 0; /* Stretch from top to bottom */
    left: 0;
    overflow-y: auto; /* Enable scrolling if content exceeds height */
    transition: transform 0.3s ease-in-out;
    z-index: 1000; /* Ensure it stays above other content */
}

.themebtn {
    border-top: 2px solid var(--secondary-color) ;
    list-style: none;
    margin: 10px 0;
}

.sidebar h2 {
    text-align: center;
    font-size: 22px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    /* border-bottom: 2px solid var(--secondary-color); */
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: background 0.3s;
}

.sidebar ul li a {
    text-decoration: none;
    color: white;
    display: flex;
    align-items: center;
}

.sidebar ul li:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

/* Main Content */
.main-content {
    margin-left: 250px;
    flex-grow: 1;
    padding: 20px;
}

/* Header */
.dashboard-header {
    background: var(--background-white);
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    animation: fadeIn 0.5s ease-in-out;
}

/* Profile Section */
.profile-section {
    margin-bottom: 20px;
    opacity: 0;
    animation: slideIn 0.6s ease-in-out forwards;
}

.profile-card {
    background: var(--background-white);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}
.course-list {
    list-style: none; /* Remove default list styling */
    padding: 0; /* Remove default padding */
    margin: 0; /* Remove default margin */
    background: var(--background-white); /* Use a CSS variable for background color */
    border-radius: 8px; /* Slightly larger radius for a softer look */
    padding: 20px; /* More padding for better spacing */
    box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.1); /* Softer, more modern shadow */
    border: 1px solid var(--border-color, #e0e0e0); /* Optional: Add a subtle border */
}

.course-list li {
    padding: 12px 15px; /* More padding for better spacing */
    border-bottom: 1px solid var(--secondary-color, #e0e0e0); /* Use a CSS variable for border color */
    transition: background 0.3s ease-in-out, transform 0.2s ease-in-out; /* Add transform for hover effect */
    cursor: pointer; /* Indicate interactivity */
    display: flex; /* Use flexbox for better alignment */
    align-items: center; /* Vertically center content */
    justify-content: space-between; /* Space out content */
}

.course-list li:last-child {
    border-bottom: none; /* Remove border from the last item */
}

.course-list li:hover {
    background: var(--hover-background, #f5f5f5); /* Light background on hover */
    transform: translateY(-2px); /* Slight lift effect on hover */
}

.course-list li:active {
    transform: translateY(0); /* Reset transform when clicked */
}
.sunbutt {
    justify-content: flex-start; /* Align items to start */
    padding-left: 20px; /* Add some padding */
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    width: 100%;
    text-align: left;
}
  
  .sunbutt:hover {
    fill: var(--secondary-color); /* Change color on hover */
    transform: scale(1.1); /* Slightly enlarge on hover */
  }
  .theme-container {
    border-top: 1px var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row;
}

.theme-text {
    margin: 0;
    font-size: 0.8rem;
    text-align: left; /* Change to left alignment */
    color: inherit;
}
/* Optional: Add a subtle animation for when items are added dynamically */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.course-list li {
    animation: fadeIn 0.3s ease-in-out; /* Apply fade-in animation */
}

/* Optional: Add a badge or icon for visual interest */
.course-list li::after {
    content: "→"; /* Add an arrow or icon */
    color: var(--secondary-color, #888); /* Use a CSS variable for color */
    font-size: 14px;
    margin-left: 10px;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease-in-out;
}

.course-list li:hover::after {
    opacity: 1; /* Show arrow on hover */
}

/* Students Table */
.students-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--background-white);
    border-radius: 5px;
    overflow: auto;
    box-shadow: 0px 2px 5px rgba(0, 0, 0, 0.1);
}

.students-table th, .students-table td {
    padding: 12px;
    border-bottom: 1px solid var(--secondary-color);
    text-align: left;
}

.students-table th {
    background: var(--primary-color);
    color: white;
    transition: background 0.3s;
}

.students-table tr {
    transition: background 0.3s;
}

.students-table tr:nth-child(even) {
    background: var(--background-light);
}

/* Logout Button */
.logout-button {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 20px;
    background: var(--secondary-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.3s, transform 0.2s;
    cursor: pointer;
}

.logout-button:hover {
    background: var(--primary-color);
    transform: scale(1.05);
}

/* Responsive: Turn into Dropdown on Mobile */
@media (max-width: 768px) {
   

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 50px;
        left: 0;
        width: 100%;
        background: var(--primary-color);
        box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    }

    .nav-links.show {
        display: flex;
    }

    .nav-links li {
        text-align: center;
        padding: 15px;
        width: 100%;
    }
}
/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-10px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .main-content {
        margin-left: 0px;
        padding: 10px;
    }

    .students-table th, .students-table td {
        padding: 8px;
        font-size: 14px;
    }
}

/* ===== Weekly schedule on phones =====
   Squeezing 8 columns into a phone made the cells unreadable, and the lesson
   pop-up (220px, anchored under a ~45px cell) hung outside the scroll box, so
   it appeared cut in half and the whole grid had to be dragged sideways. */
@media (max-width: 768px) {
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    /* Readable columns; the grid scrolls inside its own box, not the page. */
    .weekly-schedule {
        width: auto;
        min-width: 520px;
        font-size: 0.78em;
    }

    .weekly-schedule td { height: 44px; }
    .weekly-schedule th { padding: 8px 6px; }

    /* Keep the time column in view while scrolling across the days. */
    .weekly-schedule th:first-child,
    .weekly-schedule .hour-label {
        position: sticky;
        left: 0;
        background-color: var(--primary-color);
        z-index: 5;
    }
    .weekly-schedule th:first-child { z-index: 15; }

    /* A tap fires :hover on touch, so show the details as a centred card
       instead of a tooltip pinned to a narrow cell. */
    .course-tooltip {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: min(300px, 88vw);
        max-height: 70vh;
        overflow-y: auto;
        z-index: 12000;
    }

    .course-tooltip::before { display: none; } /* arrow makes no sense centred */

    .course-blocks:hover .course-tooltip {
        top: 50%; /* override the desktop calc(100% + 5px) */
    }

    /* The zoom-on-hover jumps around under a finger, and its transform would
       also stop the card above from being positioned against the viewport. */
    .course-slot:hover {
        scale: none;
        border-radius: 0;
        background-color: var(--background-white);
    }
}

/* ===== "Σήμερα" — the register =====
   Today's lessons as cards that change state with the clock, a list of
   registers nobody filled in, and the register itself. Attendance colours
   are deliberately not theme colours: present/absent/late must mean the
   same thing in every theme. */
:root {
    --att-present: #2e7d32;
    --att-absent:  #c62828;
    --att-late:    #b26a00;
}

[data-theme="dark"] {
    --att-present: #4ade80;
    --att-absent:  #f87171;
    --att-late:    #fbbf24;
}

.today-panel {
    background: var(--background-white);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 18px 20px;
    margin-bottom: 28px;
}

.today-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.today-head h2 { margin: 0; }

.today-date { color: var(--text-muted); font-size: 0.95rem; }

.today-empty { margin: 0; color: var(--text-muted); font-style: italic; }

.today-lessons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.today-lesson {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    border-left: 5px solid var(--border-color);
    background: var(--background-light);
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.today-when  { font-size: 0.82rem; color: var(--text-muted); }
.today-title { font-size: 1.08rem; font-weight: 700; color: var(--heading-color); }
.today-state { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 8px; }

/* What the card wants from the teacher, said with the left edge. */
.today-lesson.is-now       { border-left-color: var(--accent-color-2); }
.today-lesson.is-due       { border-left-color: var(--att-late);
                             box-shadow: 0 0 0 3px color-mix(in srgb, var(--att-late) 25%, transparent); }
.today-lesson.is-due .today-state    { color: var(--att-late); font-weight: 600; }
.today-lesson.is-pending   { border-left-color: var(--att-absent); }
.today-lesson.is-pending .today-state { color: var(--att-absent); font-weight: 600; }
.today-lesson.is-done      { border-left-color: var(--att-present); }
.today-lesson.is-done .today-state    { color: var(--att-present); }
.today-lesson.is-cancelled { border-left-color: var(--text-muted); opacity: 0.8; }

.today-open {
    align-self: flex-start;
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    font-size: 0.88rem;
    transition: background-color var(--transition-speed) ease;
}

.today-open:hover { background: var(--secondary-color); }
.today-lesson.is-done .today-open,
.today-lesson.is-cancelled .today-open {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.today-pending-list { margin-top: 18px; }

.today-pending-list h3 {
    margin: 0 0 8px;
    font-size: 0.95rem;
    color: var(--att-absent);
}

.today-pending-list h3 span {
    display: inline-block;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--att-absent);
    color: #fff;
    font-size: 0.8rem;
    text-align: center;
}

.today-pending {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    margin-bottom: 6px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    background: none;
    color: var(--text-color);
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
}

.today-pending:hover { border-style: solid; border-color: var(--att-absent); }
.today-pending span  { color: var(--text-muted); }

/* --- the register itself --- */
.register-overlay {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.55);
}

.register-modal {
    width: min(560px, 100%);
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background: var(--background-white);
    color: var(--text-color);
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
}

.register-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.register-head h3   { margin: 0 0 2px; font-size: 1.1rem; color: var(--heading-color); }
.register-head span { font-size: 0.85rem; color: var(--text-muted); }

.register-close {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
}

.register-body { padding: 16px 20px; overflow-y: auto; }

.register-loading, .register-empty { margin: 0; color: var(--text-muted); font-style: italic; }

.register-note { display: block; margin-bottom: 12px; }
.register-note span { display: block; margin-bottom: 5px; font-size: 0.85rem; color: var(--text-muted); }

.register-note textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 9px;
    background: var(--background-light);
    color: var(--text-color);
    font-family: inherit;
    font-size: 0.92rem;
    resize: vertical;
}

.register-note textarea:focus { outline: none; border-color: var(--primary-color); }

.register-hint { margin-bottom: 10px; font-size: 0.8rem; color: var(--text-muted); }

.register-roster {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 8px;
    margin-bottom: 14px;
}

.register-roster.is-off { opacity: 0.4; pointer-events: none; }

/* One button per student. Tapping cycles present → absent → late; the
   colour is the state, the word confirms it. */
.att {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    border: 2px solid var(--border-color);
    border-radius: 9px;
    background: var(--background-light);
    color: var(--text-color);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    text-align: left;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.att-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.att-mark {
    flex-shrink: 0;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #fff;
    background: var(--att-present);
}

.att.is-absent { border-color: var(--att-absent); background: color-mix(in srgb, var(--att-absent) 14%, var(--background-light)); }
.att.is-absent .att-mark { background: var(--att-absent); }
.att.is-late   { border-color: var(--att-late);   background: color-mix(in srgb, var(--att-late) 14%, var(--background-light)); }
.att.is-late .att-mark   { background: var(--att-late); }

.register-cancelled {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--text-muted) 15%, var(--background-light));
    font-size: 0.9rem;
}

.register-uncancel {
    margin-left: 8px;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--background-white);
    color: var(--text-color);
    cursor: pointer;
    font-size: 0.8rem;
}

.register-actions { display: flex; gap: 10px; justify-content: flex-end; }

.register-actions button {
    padding: 11px 18px;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.92rem;
    font-family: inherit;
}

.register-save { background: var(--primary-color); color: #fff; }
.register-save:hover { background: var(--secondary-color); }
.register-save:disabled { opacity: 0.6; cursor: progress; }

.register-cancel-lesson {
    background: none;
    color: var(--text-muted);
    border: 1px solid var(--border-color) !important;
}

.register-cancel-lesson:hover { color: var(--att-absent); border-color: var(--att-absent) !important; }

.register-filled { margin: 12px 0 0; font-size: 0.78rem; color: var(--text-muted); font-style: italic; }

/* ===== Attendance on the engagement card =====
   From the lesson register, with the verdict the analysis gives it. */
.engagement-attendance {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--background-light);
    font-size: 0.85rem;
    color: var(--text-color);
}
.engagement-attendance strong { flex-shrink: 0; }
.engagement-attendance.is-ok strong        { color: #2e7d32; }
.engagement-attendance.is-watch strong     { color: #b26a00; }
.engagement-attendance.is-too_many         { border-left: 4px solid #c62828; }
.engagement-attendance.is-too_many strong  { color: #c62828; }
.engagement-attendance.is-too_early strong { color: var(--text-muted); font-weight: 500; }
[data-theme="dark"] .engagement-attendance.is-ok strong       { color: #4ade80; }
[data-theme="dark"] .engagement-attendance.is-watch strong    { color: #fbbf24; }
[data-theme="dark"] .engagement-attendance.is-too_many        { border-left-color: #f87171; }
[data-theme="dark"] .engagement-attendance.is-too_many strong { color: #f87171; }

/* ===== The deep dive the student asked for, on the teacher's student page ===== */
.deep-dive-card {
    margin: 16px 0;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--accent-color-2);
    border-radius: 10px;
    background: var(--background-white);
    color: var(--text-color);
}
.deep-dive-card summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px;
    cursor: pointer;
    list-style: none;
}
.deep-dive-card summary::-webkit-details-marker { display: none; }
.deep-dive-card summary strong { color: var(--heading-color); }
.deep-dive-card summary span   { font-size: 0.8rem; color: var(--text-muted); }
.deep-dive-card h4 { margin: 14px 0 6px; font-size: 0.9rem; color: var(--heading-color); }
.deep-dive-card ul,
.deep-dive-card ol { margin: 0; padding-left: 20px; font-size: 0.9rem; line-height: 1.5; }
.deep-dive-card em { color: var(--text-muted); }
.deep-dive-headline { margin: 12px 0 6px; font-weight: 700; color: var(--heading-color); }
