/* Container */
.mentora-exams-wrapper {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.mentora-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 25px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

/* Grid System */
.mentora-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    align-items: stretch; /* CRITICAL: Stretches cards to match the tallest one */
}

/* Card Styling - Modern Material Design */
.mentora-card {
    background: #ffffff;
    border: 1px solid #eef2f7; /* lighter border */
    border-radius: 8px;
    padding: 20px;
    display: flex;       /* Turn on Flexbox */
    flex-direction: column; /* Stack items vertically */
    height: 100%;        /* Force it to fill the grid cell height */
    box-shadow: 0 4px 6px rgba(0,0,0,0.02); /* subtle base shadow */
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1); /* Smooth physics */
    border-top: 4px solid #27ae60; /* Green Top for active status */
}

.mentora-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
    border-color: #d1d1d1;
}

/* Clickable Card Enhanced Hover - HIGH IMPACT LIFT */
.mentora-card-clickable {
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.mentora-card-clickable:hover {
    transform: translateY(-8px); /* Move up */
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); /* Deep soft shadow */
    border-color: #2271b1; /* Highlight border color */
}

.mentora-card-clickable:active {
    transform: translateY(-4px);
}

/* Expired Cards - Desaturated with Red Top Border */
.mentora-card-expired {
    opacity: 0.7; /* Fade it out slightly */
    background: #fafafa;
    cursor: not-allowed;
    border-top: 4px solid #e74c3c; /* Red Top for expired */
}

.mentora-card-expired:hover {
    transform: none; /* No lift for expired cards */
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

/* Icon */
.mentora-card-icon {
    font-size: 32px;
    color: #e74c3c; /* PDF Red */
    margin-bottom: 15px;
}
.mentora-card-icon .dashicons {
    width: auto;
    height: auto;
    font-size: inherit;
}

/* Content */
.mentora-card-content {
    flex-grow: 1;        /* Expands to push the footer down */
    display: flex;
    flex-direction: column;
}

.mentora-card-title {
    margin: 0 0 12px 0;
    font-size: 18px;
    font-weight: 600;
    color: #34495e;
    line-height: 1.4;
}

/* Badges - Modern Pill Shape with Pastel Colors */
.mentora-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* More space between tags */
    margin-bottom: 20px;
}

.mentora-badge {
    border-radius: 50px; /* Full pill shape */
    padding: 6px 14px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

/* Soft Blue for Level */
.mentora-badge.level {
    background: #e0f2fe;
    color: #0369a1;
}

/* Soft Green for Subject */
.mentora-badge.subject {
    background: #dcfce7;
    color: #15803d;
}

/* Fallback for generic badges */
.mentora-badge:not(.level):not(.subject) {
    background: #f3f4f6;
    color: #4b5563;
}

.mentora-year {
    font-size: 12px;
    color: #95a5a6;
    padding: 4px 0;
}

/* Button */
.mentora-card-footer {
    margin-top: auto;
}

.mentora-btn-download {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #3498db;
    color: #ffffff !important;
    text-decoration: none;
    padding: 10px 0;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color 0.2s;
}

.mentora-btn-download:hover {
    background-color: #2980b9;
    color: #ffffff !important;
}

/* Empty State */
.mentora-empty-state {
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
}

/* --- Phase 5: Secure Viewer Styles --- */

/* Prevent Selection / Copying globally in the viewer */
.mentora-viewer-modal {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* The Modal Background - Glassmorphism Effect */
.mentora-viewer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.6) !important; /* Dark blue-ish tint */
    backdrop-filter: blur(8px); /* The "Glass" effect */
    -webkit-backdrop-filter: blur(8px); /* Safari support */
    z-index: 99999; /* On top of everything */
    display: flex;
    justify-content: center;
    overflow-y: auto;
}

/* The Viewer Box */
.mentora-viewer-content {
    background: #525659;
    width: 90%;
    max-width: 1000px;
    margin: 20px auto;
    padding: 20px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    position: relative;
    min-height: 80vh;
}

