/* ============================================
   RENDTACOPIE - PROF CSS
   Dashboard, devoirs, correction, etc. prof
   ============================================ */

/* ============================================
   PROF COLOR OVERRIDES
   ============================================ */
.prof-theme .header-nav a.active {
    background: var(--prof-light);
    color: var(--prof-color);
}

.prof-theme .stat-value {
    color: var(--prof-color);
}

.prof-theme .btn-primary {
    background: var(--prof-color);
}

.prof-theme .btn-primary:hover {
    background: var(--prof-dark);
}

/* ============================================
   DASHBOARD STATS
   ============================================ */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.dashboard-stat {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.dashboard-stat:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.dashboard-stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--prof-color);
    line-height: 1.2;
}

.dashboard-stat-label {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

/* ============================================
   DEVOIRS TABLE
   ============================================ */
.devoirs-filters {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.devoirs-filters form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.devoirs-filters .form-select {
    width: auto;
    min-width: 150px;
}

/* ============================================
   TABLE ENHANCEMENTS
   ============================================ */
.card .table {
    margin: -1.5rem;
    width: calc(100% + 3rem);
}

.card .table th:first-child,
.card .table td:first-child {
    padding-left: 1.5rem;
}

.card .table th:last-child,
.card .table td:last-child {
    padding-right: 1.5rem;
}

.table a {
    color: var(--prof-color);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.table a:hover {
    color: var(--prof-dark);
}

/* ============================================
   DEVOIR DETAIL
   ============================================ */
.devoir-header {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
}

.devoir-info h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.devoir-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    color: var(--gray-500);
    font-size: 0.9rem;
}

.devoir-actions {
    display: flex;
    gap: 0.75rem;
}

/* ============================================
   COPIES LIST
   ============================================ */
.copies-table {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    overflow: hidden;
}

.copies-table .table {
    margin: 0;
    width: 100%;
}

/* ============================================
   CORRECTION PAGE
   ============================================ */
.correction-header {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.correction-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.correction-meta {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.correction-question {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--gray-300);
}

.correction-question.validated {
    border-left-color: var(--success);
}

.correction-question.modified {
    border-left-color: var(--warning);
}

.correction-question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.correction-question-title {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--gray-900);
}

.correction-question-content {
    color: var(--gray-700);
    line-height: 1.7;
    margin-bottom: 1rem;
    white-space: pre-line;
}

.correction-reponse {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.correction-ia {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
}

.correction-ia-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.correction-note-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.correction-note-input input {
    width: 60px;
    text-align: center;
    font-weight: 600;
}

/* ============================================
   NOUVEAU DEVOIR FORM
   ============================================ */
.nouveau-devoir-form {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.nouveau-devoir-form .form-group {
    margin-bottom: 1.5rem;
}

.questions-container {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1rem;
    background: var(--gray-50);
}

.question-item {
    background: var(--bg-white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    position: relative;
}

.question-item:last-child {
    margin-bottom: 0;
}

.question-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-item-remove {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.25rem;
}

/* ============================================
   CLASSES PAGE
   ============================================ */
.classes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.classe-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.classe-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.classe-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.classe-card-meta {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.classe-card-code {
    background: var(--gray-100);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-family: monospace;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* ============================================
   PROMPTS PAGE
   ============================================ */
.prompts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.prompt-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
}

.prompt-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
}

.prompt-card-preview {
    color: var(--gray-600);
    font-size: 0.9rem;
    line-height: 1.5;
    max-height: 80px;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .dashboard-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .dashboard-stat {
        padding: 1rem;
    }

    .dashboard-stat-value {
        font-size: 2rem;
    }

    .devoirs-filters form {
        flex-direction: column;
        align-items: stretch;
    }

    .devoirs-filters .form-select {
        width: 100%;
    }

    .devoir-header {
        flex-direction: column;
    }

    .devoir-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .devoir-actions .btn {
        flex: 1;
    }

    .correction-question-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .classes-grid,
    .prompts-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   CORRECTION PAGE LAYOUT
   ============================================ */
.correction-grid {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 100px;
}

.sidebar .card {
    margin-bottom: 1rem;
}

/* Réponse élève dans correction */
.reponse-eleve {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
    white-space: pre-line;
    line-height: 1.7;
}

/* Correction IA dans correction */
.correction-ia {
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--gray-200);
}

/* Note input */
.note-input {
    width: 70px;
    text-align: center;
    font-weight: 600;
}

/* Question card dans correction */
.question-card {
    border-left: 4px solid var(--gray-200);
}

.question-card.has-response {
    border-left-color: var(--success);
}

@media (max-width: 1024px) {
    .correction-grid {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}
