: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);
}

/* 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);
    color: var(--text-color);
    background-color: var(--background-light);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    transition: background-color var(--transition-speed) ease;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    background-color: var(--primary-color);
    color: white;
    padding: 20px;
    position: relative;
    z-index: 100;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    transition: transform var(--transition-speed) ease;
}

.profile-header {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--secondary-color);
    margin-bottom: 20px;
}

.profile-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 60px;
    height: 60px;
    background-color: var(--accent-color-2);
    /* The heading colour is another strong colour, and one saturated colour on
       another is a letter you have to look for: purple on pink in the light
       theme reads at about 1.4:1. A dark tint of the accent itself keeps the
       theme and is legible on all four. */
    color: color-mix(in srgb, var(--accent-color-2) 20%, #0b0f14);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    overflow: hidden;
}

/* A chosen icon fills the circle; the letter is what shows without one. */
.avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-name {
    font-size: 1.1rem;
    font-weight: 500;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    display: flex;
    align-items: center; /* Vertical centering */
    padding: 12px 20px; /* More left padding if needed */
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    gap: 12px; /* Space between icon and text */
}

.sidebar-menu li:hover {
    scale: 105%;
    cursor: pointer;
    background-color: rgba(255, 255, 255, 0.1);
    color: rgb(255, 255, 255);
}

.sidebar-menu a, 
.sidebar-menu button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    color: white;
    text-decoration: none;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.95rem;
}

.sidebar-menu .active {
    background-color: var(--accent-color-2);
    color: var(--heading-color);
    font-weight: 500;
}

.sidebar-menu .active i {
    color: var(--heading-color);
}

.sidebar-menu i {
    width: 20px;
    text-align: center;
    color: rgb(255, 255, 255);
}

.theme-toggle-container {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--secondary-color);
    border-radius: 0px !important;
}

/* ==================== TOP NAV (MOBILE) ==================== */
.top-nav {
    display: none;
    background-color: var(--primary-color);
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.menu-button {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    padding: 0px;
    margin: 0;
    display: none;
    flex-direction: column;
    gap: 10px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    padding: 15px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.nav-links.show {
    display: flex;
}

.nav-links li, 
.nav-links button {
    text-align: center;

    padding: 10px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.nav-links a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--accent-color-2);
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    padding: 20px;
    background-color: var(--background-light);
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* ==================== CARDS ==================== */
.card {
    background-color: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 20px;
    margin-bottom: 20px;
    transition: all var(--transition-speed) ease;
}

.card:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.card h2 {
    margin-top: 0;
    color: var(--heading-color);
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent-color-2);
}

/* ==================== LOADING INDICATOR ==================== */
.loading-spinner {
  border: 4px solid rgba(0, 0, 0, 0.1); /* Light gray background */
  border-top: 4px solid var(--accent-color-2); /* Blue spinner color */
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
  margin: auto; /* Center horizontally if needed */
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--accent-color-2);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.welcome-card {
    background: linear-gradient(135deg, var(--accent-color-2), var(--accent-color-3));
    color: var(--heading-color);
    margin-bottom: 20px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    text-align: center;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color-2);
    margin: 10px 0;
}
.progress-bar {
    width: 100%;
    height: 12px;
    background-color: var(--background-light); /* Light gray background */
    border-radius: 6px; /* Rounded corners */
    margin: 10px 0;
    overflow: hidden; /* Ensures the fill stays within bounds */
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* Subtle inner shadow */
    position: relative; /* Needed for fire pseudo-elements */

}
.updates-card {
    margin-top: 20px;
}

.update-item {
    padding: 12px;
    border-left: 4px solid #ddd;
    margin-bottom: 10px;
    background: var(--background-light);
    border-radius: 4px;
    display: flex;
    gap: 12px;
}

.update-item.urgent {
    border-left-color: #ff6b6b;
    background: #fff0f0;
}

/* A task set before the student joined the class: readable, but not theirs. */
.task-practice-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 0;
    padding: 8px 10px;
    border-left: 3px solid var(--accent-color-3);
    border-radius: 4px;
    background: var(--background-light);
    color: var(--text-muted);
    font-size: 0.85em;
    line-height: 1.4;
}

.task-practice-note i {
    color: var(--accent-color-3);
}