/* The PDF Pages (Canvas) */
#mentora-pdf-canvas-container canvas {
    display: block;
    margin: 0 auto 20px auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    max-width: 100%;
    height: auto !important;
}

/* Close Button - TOP LEFT */
.mentora-close-btn {
    position: fixed;
    top: 20px;
    left: 30px;
    background: #d63638;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 100000;
    transition: all 0.2s ease;
}
.mentora-close-btn:hover {
    background: #a00;
    transform: scale(1.05);
}

/* Fullscreen Button - TOP LEFT (next to close) */
.mentora-fullscreen-btn {
    position: fixed;
    top: 20px;
    left: 150px; /* Positioned after the close button */
    background: #2271b1;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    border-radius: 5px;
    z-index: 100000;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.mentora-fullscreen-btn:hover {
    background: #135e96;
    transform: scale(1.05);
}

.mentora-fullscreen-btn:active {
    transform: scale(0.95);
}

.mentora-fullscreen-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Fullscreen Mode Styles */
.mentora-viewer-modal.fullscreen-mode {
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

.mentora-viewer-modal.fullscreen-mode .mentora-viewer-content {
    width: 100% !important;
    max-width: 100% !important;
    height: 100vh !important;
    margin: 0 !important;
    border-radius: 0 !important;
}

.mentora-viewer-modal.fullscreen-mode #mentora-pdf-canvas-container {
    height: calc(100vh - 60px);
    overflow-y: auto;
}

/* Change icon when in fullscreen */
.mentora-viewer-modal.fullscreen-mode .mentora-fullscreen-btn .dashicons::before {
    content: "\f506"; /* dashicons-fullscreen-exit-alt */
}

/* Smooth transition for fullscreen */
.mentora-viewer-modal {
    transition: all 0.3s ease;
}

.mentora-viewer-content {
    transition: all 0.3s ease;
}

/* ============================================================================
   EXAM UPLOAD MODAL - Phase 2 Enhancement (Frontend Manager Dashboard)
   ============================================================================ */

/* Upload Button (Replaces Left Card) */
.mentora-btn-upload {
    width: 100%;
    padding: 60px 20px;
    font-size: 24px;
    font-weight: 700;
    color: #2271b1;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 3px dashed #3b82f6;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.mentora-btn-upload:hover {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
}

.mentora-btn-upload:active {
    transform: translateY(0);
}

/* Modal Overlay (Reuse auth-modal pattern) */
#mentora-exam-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999999 !important;
    display: none;
    align-items: center !important;
    justify-content: center !important;
    overflow-y: auto;
    padding: 20px;
}

/* Modal Box */
.mentora-modal-box {
    background: #ffffff;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow-y: auto;
    margin: auto;
}

/* Modal Header */
.mentora-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

.mentora-modal-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.mentora-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    color: #95a5a6;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.mentora-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: rotate(90deg);
}

/* Modal Form */
.mentora-modal-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Form Row Grid System */
.form-row {
    display: grid;
    gap: 12px;
    margin-bottom: 0;
}

.form-row.full-width {
    grid-template-columns: 1fr;
}

.form-row.two-col {
    grid-template-columns: 1fr 1fr;
}

.form-row.three-col {
    display: grid;
    grid-template-columns: 2fr 1.5fr 1fr; /* Subject gets more space */
    gap: 15px;
    align-items: end; /* Aligns inputs to the bottom so they match */
}

/* Ensure labels and inputs stick together */
.form-row.three-col .mentora-form-group {
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Pushes content down */
}

/* Reset Label Margins to prevent floating */
.form-row.three-col label {
    margin-bottom: 8px !important; /* Consistent small gap */
    line-height: 1.2;
    height: auto;
}

/* Force exact matching heights for inputs and dropdowns */
.form-row.three-col select,
.form-row.three-col input {
    height: 42px !important;
    box-sizing: border-box;
    margin: 0;
    width: 100%;
}

/* ============================================================================
   FLATPICKR CALENDAR PICKER - Z-INDEX FIX FOR MODAL
   ============================================================================ */

