.btn-primary {
  background-color: #00549A !important;
  border-color: #00549A !important;
}

.text-primary {
    color: #00549A !important;
}

.btn-outline-primary {
    --bs-btn-color: #00549A;
    --bs-btn-border-color: #00549A;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #00549A;
    --bs-btn-hover-border-color: #00549A;
    --bs-btn-focus-shadow-rgb: 13, 110, 253;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #00549A;
    --bs-btn-active-border-color: #00549A;
    --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
    --bs-btn-disabled-color: #00549A;
    --bs-btn-disabled-bg: 00549A;
    --bs-btn-disabled-border-color: #00549A;
    --bs-gradient: none;
}

#vip-portal-app .form-check-input:checked {
  background-color: #00549A; /* Replace with your color */
  border-color: #00549A;     /* Match the background color */
}

#vip-portal-app .form-switch .form-check-input {
    flex-shrink: 0;
    min-width: 2.0em; /* Ensures the switch maintains its horizontal track width */
    height: 1.0em;
    margin-top: 0.3em;
}

/* FIX text-muted constract issue */
/* Overrides Bootstrap's #6c757d with a WCAG AA-compliant shade */
.text-muted {
    color: #50555a !important;
}

/* Lightest compliant gray for disabled labels on white backgrounds */
.form-check-input:disabled ~ .form-check-label,
.form-check-input:disabled ~ .form-check-label.text-dark {
    opacity: 1 !important;
    color: #767676 !important; /* 4.54:1 contrast ratio against #FFFFFF */
    cursor: not-allowed;
}


/* Custom accessible green for outline success buttons (~6.3:1 contrast ratio) */
.btn-outline-success {
    color: #146c43 !important;
    border-color: #146c43 !important;
}

.btn-outline-success:hover,
.btn-outline-success:focus,
.btn-outline-success:active {
    background-color: #146c43 !important;
    border-color: #146c43 !important;
    color: #ffffff !important;
}

/* Custom accessible red for outline danger buttons (~5.6:1 contrast ratio) */
.btn-outline-danger {
    color: #b02a37 !important;
    border-color: #b02a37 !important;
}

.btn-outline-danger:hover,
.btn-outline-danger:focus,
.btn-outline-danger:active {
    background-color: #b02a37 !important;
    border-color: #b02a37 !important;
    color: #ffffff !important;
}

/* Custom accessible gray for outline secondary buttons (~8.6:1 contrast ratio) */
.btn-outline-secondary {
    color: #495057 !important;
    border-color: #495057 !important;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus,
.btn-outline-secondary:active {
    background-color: #495057 !important;
    border-color: #495057 !important;
    color: #ffffff !important;
}

/* Makes the card lift slightly and adds a shadow when hovered */
.team-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.team-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important;
}

/* Scoped App Styles */
#vip-portal-app {
    /* Using SBU's official red for our accents */
    --vip-red: #990000; 
}

/* Make the sidebar links look native */
#vip-portal-app .list-group-item {
    font-weight: 600;
    border: none;
    border-bottom: 1px solid #eaeaea;
    transition: color 0.2s;
}

#vip-portal-app .list-group-item:hover {
    color: var(--vip-red);
    background-color: #f8f9fa;
}

#vip-portal-app .list-group-item.active {
    background-color: transparent !important;
    color: var(--vip-red) !important;
    border-color: #eaeaea !important;
    border-left: 4px solid var(--vip-red) !important;
}

/* Template animations */
#vip-portal-app .app-template {
    display: none;
}

#vip-portal-app .app-template.active {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

#vip-portal-app .flare {
    color: var(--vip-red) !important;
}

.flare {
    color: #990000 !important;
}

#vip-portal-app form legend {
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
}

.vip-table {
    --bs-table-hover-bg: #DCEEF2; 

}

.vip-table-header {
    background-color: #14819A !important; 
    color: #ffffff !important;
    font-weight: 600;
}

.bg-brand-navy {
    background-color: #002244 !important; 
}

.bg-brand-royal-blue {
    background-color: #00549A !important; 
}

.bg-brand-turquoise {
    background-color: #1791AD !important; 
}

.bg-brand-turquoise-4p5 {
    background-color: #127B93 !important; 
}

.bg-brand-pear {
    background-color: #F1EA86 !important; 
}

.bg-brand-medium-grey {
    background-color: #767676 !important; 
}

/* --- Session Protection Blur --- */
body.session-lost .protected-content {
    filter: blur(5px);
    pointer-events: none;
    user-select: none;
    opacity: 0.6;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

/* Ensure the warning bar stays above the blur */
#session-warning-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
}

/* Custom VIP Table Styles */
.table-vip {
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-bottom: 0;
    vertical-align: top;
}