/* An update that knows which task or material it is about opens it. */
.update-item.is-clickable {
    cursor: pointer;
    transition: transform 0.15s ease, border-left-color 0.2s ease, background-color 0.2s ease;
}

.update-item.is-clickable:hover {
    transform: translateX(3px);
    border-left-color: var(--accent-color-2);
    background: var(--background-white);
}

.update-item.is-clickable:focus-visible {
    outline: 2px solid var(--accent-color-2);
    outline-offset: 2px;
}

.update-go {
    margin: 6px 0 0;
    font-size: 0.85em;
    font-weight: 600;
    color: var(--accent-color-2);
}

/* The one the student came for, so it is obvious among the others. */
.task-card.just-opened,
.material-card.just-opened {
    animation: just-opened-flash 2.5s ease;
}

@keyframes just-opened-flash {
    0%, 55% { box-shadow: 0 0 0 3px var(--accent-color-2); }
    100% { box-shadow: 0 0 0 3px transparent; }
}

.update-icon {
    font-size: 1.5em;
}

.update-content h3 {
    margin: 0 0 5px 0;
    color: var(--text-color);
}

.deadline {
    color: #e74c3c;
    font-size: 0.9em;
    margin-top: 5px;
}
.session-timer {
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    margin: 10px 0;
    color: var(--accent-color-2);
}

.timer-label {
    font-size: 0.8rem;
    font-weight: normal;
    color: var(--text-muted);
    margin-top: 5px;
}

.stat-hint {
    font-style: italic;
    color: var(--text-muted);
}


.progress-fill {
    height: 100%;
    width: 0%;
    background-color: var(--accent-color-2); /* Green fill (change to your theme color) */
    border-radius: 6px; /* Match container's rounded corners */
    transition: width 0.8s ease-in-out 1s;
    position: relative;
}

/* Excellent grade animation styles */
.excellent-grade {
    position: relative;
    overflow: hidden;
    border: 2px solid #2cd632;
    animation: pulse 2s infinite alternate;
}

.excellent-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ffd700;
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    animation: bounce 0.5s infinite alternate;
}


/* ok???? */