/* Force Flatpickr calendar to appear on top of the high z-index modal */
.flatpickr-calendar {
    z-index: 99999999 !important;
}

/* Ensure input cursor shows it's clickable */
#start_time {
    cursor: pointer;
}

#start_time:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

/* Duration Controls - Merged Compact Calculator Box */
.duration-controls-merged {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
}

.duration-presets-compact {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.duration-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.btn-adjust {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-adjust.btn-minus,
.btn-adjust.btn-minus-small {
    background: #dc2626;
}

.btn-adjust.btn-minus:hover,
.btn-adjust.btn-minus-small:hover {
    background: #b91c1c;
    transform: scale(1.05);
}

.btn-adjust.btn-plus,
.btn-adjust.btn-plus-small {
    background: #16a34a;
}

.btn-adjust.btn-plus:hover,
.btn-adjust.btn-plus-small:hover {
    background: #15803d;
    transform: scale(1.05);
}

.btn-adjust:active {
    transform: scale(0.95);
}

.duration-display {
    font-size: 20px;
    font-weight: bold;
    padding: 10px 20px;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    min-width: 100px;
    text-align: center;
    color: #1f2937;
    transition: all 0.3s ease;
}

/* Visual Feedback Animation */
.duration-display.flash {
    background: #dcfce7;
    border-color: #86efac;
}

/* Duration Presets */
.duration-presets {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px;
    background: #f9fafb;
    border-radius: 8px;
}

.btn-preset {
    background: #3b82f6;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-preset:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.btn-preset:active {
    transform: scale(0.95);
}

/* Responsive Adjustments for Modal */
@media (max-width: 768px) {
    .mentora-modal-box {
        width: 95%;
        padding: 20px;
        max-height: 95vh;
    }

    .form-row.three-col {
        grid-template-columns: 1fr; /* Stack on mobile */
    }

    .form-row.two-col {
        grid-template-columns: 1fr;
    }

    .duration-controls {
        flex-wrap: wrap;
        gap: 8px;
    }

    .btn-adjust {
        padding: 6px 12px;
        font-size: 13px;
    }

    .duration-display {
        font-size: 18px;
        padding: 8px 16px;
        min-width: 80px;
    }

    .mentora-btn-upload {
        padding: 40px 20px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .mentora-modal-header h2 {
        font-size: 18px;
    }

    .duration-presets {
        justify-content: flex-start;
    }
}

/* View Button (Replaces Download) */
.mentora-btn-view {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #2271b1;
    color: #ffffff !important;
    border: none;
    padding: 10px 0;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}
.mentora-btn-view:hover {
    background-color: #135e96;
}

.mentora-btn-view .dashicons {
    font-size: 18px;
    height: 18px;
    width: 18px;
    vertical-align: middle;
    margin-top: -2px;
}

/* Print Protection */
@media print {
    body { display: none !important; }
    html::after {
        content: "Printing is disabled for security reasons.";
        display: block;
        padding: 20px;
        font-size: 24px;
    }
}

/* ============================================================================
   FULL-WIDTH LAYOUT (Library Manager Style)
   ============================================================================ */

/* Main Container - Full Width */
.mentora-exams-container {
    margin: 30px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Header Section - Title + Upload Button */
.mentora-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #eee;
}

.mentora-section-header .mentora-section-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
}

/* Primary Action Button (Upload Button) */
.mentora-section-header .mentora-btn-primary {
    background-color: #2271b1;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background-color 0.2s, transform 0.1s;
}

.mentora-section-header .mentora-btn-primary:hover {
    background-color: #135e96;
    transform: translateY(-1px);
}

.mentora-section-header .mentora-btn-primary:active {
    transform: translateY(0);
}

.mentora-section-header .mentora-btn-primary .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* ============================================================================
   CARD COMPONENTS
   ============================================================================ */

/* Base Card Styling */
.mentora-manager-card {
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
    transition: box-shadow 0.3s ease;
}

.mentora-manager-card:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.05);
}

/* Card Header */
.mentora-card-header {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #eee;
}

/* ============================================================================
   UPLOAD FORM STYLING (LEFT CARD)
   ============================================================================ */

