/* ============================================================
   Course Management Modal Styles
   Extracted from style.css without selector renames.
   ============================================================ */

/* --- Course Code Pill Input --- */
.course-code-input-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.course-code-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.course-code-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    padding: 0.2rem 0.5rem 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.2);
    transition: all 0.2s ease;
}

.remove-pill-btn {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: none;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 11px;
    font-weight: bold;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.remove-pill-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.course-code-add-new {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* The border was removed to simplify the input appearance. */
    /* The input field itself will now have the border. */
}


div.course-code-add-new input.new-course-code-input {
    flex-grow: 1;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    padding: 0.25rem 0.5rem; /* Reduced padding to make it shorter */
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.course-code-add-new input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.2);
}

.add-course-code-btn {
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px; /* Made button smaller */
    height: 24px; /* Made button smaller */
    font-size: 1.2rem; /* Adjusted font size for smaller button */
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 2px; /* Optical alignment for '+' */
    transition: background-color 0.2s ease;
}

.add-course-code-btn:hover {
    background-color: #218838;
}

/* --- Course Code Dropdown --- */
.course-code-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    padding: 0.75rem;
}

.course-code-dropdown-header {
    font-size: 0.875rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

.course-code-dropdown-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.course-code-selectable-pill {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    color: #495057;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid #ced4da;
}

.course-code-selectable-pill:hover {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    border-color: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.course-code-dropdown-empty {
    text-align: center;
    color: #6c757d;
    font-size: 0.875rem;
    padding: 1rem;
}

.course-code-suggestion-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #343a40;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.15s ease, color 0.15s ease;
}

.course-code-suggestion-item:hover,
.course-code-suggestion-item.highlighted {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
}

/* Make course-code-add-new container position relative for dropdown positioning */
.course-code-add-new {
    position: relative;
}

/* Styles for Course Management Content */

.cm-enrollment-view-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
    font-size: 1.2rem;
    text-align: center;
}

#cm-enrollment-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    grid-template-areas:
        "title actions"
        "details actions";
    align-items: center;
    padding: 1.5rem;
    flex-shrink: 0;
    border-bottom: none; /* Removed - tabs now have the border */
    gap: 0.25rem 1.5rem; /* row-gap column-gap */
}

.cm-enrollment-header-title {
    grid-area: title;
    min-width: 0;
}

.cm-header-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cm-header-course-code {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #333;
    line-height: 1.2;
}

.cm-enrollment-header-details {
    grid-area: details;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.cm-detail-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cm-detail-label {
    font-size: 0.9rem;
    color: #6c757d;
    font-weight: 500;
}

.cm-detail-value {
    background-color: #e9ecef;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: 'SF Mono', 'Consolas', 'Menlo', monospace;
    color: #333;
    font-weight: 600;
    word-break: break-all; /* Prevent long codes from breaking layout */
    font-size: 0.9rem;
}

.cm-enrollment-header-actions {
    grid-area: actions;
    display: flex;
    flex-direction: row; /* Stack buttons horizontally */
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end; /* Align to the right */
    flex-shrink: 0;
}

.new-course-instruction {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #e7f3ff; /* Light info blue */
    border: 1px solid #b3d7ff;
    border-left-width: 4px;
    border-left-color: var(--primary-color);
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin: 1rem 0 0 0;
}
.new-course-instruction svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: var(--primary-color);
}
.new-course-instruction span {
    font-size: 0.9rem;
    color: #004085; /* Dark blue text for contrast */
    line-height: 1.5;
}
#cm-enrollment-view {
    flex-grow: 1;
    overflow-y: auto;
    /* Custom scrollbar styling for the enrollment view */
    scrollbar-width: thin;
    scrollbar-color: #a8a8a8 #f1f1f1;
}

/* WebKit scrollbar styling for enrollment view */
#cm-enrollment-view::-webkit-scrollbar {
    width: 8px;
}

#cm-enrollment-view::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

#cm-enrollment-view::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 6px;
    border: 1px solid #f1f1f1;
}

#cm-enrollment-view::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

#cm-enrollment-view:not(.cm-enrollment-view-placeholder) {
    padding-top: 0;
}
.enrollment-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    padding: 2rem;
    flex-grow: 1;
    overflow: hidden;
}

.enrollment-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    /* Ensure section has a maximum height to trigger scrolling */
    max-height: 60vh;
    min-height: 300px;
}

.enrollment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.enrollment-header h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 700;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.enrollment-section .user-search-container {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #eee;
}

.enrollment-user-list {
    overflow-y: auto;
    flex-grow: 1;
    /* Custom scrollbar styling for better visibility */
    scrollbar-width: thin;
    scrollbar-color: #a8a8a8 #f1f1f1;
}

/* WebKit scrollbar styling for enrollment lists */
.enrollment-user-list::-webkit-scrollbar {
    width: 8px;
}

.enrollment-user-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 6px;
}

.enrollment-user-list::-webkit-scrollbar-thumb {
    background-color: #c1c1c1;
    border-radius: 6px;
    border: 1px solid #f1f1f1;
}

.enrollment-user-list::-webkit-scrollbar-thumb:hover {
    background-color: #a8a8a8;
}

.enrollment-user-list table {
    width: 100%;
    border-collapse: collapse;
}

.enrollment-user-list th,
.enrollment-user-list td {
    padding: 0.6rem 0.8rem;
    text-align: left;
}

.enrollment-user-list th {
    background-color: #fafbfc;
    position: sticky;
    top: 0;
    font-weight: 600;
    color: #495057;
    font-size: 0.85rem;
    z-index: 1;
}

.enrollment-user-list .checkbox-column {
    width: 40px;
    text-align: center;
}

/* Statistics Table Tooltips - Fast Display */
.statistics-table th [title] {
    position: relative;
}

.statistics-table th [title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #1a1a1a;
    color: white;
    font-size: 0.75rem;
    font-weight: 400;
    white-space: normal;
    width: max-content;
    max-width: 250px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    pointer-events: none;
    text-transform: none;
    letter-spacing: normal;
    line-height: 1.4;
}

.statistics-table th [title]:hover::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.25rem;
    border: 6px solid transparent;
    border-top-color: #1a1a1a;
    pointer-events: none;
}

/* Course Management Content Tabs */
.cm-statistics-placeholder,
.cm-cases-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
}

/* Pagination styles for course management enrollment tables */
.enrollment-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid #eee;
    background-color: #fafbfc;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.cm-page-btn {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    min-width: 2.5rem;
    text-align: center;
    line-height: 1;
}

.cm-page-btn:hover:not(:disabled) {
    background-color: #f8f9fa;
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.cm-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

.pagination-info {
    color: #6c757d;
    font-weight: 500;
    margin: 0 0.5rem 1.5rem 0.5rem;
}