/* Milestone Selection Styles */
.milestone-selection {
    padding: 20px;
    background: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.milestones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.milestone-card {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.milestone-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.milestone-card h4 {
    margin: 0 0 10px 0;
    color: var(--heading-color);
}

.milestone-card p {
    color: var(--text-muted);
    font-size: 0.9em;
    margin: 10px 0;
}

.milestone-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: var(--text-muted);
    margin: 15px 0 10px;
}

.completion-status {
    padding: 3px 8px;
    border-radius: 4px;
}

.completion-status.completed {
    background: #e8f5e9;
    color: #2e7d32;
}

.completion-status:not(.completed) {
    background: #fff3e0;
    color: #ff6d00;
}

.select-milestone-btn {
    width: 100%;
    padding: 8px;
    background: #e3f2fd;
    border: none;
    border-radius: 4px;
    color: #1976d2;
    cursor: pointer;
    transition: background 0.2s ease;
}

.select-milestone-btn:hover {
    background: #bbdefb;
}

.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

.loading-state i {
    font-size: 2em;
    margin-bottom: 15px;
    color: #3498db;
}

/* No Milestones Message */
.no-milestones-message {
    text-align: center;
    padding: 30px;
    background: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 20px auto;
}

.no-milestones-message i {
    font-size: 3em;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.no-milestones-message h3 {
    color: var(--text-color);
    margin-bottom: 10px;
}

.no-milestones-message p {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.suggested-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

.btn {
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    background: #e3f2fd;
    color: #1565c0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.btn:hover {
    background: #bbdefb;
}

/* Loading State (enhanced) */
.loading-state {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    background: var(--background-white);
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.loading-state i {
    font-size: 2em;
    margin-bottom: 15px;
    color: #3498db;
}


/* !!!!tasks and study materials!!!! */

.feedback-section {
    width: 100%;
    margin-top: 1rem;
    border-top: 1px dashed #ddd;
    padding-top: 0.5rem;
}

.see-feedback-btn {
    background: #e3f2fd;
    color: #1976d2;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.see-feedback-btn:hover {
    background: #bbdefb;
}

.feedback-section {
    width: 100%;
    margin: 1rem 0;
}

.feedback-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.feedback-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Feedback Items */
.feedback-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    background: var(--background-white);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    align-items: flex-start;
    width: 100%;
}

.feedback-item i {
    font-size: 1.1em;
    margin-top: 3px;
    flex-shrink: 0;
}

.feedback-item .fa-check-circle {
    color: #4CAF50;
}

.feedback-item .fa-exclamation-triangle {
    color: #FFC107;
}

/* Grade Display */
.grade-display {
    background: #e3f2fd;
    padding: 0.8rem;
    border-radius: 6px;
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-top: 1rem;
}

.grade-label {
    font-weight: 600;
    color: #1976d2;
}

.grade-value {
    font-weight: 700;
    color: #0d47a1;
}
.grade-badge {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.3rem 0.6rem;
    background: #4caf50;
    color: white;
    border-radius: 12px;
    font-size: 0.8rem;
}
.material-content {
    margin: 10px 0;
    padding: 10px;
    background: var(--background-light);
    border-radius: 4px;
    font-size: 0.9em;
}

.material-options {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.material-link {
    padding: 5px 10px;
    background: #e3f2fd;
    border-radius: 4px;
    color: #1976d2;
    text-decoration: none;
    font-size: 0.8em;
    display: flex;
    align-items: center;
    gap: 5px;
}

.task-type {
    font-size: 0.7em;
    background: #e0e0e0;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
}

.task-points {
    font-size: 0.8em;
    color: var(--text-muted);
}

.task-links {
    /* display: flex; */
    gap: 10px;
}

.task-link {
    padding: 3px 8px;
    background: var(--background-light);
    border-radius: 4px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.2em;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Content Section Styles */
#course-content-display {
    margin-top: 30px;
    padding: 20px;
    background: var(--background-white);
    border-radius: 8px;
}

.content-section h3 {
    color: var(--heading-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

/* Materials Grid */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.material-card {
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.material-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.material-card.newmaterial {
  position: relative;
  background-color: var(--background-white);
  border-radius: 8px;
  overflow: hidden; /* Contains the pseudo-element */
  z-index: 1;
}

/* Gradient border animation */
.material-card.newmaterial::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  z-index: -1;
  background: linear-gradient(
    135deg, 
    var(--accent-color-2), 
    var(--accent-color-3), 
    var(--accent-color-2)
  );
  background-size: 200% 200%;
  animation: gradient-border 3s ease infinite;
  border-radius: 10px;
  margin: 0; /* Matches border position */
}



.material-description {
    color: var(--text-muted);
    font-size: 0.9em;
    margin: 10px 0;
}

.material-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    color: var(--text-muted);
}

.download-link {
    color: #3498db;
    text-decoration: none;
}

/* Tasks List */

/* Task Buttons Container */
.task-buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

/* Upload Answer Button */
.upload-answer-btn {
    padding: 8px 12px;
    background: #4a89dc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    transition: background 0.2s;
}

.upload-answer-btn:hover {
    background: #3b7dd8;
}

/* Submission Status */
.submission-status {
    margin-top: 10px;
    padding: 8px;
    background: #e8f5e9;
    border-radius: 4px;
    color: #2e7d32;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
}

.submission-link {
    margin-left: auto;
    color: #1b5e20;
    text-decoration: none;
}

.submission-link:hover {
    text-decoration: underline;
}

/* Upload Form */
.upload-form-container {
    margin-top: 15px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 4px;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 10px;
}

.cancel-upload {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.submit-upload {
    padding: 6px 12px;
    background: #4caf50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}


.tasks-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.sort-controls {
            display: flex;
            gap: 10px;
            margin-left: auto;
            align-items: center;
        }
        
        .sort-btn {
            padding: 6px 12px;
            border: 1px solid var(--secondary-color);
            background: var(--background-white);
            color: var(--heading-color);
            border-radius: var(--border-radius);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 5px;
            transition: all 0.2s ease;
        }
        
        .sort-btn:hover {
            background-color: var(--background-light);
        }
        
        .sort-btn.active {
            background-color: var(--primary-color);
            color: white;
            border-color: var(--primary-color);
        }
        
        .sort-btn i {
            font-size: 0.9em;
        }
.task-card {
    padding: 15px;
    border: 2px solid var(--secondary-color);
    border-radius: 6px;
    background: var(--background-white);
}

.task-card.completed {
    background: #f8f9fa;
    opacity: 0.8;
}
.task-card.newtask {
  position: relative;
  background-color: var(--background-white);
  border-radius: 8px;
  overflow: hidden; /* Contains the pseudo-element */
  z-index: 1;
}

/* Gradient border animation */
.task-card.newtask::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  z-index: -1;
  background: linear-gradient(
    135deg, 
    var(--accent-color-2), 
    var(--accent-color-3), 
    var(--accent-color-2)
  );
  background-size: 200% 200%;
  animation: gradient-border 3s ease infinite;
  border-radius: 10px;
  margin: 0; /* Matches border position */
}

@keyframes gradient-border {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}



/* Inner glow effect */
.task-card.newtask {
  box-shadow: 
    0 0 8px rgba(76, 175, 80, 0.1),
    inset 0 0 10px rgba(76, 175, 80, 0.05);
}
/* Milestone Header Styles */
.milestone-header {
    padding: 8px 12px;
    background-color: var(--secondary-color);
    border-radius: 4px 4px 0 0;
    margin: -12px -12px 12px -12px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #e0e0e0;
}

.milestone-header i {
    color: var(--accent-color-2);
}

.milestone-name {
    font-weight: 600;
    color: var(--heading-color);
    font-size: 0.9em;
}
/* Visual connection between milestone and task */
.task-card:not(.completed) .milestone-header {
    background: linear-gradient(to right, var(--secondary-color), var(--accent-color-2));
}

.task-card.completed .milestone-header {
    background: linear-gradient(to right, #f0f7ff, #e8f5e9);
}
.task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.task-status {
    font-size: 0.95em;
    padding: 3px 8px;
    border-radius: 4px;
}
 .task-due {
    color: var(--text-muted);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
    
.task-due.urgent {
    color: #e53935;
    font-weight: bold;
}
    
.task-due i {
    font-size: 0.9em;
}
.task-timing {
        color: var(--text-muted);
        font-size: 0.85rem;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    .task-timing .urgent {
        color: #e53935;
        font-weight: bold;
    }
    
    .task-timing .late {
        color: #e53935;
    }
    
    .task-timing .early {
        color: #4caf50;
    }
    
    .task-timing i {
        font-size: 0.9em;
    }

.task-card:not(.completed) .task-status {
    color: #d32f2f;
}

.task-card.completed .task-status {
    color: #388e3c;
}

.task-description {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-bottom: 10px;
}

.task-footer {
    /* display: flex; */
    justify-content: space-between;
    align-items: center;
    font-size: 0.8em;
    color: var(--text-muted);
}

.task-action {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background: #f5f5f5;
    cursor: pointer;
    transition: background 0.2s ease;
}

.task-action:hover {
    background: #e0e0e0;
}

.empty-content {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

.empty-content i {
    font-size: 2em;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.error-message {
    color: #c62828;
    text-align: center;
    padding: 20px;
}




/* !!!!!COURSES!!!!! */

.courses-container {
    padding: 20px;
    background: var(--background-white);
    border-radius: 10px;
}

.courses-container h2 {
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.course-card {
    background: var(--background-white);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.course-header h3 {
    margin: 0;
    color: var(--heading-color);
    font-size: 1.1rem;
}

.course-grade {
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.course-grade.excellent { background: #e8f5e9; color: #2e7d32; }
.course-grade.good { background: #e3f2fd; color: #1565c0; }
.course-grade.average { background: #fff8e1; color: #ff8f00; }
.course-grade.poor { background: #ffebee; color: #c62828; }
.course-grade.no-grade { background: #f5f5f5; color: #757575; }

.course-dates {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-progress {
    margin-bottom: 20px;
}



.course-progress span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.course-actions {
    display: flex;
    gap: 10px;
}

.action-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    background: #f5f5f5;
    color: var(--text-color);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: #e0e0e0;
}

.study-btn {
    background: var(--secondary-color);
    color: var(--accent-color-2);
}

.study-btn:hover {
    background: #bbdefb;
}

.tasks-btn {
    background: var(--accent-color-2);
    color: var(--secondary-color);
}

.tasks-btn:hover {
    background: #c8e6c9;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.empty-state h3 {
    color: var(--text-color);
    margin-bottom: 10px;
}



.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 var(--text-color);
    height: 40px;
    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-block {
    cursor: pointer;
    color: #000000;
    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-block: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-block:hover .course-tooltip {
    opacity: 1;
    visibility: visible;
    top: calc(100% + 5px);
}

.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;
    }
}






@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(44, 214, 50, 0.4); }
    100% { box-shadow: 0 0 0 15px rgba(44, 214, 50, 0); }
}

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

.excellent .grade-badge {
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { filter: brightness(1); }
    50% { filter: brightness(1.5); }
    100% { filter: brightness(1); }
}
.task-meta {
    display: flex;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 5px;
}

.grade-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
}

.grade-badge.excellent {
    background-color: #2ecc71;
    color: white;
}

.grade-badge.good {
    background-color: #f39c12;
    color: white;
}

.grade-badge.average {
    background-color: #3498db;
    color: white;
}

.grade-badge.poor {
    background-color: #e74c3c;
    color: white;
}
.grades-container {
    display: grid;
    gap: 20px;
}


/* <<<<<<<<<<<<<<<<<<<<<<   analitics    >>>>>>>>>>>>>>>>>>>>>> */
/* Analytics Panel */
.analytics-panel {
    margin-top: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}
.trend-visualization {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.trend-svg {
  width: 100%;
  height: 100%;
}
.trend-line-container {
  height: 70px;
  background-color: var(--background-light);
  border-radius: var(--border-radius);
  overflow: hidden;
}
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}
.analytics-card.trend-card {
  background-color: var(--background-white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  border: 1px solid var(--secondary-color);
  font-family: var(--font-family);
  color: var(--text-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.trend-title {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  border-left: 4px solid var(--secondary-color);
  padding-left: 0.5rem;
}

.analytics-card.trend-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}
.analytics-card {
    background: var(--background-white);
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}
.confidence-bar {
  display: inline-block;
  width: calc(var(--confidence, 50) * 1%);
  height: 6px;
  background-color: var(--accent-color-2);
  border-radius: 3px;
  margin-left: 1rem;
}
.engagement-card {
  background-color: var(--background-white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  font-family: var(--font-family);
  color: var(--text-color);
  border: 1px solid var(--secondary-color);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.engagement-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.engagement-title {
  font-size: 1.2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  border-left: 4px solid var(--secondary-color);
  padding-left: 0.5rem;
  text-align: left;
}

.engagement-circle {
  width: 100px;
  height: 100px;
  margin: 0 auto;
}

.circular-chart {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: var(--background-light);
  stroke-width: 3.8;
}

.circle {
  fill: none;
  stroke-width: 3.8;
  stroke-linecap: round;
  stroke-dasharray: 0, 100;
  transition: stroke-dasharray 1s ease-out;
}

.circle-text {
  font-family: var(--font-family); /* use your root variable */
  font-size: 8px;
  fill: var(--text-color); /* sets the color of the text */
  text-anchor: middle; /* centers horizontally */
  dominant-baseline: middle; /* centers vertically */
  font-weight: bold;
  transform: rotate(90deg);
      transform-origin: center;

}.circular-chart {
  overflow: visible;

}
.circular-chart.green .circle {
  stroke: #00c851;
}

.circular-chart.yellow .circle {
  stroke: #ffbb33;
}

.circular-chart.red .circle {
  stroke: #ff4444;
}

.engagement-details {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.08rem;
  color: var(--secondary-color);
  margin-top: 2rem;
}
.trend-summary {
  font-size: 0.9rem;
  color: var(--text-color);
  margin-top: 0.5rem;
}
.analytics-card h5 {
    margin-top: 0;
    color: var(--heading-color);
    font-size: 0.9rem;
}

.trend-indicator {
  height: 6px;
  border-radius: 3px;
  margin-top: 0.5rem;
}
.trend-detail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 1.08rem;
  color: var(--secondary-color);
  margin-top: 0.5rem;
}
.trend-indicator.improving {
    color: #28a745;
}

.trend-indicator.declining {
    color: #dc3545;
}

.analytics-toggle-btn {
    background: none;
    border: none;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 8px 0;
    font-size: 0.9rem;
}

.analytics-toggle-btn:hover {
    text-decoration: underline;
}

.suggestions {
    background: var(--background-light);
    /* border-left: 4px solid var(--accent-color-2); */
    padding: 16px 20px;
    margin-top: 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-family: var(--font-family);
}

.suggestions h5 {
    margin-top: 0;
    margin-bottom: 12px;
    color: var(--secondary-color);
    font-size: 1.1rem;
    font-weight: 600;
}

.recommendation-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recommendation-list li {
    display: flex;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 10px;
}


.rec-bullet {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color-2);
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.rec-content {
    font-size: 0.95rem;
    color: var(--text-color);
    line-height: 1.4;
}
.performance-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(
        var(--accent-color-2) calc(var(--percentage) * 360deg),
        #f0f0f0 0deg
    );
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    position: relative;
}
.pulse-ring .circle {
  stroke: var(--accent-color-2);
  stroke-dasharray: 90, 100;
  stroke-width: 3.8;
  fill: none;
  stroke-linecap: round;
  animation: pulseStroke 2s ease-in-out infinite;
}

@keyframes pulseStroke {
  0% {
    stroke-dasharray: 10, 100;
  }
  50% {
    stroke-dasharray: 90, 100;
  }
  100% {
    stroke-dasharray: 10, 100;
  }
}




.performance-details {
    flex: 1;
}
.worst-task {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: #fff8f8;
    border-radius: 5px;
    font-size: 0.85rem;
}

.worst-task p {
    margin: 0.2rem 0 0;
    color: #d32f2f;
    font-weight: 500;
}

.btn-improve {
    margin-top: 0.8rem;
    background: #f5f5f5;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-improve:hover {
    background: #e0e0e0;
}
.performance-circle::before {
    content: '';
    position: absolute;
    width: 70px;
    height: 70px;
    background: var(--background-white);
    border-radius: 50%;
}

.performance-circle span {
    position: relative;
    font-weight: bold;
    color: var(--heading-color);
}
.weak-areas-card {
   background-color: var(--background-white);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  font-family: var(--font-family);
  color: var(--text-color);
  border: 1px solid var(--secondary-color);
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.weak-areas-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
}

.weakness-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.weakness-list li {
  background-color: var(--background-light);
  border-left: 4px solid var(--accent-color-2);
  padding: 0.75rem;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pattern-category {
  font-weight: bold;
  color: var(--primary-color);
}

.pattern-description {
  color: var(--text-color);
  font-size: 0.9rem;
}

.pattern-points {
  /* color: var(--accent-color-3); */
  font-weight: bold;
  font-size: 0.85rem;
}

.points-lost-summary {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  font-weight: bold;
  color: var(--accent-color-1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.performance-feedback {
    font-size: 0.8rem;
    color: var(--secondary-color);
    margin-top: 5px;
}
.performance-title {
    text-align: center;
    margin-top: 8px;
}

.performance-title h5 {
    margin-bottom: 2px;
    color: var(--heading-color);
}

.performance-title small {
    font-size: 0.7rem;
    color: var(--secondary-color);
    opacity: 0.9;
    margin-bottom: 5px;
}
.trend-svg {
    width: 100%;
    height: 60px;
}

.trend-path {
    fill: none;
    stroke: var(--accent-color-2);
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.confidence-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  background: hsl(calc(var(--confidence) * 120), 70%, 85%);
  font-size: 0.8em;
}





.course-grade-card {
    padding: 20px;
}

.course-grade-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.course-grade-badge {
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.2rem;
}

.grade-breakdown {
    display: grid;
    gap: 20px;
    margin-top: 15px;
}

.breakdown-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    background: var(--background-light);
    padding: 15px;
    border-radius: var(--border-radius);
}

.stat-item {
    display: flex;
    justify-content: space-between;
}

.task-grades {
    margin-top: 20px;
}

.task-grade-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.task-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.task-type {
    font-size: 0.8rem;
    padding: 3px 8px;
    border-radius: 4px;
    text-transform: capitalize;
}

.task-type.exam { background: #f3bec6; color: #da2c2c; }
.task-type.test { background: #f1d9a6; color: #f18b2b; }
.task-type.exercise { background: #e3f2fd; color: #1565c0; }

.task-grade {
    padding: 5px 12px;
    border-radius: 12px;
    font-weight: bold;
}

/* Grade color classes */
.excellent { background: #24be29; color: rgb(255, 251, 0); }
.good { background: #8fc52b; color: white; }
.average { background: #ffc107; color: black; }
.poor { background: #f44336; color: white; }

.no-grades {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}
/* Responsive adjustments */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== RESPONSIVE DESIGN ==================== */
@media (max-width: 992px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding-top: 70px;
    }

    .top-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 576px) {
    .card {
        padding: 15px;
    }
}

/* ===== "Το προφίλ μου" ===== */
.profile-info.profile-btn {
    cursor: pointer;
    border-radius: 10px;
    padding: 6px;
    transition: background 0.15s ease;
}

.profile-info.profile-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.sp-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 11000;
    padding: 16px;
}

.sp-modal {
    width: min(440px, 100%);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    background: var(--background-white);
    color: var(--text-color);
    border-radius: 14px;
    box-shadow: 0 16px 44px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.sp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-color);
}

.sp-head h3 { margin: 0; font-size: 1.05rem; color: var(--heading-color); }

.sp-close {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
}

.sp-body { padding: 16px 18px; overflow-y: auto; }

.sp-loading { color: var(--text-muted); font-style: italic; margin: 0; }

.sp-readonly {
    background: var(--background-light);
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 16px;
}

.sp-readonly > div {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 3px 0;
    font-size: 0.88rem;
}

.sp-readonly span { color: var(--text-muted); }
.sp-readonly strong { text-align: right; word-break: break-word; }

.sp-note {
    margin: 8px 0 0;
    font-size: 0.76rem;
    color: var(--text-muted);
    font-style: italic;
}

/* ===== "Το εικονίδιό μου" =====
   The icons are SVG files (avatars/), stored in the same column a photo would
   use, so the circle here and the one in the sidebar draw the same thing. */
.sp-avatars { margin-bottom: 18px; }

.sp-avatars h4 {
    margin: 0 0 10px;
    font-size: 0.9rem;
    color: var(--heading-color);
}

.sp-avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    gap: 8px;
}

.sp-avatar {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px;
    border: 2px solid transparent;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    transition: transform var(--transition-speed) ease,
                border-color var(--transition-speed) ease;
}

.sp-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
}

.sp-avatar:hover:not(:disabled) {
    transform: scale(1.08);
    border-color: color-mix(in srgb, var(--primary-color) 45%, transparent);
}

.sp-avatar:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.sp-avatar.is-on {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

/* Saving: the whole grid waits for the answer rather than letting a second
   click race the first. */
.sp-avatar:disabled { opacity: 0.55; cursor: progress; }

/* The "no icon" cell is the sidebar circle itself, so it is coloured the same. */
.sp-avatar-none {
    background: var(--accent-color-2);
    color: color-mix(in srgb, var(--accent-color-2) 20%, #0b0f14);
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 700;
}

.sp-form label {
    display: block;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sp-form input {
    display: block;
    width: 100%;
    margin-top: 5px;
    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;
}

.sp-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.sp-actions { display: flex; gap: 10px; margin-top: 6px; }

.sp-actions button {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 9px;
    cursor: pointer;
    font-size: 0.92rem;
}

.sp-save { background: var(--primary-color); color: #fff; }
.sp-save:disabled { opacity: 0.6; cursor: not-allowed; }

.sp-cancel {
    background: var(--background-light);
    color: var(--text-color);
    border: 1px solid var(--border-color) !important;
}

/* ===== 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-block: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);
    }
}

/* ===== Απουσίες on the course card =====
   From the register the teacher keeps. Absent until the school keeps one. */
.course-attendance {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -6px 0 14px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.course-attendance.is-clean { color: #2e7d32; }
.course-attendance.is-many  { color: #c62828; font-weight: 600; }

[data-theme="dark"] .course-attendance.is-clean { color: #4ade80; }
[data-theme="dark"] .course-attendance.is-many  { color: #f87171; }

/* ===== 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 student as a whole =====
   Written for the student by the nightly analysis. The left edge carries where
   they stand; the colours are fixed, so they mean the same in every theme. */
.student-overview {
    border-left: 6px solid var(--accent-color-2);
    margin-bottom: 20px;
}
.student-overview.is-excelling     { border-left-color: #2e7d32; }
.student-overview.is-on_track      { border-left-color: #558b2f; }
.student-overview.is-needs_support { border-left-color: #b26a00; }
.student-overview.is-at_risk       { border-left-color: #c62828; }

.overview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.overview-head h3 { margin: 0; color: var(--heading-color); }

.overview-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    background: var(--accent-color-2);
}
.is-excelling .overview-badge     { background: #2e7d32; }
.is-on_track .overview-badge      { background: #558b2f; }
.is-needs_support .overview-badge { background: #b26a00; }
.is-at_risk .overview-badge       { background: #c62828; }

.overview-text { margin: 12px 0; font-size: 1rem; line-height: 1.6; color: var(--text-color); }

.overview-cols {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}
.overview-cols h4 { margin: 0 0 6px; font-size: 0.9rem; color: var(--heading-color); }
.overview-cols ul,
.overview-cols ol { margin: 0; padding-left: 20px; font-size: 0.92rem; line-height: 1.55; }

.overview-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }
.chip {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.82rem;
    border: 1px solid currentColor;
}
.chip.is-good { color: #2e7d32; }
.chip.is-weak { color: #b26a00; }
[data-theme="dark"] .chip.is-good { color: #4ade80; }
[data-theme="dark"] .chip.is-weak { color: #fbbf24; }

/* One or two sentences on how the class is going, above its analysis. */
.analysis-summary {
    margin: 0 0 14px;
    padding: 10px 14px;
    border-radius: 8px;
    background: var(--background-light);
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-color);
}

/* ===== "Ανάλυσε αυτό το μάθημα" ===== */
.deep-dive-btn {
    margin-left: 8px;
    padding: 8px 14px;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    background: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
}
.deep-dive-btn:hover { background: var(--primary-color); color: #fff; }
[data-theme="dark"] .deep-dive-btn { border-color: var(--accent-color-2); color: var(--accent-color-2); }
[data-theme="dark"] .deep-dive-btn:hover { background: var(--accent-color-2); color: #10151b; }

.dd-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);
}

.dd-modal {
    width: min(640px, 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);
}

.dd-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}
.dd-head h3   { margin: 0 0 2px; color: var(--heading-color); }
.dd-head span { font-size: 0.85rem; color: var(--text-muted); }

.dd-close {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-muted);
}

.dd-body { padding: 16px 20px 20px; overflow-y: auto; line-height: 1.55; }
.dd-body h4 { margin: 18px 0 6px; font-size: 0.95rem; color: var(--heading-color); }
.dd-body p  { margin: 0 0 10px; }

.dd-muted, .dd-intro, .dd-when { color: var(--text-muted); }
.dd-when { font-size: 0.8rem; font-style: italic; }

.dd-headline {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--heading-color);
}

.dd-since { font-size: 0.9rem; color: var(--text-muted); }

.dd-reasons,
.dd-questions { margin: 0; padding: 0; list-style: none; }
.dd-reasons li {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-left: 3px solid var(--accent-color-2);
    border-radius: 0 8px 8px 0;
    background: var(--background-light);
}
.dd-reasons span { font-size: 0.85rem; color: var(--text-muted); }
.dd-questions li::before { content: '? '; font-weight: 700; color: var(--accent-color-2); }

.dd-plan { margin: 0; padding-left: 22px; }
.dd-plan li { margin-bottom: 6px; }
.dd-plan em { display: block; font-size: 0.82rem; color: var(--text-muted); }

.dd-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--background-light);
    font-size: 0.9rem;
}
.dd-status.is-busy  { border-left: 4px solid var(--accent-color-2); }
.dd-status.is-stale { border-left: 4px solid #b26a00; }
.dd-status.is-bad   { border-left: 4px solid #c62828; }

.dd-spinner {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent-color-2);
    border-radius: 50%;
    animation: dd-spin 0.8s linear infinite;
}
@keyframes dd-spin { to { transform: rotate(360deg); } }

.dd-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}
.dd-allowance { font-size: 0.8rem; color: var(--text-muted); }

.dd-ask {
    padding: 10px 16px;
    border: none;
    border-radius: 9px;
    background: var(--primary-color);
    color: #fff;
    cursor: pointer;
    font-size: 0.92rem;
}
.dd-ask:hover    { background: var(--secondary-color); }
.dd-ask:disabled { opacity: 0.6; cursor: progress; }