.mentora-upload-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* Form Group */
.mentora-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mentora-form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 4px;
}

.mentora-form-group .required {
    color: #e74c3c;
    font-weight: bold;
}

.mentora-form-group .form-hint {
    font-size: 12px;
    color: #95a5a6;
    font-style: italic;
    display: block;
    margin-top: -2px;
    margin-bottom: 4px;
}

.mentora-form-group .form-hint-inline {
    font-size: 11px;
    color: #95a5a6;
    font-style: italic;
    font-weight: normal;
    margin-left: 8px;
    margin-right: 8px;
}

/* Input Fields */
.mentora-form-group input[type="text"],
.mentora-form-group input[type="datetime-local"],
.mentora-form-group input[type="file"],
.mentora-form-group select {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mentora-form-group input:focus,
.mentora-form-group select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.1);
}

.mentora-form-group select {
    cursor: pointer;
}

/* File Input Styling */
.mentora-form-group input[type="file"] {
    padding: 8px;
    font-size: 13px;
}

/* Form Actions - Cancel Left, Create Exam Right */
.mentora-form-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    gap: 15px;
    align-items: center;
}

.mentora-btn-cancel {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #6b7280;
    background-color: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 120px;
    height: 44px;
}

.mentora-btn-cancel:hover {
    background-color: #e5e7eb;
    color: #374151;
    border-color: #9ca3af;
}

.mentora-btn-primary {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background-color: #2271b1;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    min-width: 150px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mentora-btn-primary:hover {
    background-color: #135e96;
    transform: translateY(-1px);
}

.mentora-btn-primary:active {
    transform: translateY(0);
}

/* Ensure modal submit button has compact, auto-width styling */
#mentora-create-exam-form button[type="submit"] {
    width: auto !important;
    flex-grow: 0 !important;
    padding: 12px 24px !important;
    font-size: 16px !important;
    height: 44px !important;
    line-height: normal !important;
    min-height: unset !important;
    min-width: 150px !important;
}

/* Loading Spinner */
.mentora-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #666;
    font-size: 14px;
}

.mentora-spinner .spinner {
    float: none;
}

/* ============================================================================
   EXAM REPOSITORY TABLE (RIGHT CARD)
   ============================================================================ */

.mentora-table-wrapper {
    overflow-x: auto;
}

.mentora-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mentora-table thead {
    background-color: #f8f9fa;
}

.mentora-table th {
    text-align: left;
    padding: 12px 15px;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #ddd;
}

.mentora-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

.mentora-table tbody tr:hover {
    background-color: #f8f9fa;
}

.mentora-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* Title/Subject Column */
.exam-title {
    font-size: 15px;
    font-weight: 600;
    color: #34495e;
    display: block;
    margin-bottom: 4px;
}