/* Header background and text styling */
.table-vip thead th,
.table-vip thead th * {
    background-color: var(--brand-turquoise, #127B93);
    color: #ffffff !important;
    vertical-align: top;
    border-bottom: none;
}

/* Rounded corner support across all browsers */
.table-vip thead tr:first-child th:first-child {
    border-top-left-radius: 0.5rem;
}
.table-vip thead tr:first-child th:last-child {
    border-top-right-radius: 0.5rem;
}
.table-vip tbody tr:last-child td:first-child {
    border-bottom-left-radius: 0.5rem;
}
.table-vip tbody tr:last-child td:last-child {
    border-bottom-right-radius: 0.5rem;
}

/* Optional: Keep inactive sort arrows clear while highlighting active sorted column */
.table-vip thead th.dt-sort-header:not(.active) i {
    opacity: 0.8 !important; /* Slightly distinct for unsorted columns if desired */
}
.table-vip thead th.dt-sort-header.active i {
    opacity: 1 !important;
}

#view-container:focus {
    outline: none;
}

/* 1. Remove the square bullets and list padding */
#vip-portal-app .dropdown-menu {
    list-style: none !important;
    padding: 0.5rem 0 !important; /* Standard Bootstrap spacing */
    margin: 0 !important;
}

#vip-portal-app .dropdown-menu li {
    list-style-type: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 2. Remove the "before" pseudo-element if SBU uses it for bullets */
#vip-portal-app .dropdown-menu li::before {
    content: none !important;
    display: none !important;
}

/* 3. Ensure the links fill the width and have clean hover states */
#vip-portal-app .dropdown-item {
    display: flex !important;
    align-items: center;
    width: 100%;
    padding: 0.5rem 1rem !important;
    clear: both;
    text-align: inherit;
    text-decoration: none;
    white-space: nowrap;
    background-color: transparent;
    border: 0;
}

#vip-portal-app .dropdown-item:hover {
    background-color: #f8f9fa !important;
    color: #990000 !important; /* Stony Brook Red */
}

.editor-input-container {
    display: flex;
    flex-direction: column;
    /* Now the parent's height (e.g., style="height: 500px") will rule everything */
}

/* 1. Define baseline height assumptions using safe global fallback variables */
:root {
    --app-header-height: 56px; /* Default height matching mobile view */
}

/* 2. Update the tracking height variable when shifting to desktop views */
@media (min-width: 996px) { 
    :root {
        /* Replace 70px with the exact measured height of your desktop .main-nav layout */
        --app-header-height: 90px; 
    }
}