.exam-subject {
    font-size: 12px;
    color: #95a5a6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Status Badges - Enhanced with Phase 2 Spec */
.badge-scheduled {
    background: #e0f2fe !important;
    color: #0369a1 !important;
    border: 1px solid #bae6fd;
}

.badge-active {
    background: #dcfce7 !important;
    color: #15803d !important;
    border: 1px solid #86efac;
}

.badge-expired {
    background: #fee2e2 !important;
    color: #dc2626 !important;
    border: 1px solid #fecaca;
}

/* Actions Cell */
.actions-cell {
    white-space: nowrap;
}

.mentora-action-btn {
    display: inline-block;
    padding: 6px 10px;
    font-size: 18px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-right: 6px;
    text-decoration: none;
}

.mentora-action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mentora-delete-exam {
    color: #dc2626;
    border-color: #fecaca;
}

.mentora-delete-exam:hover {
    background-color: #fee2e2;
    border-color: #dc2626;
}

.mentora-view-exam {
    color: #2271b1;
    border-color: #bfdbfe;
}

.mentora-view-exam:hover {
    background-color: #dbeafe;
    border-color: #2271b1;
    text-decoration: none;
}

/* Empty State Enhancement */
.mentora-empty-state {
    padding: 40px 30px;
    background: #f9fafb;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
    font-size: 14px;
}

.mentora-empty-state p {
    margin: 0;
}

/* ============================================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================================ */

@media (max-width: 768px) {
    .mentora-manager-card {
        padding: 20px;
    }

    .mentora-card-header {
        font-size: 18px;
    }

    .mentora-table {
        font-size: 13px;
    }

    .mentora-table th,
    .mentora-table td {
        padding: 10px 12px;
    }

    .exam-title {
        font-size: 14px;
    }

    .mentora-action-btn {
        padding: 4px 8px;
        font-size: 16px;
    }
}

/* Tablet Breakpoint */
@media (max-width: 1024px) and (min-width: 769px) {
    .mentora-manager-layout {
        grid-template-columns: 1fr 1.5fr; /* Adjust ratio for tablets */
    }
}

/* Phase 8: Visual Countdown Timer Styles - TOP RIGHT */
.mentora-timer-badge {
    position: fixed;
    top: 20px;
    right: 30px; /* TOP RIGHT - Opposite side of Close button */
    background: #2c3e50;
    color: #fff;
    padding: 10px 20px;
    font-size: 18px;
    font-weight: bold;
    font-family: 'Courier New', Courier, monospace; /* Keeps numbers aligned */
    border-radius: 5px;
    z-index: 100000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 1px solid #444;
}

/* Urgent Mode (Last 5 mins) */
.mentora-timer-urgent {
    background: #d63638 !important;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- CRITICAL MODAL OVERLAY FIX --- */

/* 1. The Container (Dark Background Overlay) */
#mentora-auth-modal {
    position: fixed !important;   /* Force it to float over everything */
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;      /* Full viewport width */
    height: 100vh !important;     /* Full viewport height */
    background-color: rgba(15, 23, 42, 0.6) !important; /* Dark blue-ish tint */
    backdrop-filter: blur(5px);   /* Glass effect */
    -webkit-backdrop-filter: blur(5px);
    z-index: 9999999 !important;  /* Sit on top of EVERYTHING */
    display: none;                /* Hidden by default, shown by JS */
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. The White Box (Modal Content) */
#mentora-auth-modal .mentora-modal-content {
    background: #ffffff !important;
    width: 90% !important;
    max-width: 450px !important;  /* Max width for desktop */
    padding: 40px !important;
    border-radius: 12px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
    position: relative !important;
    margin: auto !important;      /* Ensure centering */
    text-align: center !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: block !important;
}

/* 3. Input Field Styling */
#mentora-code-input {
    width: 100% !important;
    padding: 15px !important;
    margin: 20px 0 !important;
    font-size: 20px !important;
    text-align: center !important;
    letter-spacing: 3px !important;
    border: 2px solid #ddd !important;
    border-radius: 8px !important;
    text-transform: uppercase !important;
    font-family: monospace !important;
}
#mentora-code-input:focus {
    border-color: #2271b1 !important;
    outline: none !important;
}

/* ============================================================================
   TCF EXPRESSION ÉCRITE - ESSAY TEXTAREA STYLES
   ============================================================================ */

/* Essay Question Container */
.essay-question-container {
    margin: 2rem 0;
    animation: fadeInUp 0.4s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Essay Textarea - Enhanced Professional Design */
.essay-textarea {
    width: 100%;
    min-height: 500px;
    padding: 1.5rem;
    font-size: 18px;
    line-height: 1.8;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    background: #ffffff;
    color: #1f2937;
    resize: vertical;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.essay-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.06);
    background: #fafbfc;
}

.essay-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}

/* Word Counter Header */
.essay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.essay-instruction {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
}

.essay-word-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 20px;
    border: 2px solid #3b82f6;
    font-size: 14px;
    font-weight: 700;
    color: #3b82f6;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.1);
}

.essay-word-count-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.essay-word-count-number {
    font-size: 18px;
    font-weight: 800;
    color: #3b82f6;
}

/* Manual Evaluation Notice */
.essay-notice {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-left: 4px solid #f97316;
    border-radius: 8px;
    display: flex;
    align-items: start;
    gap: 0.75rem;
}