/* 3. Wire the Quill sticky position directly to the responsive layout height variable */
.ql-toolbar.ql-snow {
    position: -webkit-sticky !important;
    position: sticky !important;
    
    /* Pulls down dynamically based on the active viewport configuration above */
    top: var(--app-header-height) !important; 
    
    /* Layer comfortably beneath both navigation structures, but above document elements */
    z-index: 900 !important; 
    
    background: #ffffff !important;
    border-bottom: 2px solid #990000 !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

/* .ql-toolbar.ql-snow {
    flex-shrink: 0; 
} */
.ql-container.ql-snow {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: auto !important; /* Overrides Quill's internal pixel heights */
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
}
.ql-editor {
    flex-grow: 1;
    overflow-y: auto; /* Internal scrollbar appears if text exceeds parent height */
}

.ql-editor p, 
.ql-editor li {
    font-family: inherit;
    font-size: inherit;
}

/* 3. Optional: Make the toolbar look consistent too */
.ql-toolbar.ql-snow {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    background: #f8f9fa; /* Light VIP grey */
}





/* 1. Structural Container */
.ql-editor pre[data-language],
.ql-editor .ql-code-block-container {
    background-color: #f8f9fa !important; 
    color: #3c4043 !important;           
    padding: 24px !important;
    border-radius: 8px !important;
    border: 1px solid #dadce0;
    
    /* LIGHTEN WEIGHT HERE */
    font-family: "Sans Code", "Cascadia Code", monospace !important;
    font-weight: 400 !important; /* Standard weight */
    font-size: 0.92em !important;
    line-height: 1.6 !important;
    
    /* This helps fonts look thinner/crisper on light backgrounds */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. True Gemini Color Mapping */

/* PROPERTIES & ATTRIBUTES (The "Cyan" Fix) */
/* This makes 'color', 'padding', etc. Dark Grey like this UI */
pre[data-language] .hljs-attribute,
pre[data-language] .hljs-attr,
pre[data-language] .hljs-property,
.ql-code-block .hljs-attribute, 
.ql-code-block .hljs-attr, 
.ql-code-block .hljs-property { 
    color: #3c4043 !important; 
    font-weight: 500 !important; /* Slightly bolder, but no color */
}

/* KEYWORDS (Electric Blue) - const, export, return */
pre[data-language] .hljs-keyword,
.ql-code-block .hljs-keyword { 
    color: #1a73e8 !important; 
    font-weight: 500 !important; 
}

/* STRINGS (Coral) - 'snow', "Sans Code" */
pre[data-language] .hljs-string,
.ql-code-block .hljs-string { 
    color: #d93025 !important; 
}

/* FUNCTIONS (Purple) - getSelection, stringify */
pre[data-language] .hljs-title.function_,
pre[data-language] .hljs-title,
.ql-code-block .hljs-title.function_, 
.ql-code-block .hljs-title { 
    color: #9334e6 !important; 
}

/* NUMBERS & LITERALS (Coral/Orange) - 1.6, 8px, true */
pre[data-language] .hljs-number,
pre[data-language] .hljs-literal,
.ql-code-block .hljs-number, 
.ql-code-block .hljs-literal { 
    color: #d93025 !important; 
}

/* COMMENTS (Grey) */
pre[data-language] .hljs-comment,
.ql-code-block .hljs-comment { 
    color: #6e7378  !important; 
    font-style: italic !important; 
}


/* Hide the language selector dropdown in Quill 2.0 */
pre[data-language] .ql-ui,
.ql-code-block-container .ql-ui {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Optional: Adjust padding now that the top-right corner is empty */
.ql-editor pre[data-language],
.ql-editor .ql-code-block-container {
    padding-top: 1.5rem !important; 
}
/* Adds space between the top of the content box and the first line of text */
.ql-container .ql-editor {
    padding-top: 16px !important;
}

.published .ql-editor .ql-formula:hover {  background: transparent !important;  border-color: transparent !important; }
.published .ql-editor .ql-formula {  cursor: default; }
.published .ql-editor {  white-space: normal !important; }
.published.ql-container {  min-height: 0px !important; }

.ql-toolbar.ql-snow { background: #f8f9fa; border-bottom: 2px solid #990000 !important; border-radius: 8px 8px 0 0; }
.ql-container { min-height: 200px; font-family: inherit; font-size: inherit;}

.ql-editor img { max-width: 100%; height: auto; cursor: pointer; }
.ql-image-resizer-module { border: 1px dashed #990000 !important; }

/* FORMULA STYLING */
.ql-editor[contenteditable="true"] .ql-formula { cursor: pointer; display: inline-block; border: 1px solid transparent; transition: all 0.2s; padding: 0 2px; }
.ql-editor[contenteditable="true"] .ql-formula:hover { background: #fff5f5; border-color: #990000; border-radius: 3px; }

/* TOOLTIP REFINEMENT */
.ql-snow .ql-tooltip { 
    z-index: 10001; 
    background-color: #fff; 
    border: 1px solid #ccc; 
    box-shadow: 0px 4px 12px rgba(0,0,0,0.15); 
    border-radius: 4px; 
    padding: 8px 12px;
}
.ql-snow .ql-tooltip[data-mode="formula"]::before { content: "Enter LaTeX Formula:"; font-weight: bold; display: block; margin-bottom: 5px; color: #990000; }
.ql-snow .ql-tooltip input { width: 300px !important; border: 1px solid #ccc; padding: 5px; border-radius: 3px; }

/* The container for a block-level formula */
.ql-formula.ql-formula-block {
    display: flex !important;
    align-items: center;
    justify-content: center; /* Centers the math */
    width: 100%;
    margin: 1em 0;
    position: relative;
}

/* The auto-incrementing equation counter */
.ql-editor { counter-reset: equation-count; font-family: inherit; font-size: inherit;}

.ql-formula.ql-formula-block::after {
    counter-increment: equation-count;
    content: "(" counter(equation-count) ")";
    position: absolute;
    right: 0; /* Flushes the number to the right */
    font-weight: normal;
    color: #666;
}

/* Force KaTeX to respect the parent line-height and scale slightly down */
.ql-editor .katex {
    font-size: 1.1em; /* Adjust this (0.9em to 1.1em) to match your specific font */
    line-height: 1.2;
    text-rendering: auto;
}

/* Ensure the formula display block doesn't add massive vertical gaps */
.ql-formula.ql-formula-block .katex-display {
    margin: 0.5em 0;
    padding: 0;
}

/* 1. The actual text in the editor */
.ql-font-roman { font-family: "Times New Roman", Times, serif; }
.ql-font-arial { font-family: Arial, Helvetica, sans-serif; }

/* 2. The labels inside the toolbar dropdown */
.ql-snow .ql-picker.ql-font .ql-picker-label::before,
.ql-snow .ql-picker.ql-font .ql-picker-item::before {
    content: 'Default';
    font-family: Arial, Helvetica, sans-serif; 
}

.ql-snow .ql-picker.ql-font .ql-picker-label[data-value="roman"]::before,
.ql-snow .ql-picker.ql-font .ql-picker-item[data-value="roman"]::before {
    content: 'Roman';
    font-family: "Times New Roman", Times, serif;
}

.ql-snow .ql-tooltip[data-mode="link"]::before {
content: "Enter URL:"; display: block; margin-bottom: 4px;
font-weight: bold; color: #990000;
}   

.editor-input-container {
border: 1px solid #dee2e6; /* Standard Bootstrap border color */
border-radius: 0.375rem;    /* Standard Bootstrap border radius */
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.editor-input-container:focus-within {
color: #212529;
background-color: #fff;
border-color: #86b7fe;      /* Bootstrap primary blue border */
outline: 0;
/* Bootstrap's signature blue glow */
box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25); 
}


.form-control, .form-select, .form-check {
    scroll-margin-top: 105px; /* Adjust this value to match your header's height */
}
















/* 1. The Action Button Group (Trash + Promote) */
.btn-hover-show {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10; /* Ensure it sits above the input fields */
}

/* Show buttons when the specific widget row is hovered */
.user-search-widget-row:hover .btn-hover-show {
    opacity: 1;
}

/* 2. Visual indicator for the TOP mentor (Primary) */
#team-mentors-container > div:first-child .user-search-widget-row {
    border-left: 4px solid #cc0000 !important; /* Stony Brook Red for Primary */
    background-color: #fff8f8; /* Very subtle tint to highlight the leader */
}

/* 3. General Row Styling */
.user-search-widget-row {
    transition: all 0.2s ease;
    position: relative;
}

/* 4. Label Header Styling (Added via JS) */
.mentor-label-header {
    display: block;
    width: 100%;
    letter-spacing: 0.05rem;
    margin-top: 1rem;
}

/* Ensure the Primary badge stays put */
.primary-badge {
    z-index: 5;
    pointer-events: none; /* So it doesn't block clicks if anything is behind it */
}

.auto-expand {
    
    resize: none;         /* Removes the manual resize handle */
    width: 100%;          /* Controls the horizontal layout */
    min-height: 200px !important;      /* Sets a starting height */
}

.vip-tooltip {
  --bs-tooltip-bg: var(--bs-gray-dark);
  --bs-tooltip-color: var(--bs-white);
}

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

@keyframes spin { 100% { transform: rotate(360deg); } }
#vip-portal-app .spin-animation { animation: spin 1s linear infinite; display: inline-block; }

/* Peer Evaluation Heatmap - WCAG 2.1 AA Compliant Palette */
.pe-eval-table .pe-dark-green {
    background-color: #00e65c !important; /* Vibrant Dark Green (> +1.0 SD) - Contrast Ratio 12.9:1 */
    color: #000000 !important;
}

.pe-eval-table .pe-light-green {
    background-color: #a8f0c2 !important; /* Distinct Soft Pastel Green (+0.5 to +1.0 SD) - Contrast Ratio 15.6:1 */
    color: #000000 !important;
}

.pe-eval-table .pe-yellow {
    background-color: #fff066 !important; /* High-Contrast Soft Yellow (-1.0 to -0.5 SD) - Contrast Ratio 18.2:1 */
    color: #000000 !important;
}

.pe-eval-table .pe-red {
    background-color: #ff9999 !important; /* High-Contrast Soft Red (< -1.0 SD) - Contrast Ratio 10.4:1 */
    color: #000000 !important;
}

/* Accessible Table Cell Focus Outline for Keyboard Users */
.pe-eval-table td:focus,
.pe-eval-table th:focus,
.pe-eval-table .js-rubric-toggle-btn:focus-visible {
    outline: 2px solid #0056b3 !important;
    outline-offset: -2px;
}

/* Peer Evaluation Heatmap & Matrix Layout */
.pe-eval-table {
    table-layout: fixed;
    width: 100%;
}

/* Allocate 40% width to Question column on Desktop */
.pe-eval-table th:first-child {
    width: 40%;
}

/* Force multi-line text comments to break and wrap cleanly */
.pe-eval-table td, 
.pe-eval-table th {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

/* Mobile & Tablet optimizations */
@media (max-width: 768px) {
    .pe-eval-table {
        min-width: 520px;
    }
    
    /* Slightly wider Question column on mobile for readability */
    .pe-eval-table th:first-child {
        width: 45%;
    }

    /* Compact padding for rating cells on smaller viewports */
    .pe-eval-table td {
        padding: 0.35rem 0.25rem !important;
        font-size: 0.8rem;
    }

    /* Force mobile browsers to immediately handle horizontal touch scrolling */
    .pe-matrix-wrapper .table-responsive {
        touch-action: pan-x !important;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: auto !important;
    }
}