.essay-notice-icon {
    font-size: 20px;
    line-height: 1;
}

.essay-notice-text {
    font-size: 13px;
    color: #c2410c;
    font-weight: 600;
    line-height: 1.5;
    margin: 0;
}

/* ============================================================================
   TCF TUTOR GRADING DASHBOARD STYLES
   ============================================================================ */

/* Dashboard Container */
.tcf-grading-dashboard {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    background: #f8fafc;
    min-height: 100vh;
}

/* Dashboard Header */
.dashboard-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 3px solid #e2e8f0;
}

.dashboard-title {
    font-size: 32px;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dashboard-subtitle {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
}

/* NCLC Reference Table */
.nclc-reference-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 3px solid #3b82f6;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.15);
    position: relative;
    overflow: hidden;
}

.nclc-reference-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 50%, #3b82f6 100%);
}

.nclc-reference-title {
    font-size: 20px;
    font-weight: 800;
    color: #1e3a8a;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nclc-reference-title::before {
    content: '📊';
    font-size: 24px;
}

.nclc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
}

.nclc-badge {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    border: 3px solid #bfdbfe;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
    position: relative;
    overflow: hidden;
}

.nclc-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #3b82f6, transparent);
    transform: translateX(-100%);
    transition: transform 0.6s;
}

.nclc-badge:hover::before {
    transform: translateX(100%);
}

.nclc-badge:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
}

.nclc-level {
    font-size: 18px;
    font-weight: 900;
    margin-bottom: 0.5rem;
    color: #1e40af;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nclc-points {
    font-size: 13px;
    color: #64748b;
    font-weight: 700;
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    display: inline-block;
}

/* NCLC 10 - Expert (Green) */
.nclc-badge-10 {
    border-color: #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}

.nclc-badge-10:hover {
    border-color: #059669;
    box-shadow: 0 8px 16px rgba(16, 185, 129, 0.3);
}

.nclc-badge-10 .nclc-level {
    color: #047857;
}

.nclc-badge-10 .nclc-points {
    background: #d1fae5;
    color: #047857;
}

/* NCLC 9 - Very Advanced (Blue) */
.nclc-badge-9 {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.nclc-badge-9 .nclc-level {
    color: #1e40af;
}

.nclc-badge-9 .nclc-points {
    background: #dbeafe;
    color: #1e40af;
}

/* NCLC 8 - Advanced (Indigo) */
.nclc-badge-8 {
    border-color: #6366f1;
    background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
}

.nclc-badge-8 .nclc-level {
    color: #4338ca;
}

.nclc-badge-8 .nclc-points {
    background: #e0e7ff;
    color: #4338ca;
}

/* NCLC 7 - Target (Orange) ⭐ */
.nclc-badge-target,
.nclc-badge-7 {
    border-color: #f97316;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    position: relative;
}

.nclc-badge-target::after,
.nclc-badge-7::after {
    content: '⭐';
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    font-size: 20px;
    animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.8;
    }
}

.nclc-badge-target:hover,
.nclc-badge-7:hover {
    border-color: #ea580c;
    box-shadow: 0 8px 16px rgba(249, 115, 22, 0.3);
}

.nclc-badge-target .nclc-level,
.nclc-badge-7 .nclc-level {
    color: #c2410c;
}

.nclc-badge-target .nclc-points,
.nclc-badge-7 .nclc-points {
    background: #ffedd5;
    color: #c2410c;
}

/* NCLC 6 - Intermediate (Yellow) */
.nclc-badge-6 {
    border-color: #eab308;
    background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
}

.nclc-badge-6 .nclc-level {
    color: #a16207;
}

.nclc-badge-6 .nclc-points {
    background: #fef3c7;
    color: #a16207;
}

/* NCLC 5 - Basic Intermediate (Gray) */
.nclc-badge-5 {
    border-color: #94a3b8;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.nclc-badge-5 .nclc-level {
    color: #475569;
}

.nclc-badge-5 .nclc-points {
    background: #f1f5f9;
    color: #475569;
}

/* NCLC 4 - Initial (Light Gray) */
.nclc-badge-4 {
    border-color: #cbd5e1;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
}

.nclc-badge-4 .nclc-level {
    color: #64748b;
}

.nclc-badge-4 .nclc-points {
    background: #f8fafc;
    color: #64748b;
}

/* Special Note Below Table */
.nclc-reference-note {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
    border-left: 4px solid #f97316;
    border-radius: 8px;
    font-size: 13px;
    color: #c2410c;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nclc-reference-note::before {
    content: '⭐';
    font-size: 18px;
}

/* Submission Cards */
.submission-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 2px solid #e5e7eb;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.submission-card:hover {
    border-color: #3b82f6;
    box-shadow: 0 8px 16px rgba(59, 130, 246, 0.1);
    transform: translateY(-2px);
}

/* Student Header */
.student-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f1f5f9;
}

.student-info h3 {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.25rem 0;
}

.student-email {
    font-size: 14px;
    color: #64748b;
    margin-bottom: 0.5rem;
}

.submission-date {
    font-size: 12px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
    border: 2px solid #fbbf24;
}

/* Question Section */
.question-section {
    margin-bottom: 1.5rem;
}

.question-label {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-text {
    font-size: 14px;
    color: #64748b;
    font-style: italic;
    background: #f8fafc;
    padding: 1rem;
    border-radius: 10px;
    border-left: 3px solid #3b82f6;
}

/* Essay Display */
.essay-display {
    margin-bottom: 1.5rem;
}

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

.essay-word-badge {
    font-size: 12px;
    color: #64748b;
    background: #f1f5f9;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-weight: 600;
}

.essay-content {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid #3b82f6;
    font-size: 16px;
    line-height: 1.8;
    color: #1e293b;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 400px;
    overflow-y: auto;
}

/* Grading Section */
.grading-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.grading-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-input-container {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.score-label {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
}

.score-input {
    width: 100px;
    padding: 0.75rem;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: white;
    color: #1e293b;
    transition: all 0.2s ease;
}

.score-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

.nclc-preview {
    flex: 1;
    padding: 0.75rem 1.25rem;
    background: white;
    border-radius: 10px;
    border: 2px solid #cbd5e1;
    font-size: 16px;
    font-weight: 700;
}

.nclc-preview-text {
    color: #3b82f6;
}

/* Feedback Textarea */
.feedback-container {
    margin-bottom: 1.5rem;
}

.feedback-label {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.5rem;
    display: block;
}

.feedback-textarea {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    font-size: 14px;
    line-height: 1.6;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    background: white;
    color: #1e293b;
    resize: vertical;
    transition: all 0.2s ease;
}

.feedback-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Action Buttons */
.grading-actions {
    display: flex;
    gap: 1rem;
}

.btn-submit-grade {
    flex: 1;
    padding: 0.75rem 1.5rem;
    font-size: 16px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-submit-grade:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

.btn-submit-grade:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-cancel-grade {
    padding: 0.75rem 1.5rem;
    font-size: 16px;
    font-weight: 700;
    color: #475569;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel-grade:hover {
    border-color: #94a3b8;
    background: #f8fafc;
}

.btn-start-grading {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 16px;
    font-weight: 700;
    color: white;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-start-grading:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(59, 130, 246, 0.3);
}

/* Empty State */
.empty-submissions {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 20px;
    font-weight: 700;
    color: #475569;
    margin: 0 0 0.5rem 0;
}

.empty-description {
    font-size: 16px;
    color: #94a3b8;
}

/* Loading State */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 16px;
    color: #64748b;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tcf-grading-dashboard {
        padding: 1rem;
    }

    .dashboard-title {
        font-size: 24px;
    }

    .nclc-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }

    .submission-card {
        padding: 1.5rem;
    }

    .score-input-container {
        flex-direction: column;
        align-items: stretch;
    }

    .grading-actions {
        flex-direction: column;
    }

    .essay-content {
        font-size: 14px;
        padding: 1rem;
    }
}
