/**
 * Bootstrap 3 Compatibility CSS for Bootstrap 5
 * Provides styling for legacy Bootstrap 3 class names
 * Date: 2025-10-21
 */

/* Load Glyphicons Halflings font for Bootstrap 3 icons */
@font-face {
  font-family: 'Glyphicons Halflings';
  src: url('../fonts/glyphicons-halflings-regular.eot');
  src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), 
       url('../fonts/glyphicons-halflings-regular.woff2') format('woff2'),
       url('../fonts/glyphicons-halflings-regular.woff') format('woff'), 
       url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), 
       url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}

/* Base Glyphicon styles */
.glyphicon {
  position: relative;
  top: 1px;
  display: inline-block;
  font-family: 'Glyphicons Halflings';
  font-style: normal;
  font-weight: normal;
  line-height: 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Panel (Bootstrap 3) → Card (Bootstrap 5) compatibility */
.panel {
    margin-bottom: 20px;
    background-color: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,.05);
    overflow: hidden;
}

.panel-heading {
    padding: 10px 15px;
    border-bottom: 1px solid transparent;
    border-top-left-radius: 3px;
    border-top-right-radius: 3px;
    background-color: #f5f5f5;
}

.panel-title {
    margin-top: 0;
    margin-bottom: 0;
    font-size: 16px;
    color: inherit;
    font-weight: 500;
}

.panel-body {
    padding: 15px;
    background-color: #fff;
}

.panel-footer {
    padding: 10px 15px;
    background-color: #f5f5f5;
    border-top: 1px solid #ddd;
    border-bottom-right-radius: 3px;
    border-bottom-left-radius: 3px;
}

/* Panel variants */
.panel-default {
    border-color: #ddd;
}

.panel-default > .panel-heading {
    color: #333;
    background-color: #f5f5f5;
    border-color: #ddd;
}

.panel-primary {
    border-color: #428bca;
}

.panel-primary > .panel-heading {
    color: #fff;
    background-color: #428bca;
    border-color: #428bca;
}

.panel-success {
    border-color: #d6e9c6;
}

.panel-success > .panel-heading {
    color: #3c763d;
    background-color: #dff0d8;
    border-color: #d6e9c6;
}

.panel-info {
    border-color: #bce8f1;
    background-color: #ffffff;  /* White body */
}

.panel-info > .panel-heading {
    color: #31708f;
    background-color: #d9edf7;
    border-color: #bce8f1;
}

/* Bootstrap 5 Accordion - Class Items Styling */
.ms-class-item.accordion-item {
    border: 1px solid #bce8f1;
    border-radius: 4px;
    margin-bottom: 15px;
    background-color: #fff;
}

/* Override socrates.css - Use light blue for class headers, not yellow */
.ms-class-item .accordion-header {
    color: #31708f !important;
    background-color: #d9edf7 !important;
    padding: 0 !important;
    min-height: 60px;
    display: flex;
    align-items: stretch;
    position: relative;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
}

.ms-class-item .accordion-button {
    color: #31708f !important;
    background-color: #d9edf7 !important;
    border: none !important;
    box-shadow: none !important;
    font-size: 18px;
    font-weight: 500;
    padding: 15px 20px;
    flex: 1;
    cursor: pointer;
    line-height: 1.4;
    min-height: 60px;
    display: flex;
    align-items: center;
}

.ms-class-item .accordion-button:not(.collapsed) {
    color: #31708f !important;
    background-color: #d9edf7 !important;
    box-shadow: none !important;
}

.ms-class-item .accordion-button:focus {
    box-shadow: none !important;
    border-color: transparent !important;
}

.ms-class-item .accordion-button::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2331708f'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

/* Action buttons container */
.ms-class-item .accordion-button .action-buttons-container {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    z-index: 10;
}

/* Buttons should be on top and clickable */
.ms-class-item .accordion-button .controls,
.ms-class-item .accordion-button .delete-control {
    position: relative;
    z-index: 10;
    display: flex;
    align-items: center;
}

/* Style the buttons themselves for better appearance */
.ms-class-item .accordion-button .controls button,
.ms-class-item .accordion-button .delete-control button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 3px;
    white-space: nowrap;
    min-width: auto;
}

/* Legacy support for old panel structure (if still used elsewhere) */
.ms-class-item .panel-heading {
    color: #31708f !important;
    background-color: #d9edf7 !important;
    padding: 0 !important;
    min-height: 60px;
    display: flex;
    align-items: stretch;
    position: relative;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
}

.ms-class-item .panel-heading .panel-title {
    flex: 1;
    margin: 0;
    display: flex;
    align-items: center;
}

.ms-class-item .panel-heading .panel-title a {
    color: #31708f;
    text-decoration: none !important;
    display: block;
    font-size: 18px;
    font-weight: 500;
    padding: 15px 20px;
    flex: 1;
    cursor: pointer;
    line-height: 1.4;
}

.ms-class-item .panel-heading .panel-title a:hover {
    text-decoration: none !important;
    color: #31708f;
}

.ms-class-item .panel-heading .controls,
.ms-class-item .panel-heading .delete-control {
    position: relative;
    z-index: 10;
    margin: 12px 4px;
    display: flex;
    align-items: center;
}

.ms-class-item .panel-heading .controls + .controls,
.ms-class-item .panel-heading .controls + .delete-control,
.ms-class-item .panel-heading .delete-control + .controls,
.ms-class-item .panel-heading .delete-control + .delete-control {
    margin-left: 2px;
}

.ms-class-item .panel-heading .controls button,
.ms-class-item .panel-heading .delete-control button {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 3px;
    white-space: nowrap;
    min-width: auto;
}

.ms-class-item .panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ms-class-item .panel-heading .controls,
.ms-class-item .panel-heading .delete-control {
    display: inline-flex;
    align-items: center;
}

.ms-class-item .panel-heading .panel-title {
    flex: 1;
}

/* Simple Organization Edit Page */
.organization-edit-page .card {
    border: 1px solid #dee2e6;
}

.organization-edit-page .card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.organization-edit-page .form-control {
    border: 1px solid #ced4da;
}

.organization-edit-page .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Add User to Organization Modal Improvements */
#add-org-user-modal .modal-dialog {
    margin: 1.75rem auto;
    max-width: 500px;
}

#add-org-user-modal .modal-content {
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 0.3rem;
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,.5);
}

#add-org-user-modal .modal-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 0.3rem 0.3rem 0 0;
}

#add-org-user-modal .modal-title {
    font-weight: 600;
    color: #495057;
    margin: 0;
    flex: 1;
}

#add-org-user-modal .close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: auto;
    height: auto;
}

#add-org-user-modal .close:hover {
    opacity: 0.75;
}

#add-org-user-modal .btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: auto;
    height: auto;
}

#add-org-user-modal .btn-close:hover {
    opacity: 0.75;
}

#add-org-user-modal .modal-body {
    padding: 1.5rem;
}

#add-org-user-modal .form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

#add-org-user-modal .form-control {
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
    min-height: 38px;
    font-size: 1rem;
    line-height: 1.5;
}

#add-org-user-modal .form-control:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

#add-org-user-modal select.form-control {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.25rem;
    appearance: none;
}

#add-org-user-modal .modal-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    border-radius: 0 0 0.3rem 0.3rem;
}

#add-org-user-modal .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
}

#add-org-user-modal .btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

#add-org-user-modal .btn-primary:hover {
    color: #fff;
    background-color: #0056b3;
    border-color: #004085;
}

#add-org-user-modal .btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

#add-org-user-modal .btn-secondary:hover {
    color: #fff;
    background-color: #545b62;
    border-color: #4e555b;
}

#add-org-user-modal .help-block.usererror {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Bootstrap Icons Support */
#add-org-user-modal .bi {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    fill: currentColor;
}

#add-org-user-modal .bi::before {
    display: inline-block;
    font-style: normal;
    font-variant: normal;
    text-rendering: auto;
    line-height: 1;
}

/* Glyphicon Support for backward compatibility */
#add-org-user-modal .glyphicon {
    position: relative;
    top: 1px;
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#add-org-user-modal .glyphicon-edit:before {
    content: "\270f";
}

#add-org-user-modal .glyphicon-trash:before {
    content: "\e020";
}

#add-org-user-modal .glyphicon-plus:before {
    content: "\002b";
}

#add-org-user-modal .glyphicon-remove:before {
    content: "\e014";
}

/* Eye Icon Fixes */
.glyphicon-eye-open:before {
    content: "\e105";
}

.glyphicon-eye-open {
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure eye icons are visible in buttons */
.btn .glyphicon-eye-open {
    margin-right: 0.25rem;
    font-size: 1rem;
    vertical-align: middle;
}

/* Preview button specific styling */
.btn[title="Preview"] .glyphicon-eye-open {
    color: #007bff;
}

.btn[title="Preview"]:hover .glyphicon-eye-open {
    color: #0056b3;
}

/* Glyphicon Edit Icon */
.glyphicon-edit:before {
    content: "\e065";
}

.glyphicon-edit {
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Glyphicon Trash Icon */
.glyphicon-trash:before {
    content: "\e020";
}

.glyphicon-trash {
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Glyphicon Sort By Attributes Icon (for Segments) */
.glyphicon-sort-by-attributes:before {
    content: "\e155";
}

.glyphicon-sort-by-attributes {
    display: inline-block;
    font-family: 'Glyphicons Halflings';
    font-style: normal;
    font-weight: normal;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Ensure all scaffold action icons are visible in buttons */
.btn .glyphicon-edit,
.btn .glyphicon-trash,
.btn .glyphicon-sort-by-attributes {
    margin-right: 0.25rem;
    font-size: 1rem;
    vertical-align: middle;
    position: relative;
    top: 1px;
}

/* Scaffold action buttons styling */
.btn[title="Edit"] .glyphicon-edit,
.btn[title="Delete Scaffold"] .glyphicon-trash,
.btn[title="Segments"] .glyphicon-sort-by-attributes {
    color: #495057;
}

.btn[title="Edit"]:hover .glyphicon-edit,
.btn[title="Delete Scaffold"]:hover .glyphicon-trash,
.btn[title="Segments"]:hover .glyphicon-sort-by-attributes {
    color: #212529;
}

/* Preview Modal Fixes */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #dee2e6;
    background-color: #f8f9fa;
}

.modal-title {
    margin: 0;
    flex: 1;
    font-weight: 600;
    color: #495057;
}

.modal-header .close,
.modal-header .btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    color: #000;
    opacity: 0.5;
    padding: 0;
    margin: 0;
    cursor: pointer;
    width: auto;
    height: auto;
    order: 2;
}

.modal-header .close:hover,
.modal-header .btn-close:hover {
    opacity: 0.75;
}

/* Ensure close buttons work with Bootstrap 5 */
.modal-header .close[data-bs-dismiss="modal"] {
    cursor: pointer;
    z-index: 1050;
}

.modal-header .close[data-bs-dismiss="modal"]:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Fix for Bootstrap 5 modal close functionality */
.modal .close {
    position: relative;
    z-index: 1;
}

/* Bootstrap 5 Modal close button fixes */
.modal .btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1050;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal .btn-close:hover,
.modal .btn-close:focus {
    color: #000;
    text-decoration: none;
    opacity: 0.75;
}

.modal .btn-close::before {
    content: "×";
    display: block;
    font-size: 24px;
    line-height: 1;
}

/* Bootstrap 5 specific fixes for profile and password modals */
#profileModal .btn-close,
#changePasswordModal .btn-close,
.modal[aria-labelledby*="profile"] .btn-close,
.modal[aria-labelledby*="password"] .btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1050;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#profileModal .btn-close::before,
#changePasswordModal .btn-close::before,
.modal[aria-labelledby*="profile"] .btn-close::before,
.modal[aria-labelledby*="password"] .btn-close::before {
    content: "×";
    display: block;
    font-size: 24px;
    line-height: 1;
}

/* Bootstrap 5 Modal header close button fixes */
.modal-header .btn-close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1050;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header .btn-close:hover,
.modal-header .btn-close:focus {
    color: #000;
    text-decoration: none;
    opacity: 0.75;
}

/* Bootstrap 5 close button content - only add × if button is empty */
.modal-header .btn-close:empty::before {
    content: "×";
    display: block;
    font-size: 24px;
    line-height: 1;
}

/* Bootstrap 3 compatibility - keep old .close class working */
.modal-header .close {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1050;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.5;
    cursor: pointer;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header .close:hover,
.modal-header .close:focus {
    color: #000;
    text-decoration: none;
    opacity: 0.75;
}

.modal-header .close:empty::before {
    content: "×";
    display: block;
    font-size: 24px;
    line-height: 1;
}

/* Lesson Plan Layout Fixes */
#lessonplantable {
    width: 100%;
    table-layout: fixed;
}

#lessonplantable > thead > tr > th {
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem;
    background-color: #f8f9fa;
    font-weight: 600;
}

#lessonplantable > tbody > tr > td {
    padding: 0.75rem;
    vertical-align: top;
    border-bottom: 1px solid #dee2e6;
}

.lessontopicscol {
    width: 500px;
    min-height: 50px;
    position: relative;
}

.token-input-list {
    overflow: hidden;
    height: auto !important;
    width: 100%;
    max-width: 500px;
    cursor: text;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 1px;
    z-index: 999;
    margin: 0;
    padding: 0;
    list-style-type: none;
    clear: left;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.token-input-list-item {
    overflow: hidden;
    height: auto !important;
    min-height: 24px;
    margin: 0;
    padding: 4px 8px;
    background-color: #e3f2fd;
    color: #1976d2;
    cursor: default;
    border: 1px solid #bbdefb;
    font-size: 11px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: 200px;
}

.token-input-list-item:hover {
    background-color: #bbdefb;
    border-color: #90caf9;
}

.search-box {
    width: 200px;
    padding: 4px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 12px;
    margin: 2px;
}

.search-box:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Fix for Bootstrap 5 table compatibility */
.table {
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.table-striped > tbody > tr:nth-of-type(odd) > td,
.table-striped > tbody > tr:nth-of-type(odd) > th {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Typeahead compatibility fixes */
.twitter-typeahead {
    width: 100%;
    position: relative;
}

.twitter-typeahead .tt-hint {
    display: none !important;
}

.twitter-typeahead .tt-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    display: none;
    float: left;
    min-width: 160px;
    padding: 5px 0;
    margin: 2px 0 0;
    list-style: none;
    font-size: 14px;
    background-color: #ffffff;
    border: 1px solid #ccc;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    background-clip: padding-box;
}

.twitter-typeahead .tt-suggestion {
    display: block;
    padding: 3px 20px;
    clear: both;
    font-weight: normal;
    line-height: 1.42857143;
    color: #333;
    white-space: nowrap;
    cursor: pointer;
}

.twitter-typeahead .tt-suggestion:hover,
.twitter-typeahead .tt-suggestion:focus {
    color: #262626;
    text-decoration: none;
    outline: 0;
    background-color: #f5f5f5;
}

.twitter-typeahead .tt-suggestion.tt-cursor {
    color: #262626;
    background-color: #f5f5f5;
}

/* Fix for lesson plan table layout issues */
#lessonplantable .lessontopicscol {
    position: relative;
    overflow: visible;
}

#lessonplantable .lessontopicscol .token-input-list {
    position: relative;
    z-index: 1;
}

#lessonplantable .lessontopicscol .search-box {
    position: relative;
    z-index: 2;
}

/* Responsive lesson plan table */
@media (max-width: 768px) {
    .lessontopicscol {
        width: 100%;
        max-width: none;
    }
    
    .token-input-list {
        width: 100%;
        max-width: none;
    }
    
    .token-input-list-item {
        max-width: 150px;
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .search-box {
        width: 100%;
        max-width: none;
    }
}

/* React Lesson Plan Layout Fixes */
#react-lessonplantable {
    width: 100%;
    table-layout: fixed;
    margin-bottom: 20px;
}

#react-lessonplantable > thead > tr > th {
    border-bottom: 1px solid #dee2e6;
    padding: 0.75rem;
    background-color: #f8f9fa;
    font-weight: 600;
    text-align: left;
}

#react-lessonplantable > tbody > tr > td {
    padding: 0.75rem;
    vertical-align: top;
    border-bottom: 1px solid #dee2e6;
}

.react-lessontopicscol {
    width: 500px;
    min-height: 50px;
    position: relative;
    cursor: pointer;
}

.react-token-input-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    width: 100%;
    max-width: 500px;
}

.react-token-input-list-item {
    overflow: hidden;
    height: auto !important;
    min-height: 24px;
    margin: 0;
    padding: 4px 8px;
    background-color: #e3f2fd;
    color: #1976d2;
    cursor: pointer;
    border: 1px solid #bbdefb;
    font-size: 11px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    max-width: 200px;
    transition: all 0.2s ease;
    position: relative;
}

.react-token-input-list-item:hover {
    background-color: #bbdefb;
    border-color: #90caf9;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.react-token-p {
    font-weight: normal;
    margin: 0;
    padding: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.react-token-delete {
    margin-left: 8px;
    color: #d9534f;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    line-height: 1;
    padding: 2px;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.react-token-delete:hover {
    background-color: #d9534f;
    color: white;
    transform: scale(1.1);
}

/* React lesson plan table responsive */
@media (max-width: 768px) {
    .react-lessontopicscol {
        width: 100%;
        max-width: none;
    }
    
    .react-token-input-list {
        width: 100%;
        max-width: none;
    }
    
    .react-token-input-list-item {
        max-width: 150px;
        font-size: 10px;
        padding: 2px 6px;
    }
}

/* Fix for React lesson plan table Bootstrap 5 compatibility */
.lesson-plan-container .table {
    margin-bottom: 1rem;
    color: #212529;
    border-collapse: collapse;
}

.lesson-plan-container .table-striped > tbody > tr:nth-of-type(odd) > td,
.lesson-plan-container .table-striped > tbody > tr:nth-of-type(odd) > th {
    background-color: rgba(0, 0, 0, 0.05);
}

/* React lesson plan button styling */
.lesson-plan-container .btn {
    display: inline-block;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    background-color: transparent;
    border: 1px solid transparent;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.lesson-plan-container .btn-success {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

.lesson-plan-container .btn-success:hover {
    color: #fff;
    background-color: #157347;
    border-color: #146c43;
}

.lesson-plan-container .btn-info {
    color: #000;
    background-color: #0dcaf0;
    border-color: #0dcaf0;
}

.lesson-plan-container .btn-info:hover {
    color: #000;
    background-color: #3dd5f3;
    border-color: #25cff2;
}

.lesson-plan-container .btn-warning {
    color: #000;
    background-color: #ffc107;
    border-color: #ffc107;
}

.lesson-plan-container .btn-warning:hover {
    color: #000;
    background-color: #ffca2c;
    border-color: #ffc720;
}

/* Segment Editor Form Styling */
.segment-row {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6 !important;
    transition: all 0.2s ease-in-out;
}

.segment-row:hover {
    background-color: #e9ecef;
    border-color: #adb5bd !important;
}

.segment-time-input {
    width: 70px !important;
    text-align: center;
}

.segment-delete-btn {
    transition: all 0.2s ease-in-out;
}

.segment-delete-btn:hover {
    transform: scale(1.1);
}

/* Form body container */
.form-body {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
}

/* Segment form labels */
.segment-row .form-label {
    color: #495057;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

/* Time input styling */
.segment-row .d-flex {
    align-items: center;
}

.segment-row .text-muted {
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 20px;
    text-align: center;
}

/* Fix tooltip layout issues */
.tooltip {
    position: absolute !important;
    z-index: 1070 !important;
    display: block !important;
    margin: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
    font-style: normal !important;
    font-weight: 400 !important;
    line-height: 1.5 !important;
    text-align: left !important;
    text-decoration: none !important;
    text-shadow: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    word-break: normal !important;
    word-spacing: normal !important;
    white-space: normal !important;
    line-break: auto !important;
    font-size: 0.875rem !important;
    word-wrap: break-word !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.tooltip.show {
    opacity: 0.9 !important;
}

.tooltip-arrow {
    position: absolute !important;
    display: block !important;
    width: 0.8rem !important;
    height: 0.4rem !important;
}

.tooltip-inner {
    max-width: 200px !important;
    padding: 0.25rem 0.5rem !important;
    color: #fff !important;
    text-align: center !important;
    background-color: #000 !important;
    border-radius: 0.25rem !important;
}

/* Prevent table layout shifts from tooltips */
.table th[data-bs-toggle="tooltip"],
.table th[data-toggle="tooltip"],
.table td[data-bs-toggle="tooltip"],
.table td[data-toggle="tooltip"] {
    position: relative !important;
}

/* Ensure tooltips don't affect table column widths */
.table th,
.table td {
    position: relative !important;
    white-space: nowrap !important;
}

/* Fix for class summary table specifically */
.class-summary-table th,
.class-summary-table td {
    position: relative !important;
    white-space: nowrap !important;
    overflow: visible !important;
}

/* Tooltip positioning fixes */
.tooltip.bs-tooltip-top {
    padding: 0.4rem 0 !important;
}

.tooltip.bs-tooltip-top .tooltip-arrow {
    bottom: 0 !important;
}

.tooltip.bs-tooltip-top .tooltip-arrow::before {
    top: -1px !important;
    border-width: 0.4rem 0.4rem 0 !important;
    border-top-color: #000 !important;
}

.tooltip.bs-tooltip-bottom {
    padding: 0.4rem 0 !important;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow {
    top: 0 !important;
}

.tooltip.bs-tooltip-bottom .tooltip-arrow::before {
    bottom: -1px !important;
    border-width: 0 0.4rem 0.4rem !important;
    border-bottom-color: #000 !important;
}

.tooltip.bs-tooltip-start {
    padding: 0 0.4rem !important;
}

.tooltip.bs-tooltip-start .tooltip-arrow {
    right: 0 !important;
    width: 0.4rem !important;
    height: 0.8rem !important;
}

.tooltip.bs-tooltip-start .tooltip-arrow::before {
    left: -1px !important;
    border-width: 0.4rem 0 0.4rem 0.4rem !important;
    border-left-color: #000 !important;
}

.tooltip.bs-tooltip-end {
    padding: 0 0.4rem !important;
}

.tooltip.bs-tooltip-end .tooltip-arrow {
    left: 0 !important;
    width: 0.4rem !important;
    height: 0.8rem !important;
}

.tooltip.bs-tooltip-end .tooltip-arrow::before {
    right: -1px !important;
    border-width: 0.4rem 0.4rem 0.4rem 0 !important;
    border-right-color: #000 !important;
}

/* Specific modal fixes */
#educator-question-modal .modal-header,
#dioladId .modal-header,
#moduleVideoDialogId .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#educator-question-modal .modal-title,
#dioladId .modal-title,
#moduleVideoDialogId .modal-title {
    margin: 0;
    flex: 1;
}

#educator-question-modal .close,
#dioladId .close,
#moduleVideoDialogId .close {
    order: 2;
    margin-left: auto;
}

/* General Button Fixes */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s ease-in-out;
    font-weight: 400;
    text-align: center;
    vertical-align: middle;
    user-select: none;
}

.btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-primary:hover {
    color: #fff;
    background-color: #0056b3;
    border-color: #004085;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    color: #fff;
    background-color: #545b62;
    border-color: #4e555b;
}

.btn-success {
    color: #fff;
    background-color: #28a745;
    border-color: #28a745;
}

.btn-success:hover {
    color: #fff;
    background-color: #1e7e34;
    border-color: #1c7430;
}

.btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-danger:hover {
    color: #fff;
    background-color: #c82333;
    border-color: #bd2130;
}

.btn-outline-primary {
    color: #007bff;
    background-color: transparent;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.btn-outline-secondary {
    color: #6c757d;
    background-color: transparent;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-danger {
    color: #dc3545;
    background-color: transparent;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    border-radius: 0.2rem;
}

.btn-lg {
    padding: 0.5rem 1rem;
    font-size: 1.25rem;
    border-radius: 0.3rem;
}

.panel-info > .panel-body {
    background-color: #ffffff;  /* White, not light blue */
}

/* Add spacing between class panels */
.ms-class-item {
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.panel-warning {
    border-color: #faebcc;
}

.panel-warning > .panel-heading {
    color: #8a6d3b;
    background-color: #fcf8e3;
    border-color: #faebcc;
}

.panel-danger {
    border-color: #ebccd1;
}

.panel-danger > .panel-heading {
    color: #a94442;
    background-color: #f2dede;
    border-color: #ebccd1;
}

/* Panel collapse/accordion */
.panel-group {
    margin-bottom: 20px;
}

.panel-group .panel {
    margin-bottom: 0;
    border-radius: 4px;
}

.panel-group .panel + .panel {
    margin-top: 5px;
}

.panel-group .panel-heading {
    border-bottom: 0;
}

.panel-group .panel-heading + .panel-collapse > .panel-body {
    border-top: 1px solid #ddd;
}

.panel-tab {
    cursor: pointer;
    position: relative;
}

.panel-tab:hover {
    opacity: 0.9;
}

/* Panel collapse transitions (ONLY for panels, not navigation!) */
.panel-collapse {
    overflow: hidden;
}

/* Bootstrap 3 used .in, Bootstrap 5 uses .show - support both */
.panel-collapse.in,
.panel-collapse.show {
    display: block !important;
}

.panel-collapse:not(.in):not(.show) {
    display: none !important;
}

/* Force hide panels without show class - override Bootstrap 5 */
#classesAccordion .panel-collapse:not(.show),
#classesAccordion .accordion-collapse:not(.show) {
    display: none !important;
}

#classesAccordion .panel-collapse.show,
#classesAccordion .accordion-collapse.show {
    display: block !important;
}

/* Disable animations for classes accordion - instant show/hide */
#classesAccordion .accordion-collapse {
    transition: none !important;
    transition-duration: 0s !important;
}

#classesAccordion .accordion-collapse.collapsing {
    transition: none !important;
    transition-duration: 0s !important;
}

/* Let Bootstrap 5 handle the collapsing animation */
.panel-collapse.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* DO NOT TOUCH NAVBAR/NAVIGATION - Let Bootstrap 5 handle it */
#react-navigation-container {
    display: block !important;
    visibility: visible !important;
    background-color: #0e506b !important;
}

/* Override Bootstrap bg-dark class for navigation */
#react-navigation-container .navbar.bg-dark,
.navbar.bg-dark {
    background-color: #0e506b !important;
}

/* ONLY affect Bootstrap 5 navbar, NOT panels - be more specific */
@media (min-width: 992px) {
    .navbar .navbar-collapse.collapse {
        display: flex !important;
    }
}

@media (max-width: 991.98px) {
    .navbar .navbar-collapse.collapse:not(.show) {
        display: none !important;
    }
    
    .navbar .navbar-collapse.collapse.show {
        display: block !important;
    }
}

/* Collapsing state */
.panel-collapse.collapsing {
    height: 0;
    overflow: hidden;
    transition: height 0.35s ease;
}

/* Labels (Bootstrap 3) → Badges (Bootstrap 5) compatibility */
.label {
    display: inline;
    padding: .2em .6em .3em;
    font-size: 75%;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: .25em;
}

.label-default {
    background-color: #777;
}

.label-primary {
    background-color: #337ab7;
}

.label-success {
    background-color: #5cb85c;
}

.label-info {
    background-color: #5bc0de;
}

.label-warning {
    background-color: #f0ad4e;
}

.label-danger {
    background-color: #d9534f;
}

/* Button (Bootstrap 3) compatibility */
.btn-default {
    color: #333;
    background-color: #fff;
    border-color: #ccc;
}

.btn-default:hover,
.btn-default:focus {
    color: #333;
    background-color: #e6e6e6;
    border-color: #adadad;
}

.btn-default:active {
    background-color: #d4d4d4;
    border-color: #8c8c8c;
}

/* Form control sizing (Bootstrap 3) */
.input-sm {
    height: 30px;
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.5;
    border-radius: 3px;
}

.input-lg {
    height: 46px;
    padding: 10px 16px;
    font-size: 18px;
    line-height: 1.3333333;
    border-radius: 6px;
}

/* Well (Bootstrap 3) */
.well {
    min-height: 20px;
    padding: 19px;
    margin-bottom: 20px;
    background-color: #f5f5f5;
    border: 1px solid #e3e3e3;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.05);
}

.well-sm {
    padding: 9px;
    border-radius: 3px;
}

.well-lg {
    padding: 24px;
    border-radius: 6px;
}

/* Thumbnail (Bootstrap 3) */
.thumbnail {
    display: block;
    padding: 4px;
    margin-bottom: 20px;
    line-height: 1.42857143;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border .2s ease-in-out;
}

.thumbnail:hover {
    border-color: #337ab7;
}

/* Media object (Bootstrap 3) */
.media {
    margin-top: 15px;
}

.media:first-child {
    margin-top: 0;
}

.media-body {
    overflow: hidden;
    zoom: 1;
}

.media-heading {
    margin-top: 0;
    margin-bottom: 5px;
}

/* List group (Bootstrap 3) compatibility */
.list-group-item {
    position: relative;
    display: block;
    padding: 10px 15px;
    margin-bottom: -1px;
    background-color: #fff;
    border: 1px solid #ddd;
}

.list-group-item:first-child {
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
}

.list-group-item:last-child {
    margin-bottom: 0;
    border-bottom-right-radius: 4px;
    border-bottom-left-radius: 4px;
}

/* Close button (Bootstrap 3) compatibility */
.close {
    float: right;
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    filter: alpha(opacity=20);
    opacity: .2;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
    filter: alpha(opacity=50);
    opacity: .5;
}

button.close {
    -webkit-appearance: none;
    padding: 0;
    cursor: pointer;
    background: 0 0;
    border: 0;
}

/* Glyphicon compatibility - using Glyphicons Halflings font loaded above */
/* Base styles are defined at the top of the file */

/* Preserve spacing from Bootstrap 3 */
.glyphicon-left {
    margin-right: 5px;
}

.glyphicon-right {
    margin-left: 5px;
}

/* Classes Page - Custom layout fixes */
/* Accordion body content styling */
.ms-class-item .accordion-body .class-label,
.panel-body .class-label {
    font-size: 1.1em;
    color: #2820A8;
    margin-right: 20px;
}

.ms-class-item .accordion-body .educator-container,
.ms-class-item .accordion-body .student-container {
    padding: 15px;
}

.panel-body .class-label {
    font-size: 1.1em;
    color: #2820A8;
    margin-right: 20px;
    font-weight: 600;
    display: inline-block;
    vertical-align: middle;
}

.controls {
    display: inline-block;
    margin-right: 10px;
    margin-left: 5px;
    vertical-align: middle;
}

.panel-heading .delete-control {
    margin-top: -20px;
    float: right;
    margin-left: 10px;
}

.educator-container,
.student-container {
    padding: 15px;
    background-color: #ffffff;  /* White background */
}

.educator-container .table,
.student-container .table {
    margin-top: 15px;
    margin-bottom: 0;
}

/* Button spacing in class sections */
.educator-container .controls,
.student-container .controls {
    margin-left: 10px;
}

.btn-invite-all {
    margin-left: 20px;
}

/* Coordinator and invitation tags */
.coordinator-tag {
    background-color: purple;
    color: white;
    border-radius: 10px;
    font-size: 0.8em;
    margin-left: 15px;
    padding: 2px 5px;
    display: inline-block;
}

.label-student-invited {
    background-color: #73dd76;
    color: white;
    border-radius: 10px;
    font-size: 0.8em;
    margin-left: 15px;
    padding: 3px 8px;
    display: inline-block;
}

/* Table cell button styling */
.table td button {
    margin: 0;
}

.table td button i {
    pointer-events: none;
}

/* Remove educator/student buttons */
.btn-remove-educator,
.btn[title*="Remove"] {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Resend invite button */
.btn-resend-invite {
    font-size: 0.85em;
    padding: 0.25rem 0.75rem;
}

/* Helper classes from Bootstrap 3 */
.hidden {
    display: none !important;
}

/* Remove overly broad .show rule that interferes with Bootstrap 5 collapse */
/* .show {
    display: block !important;
} */

.invisible {
    visibility: hidden;
}

.text-hide {
    font: 0/0 a;
    color: transparent;
    text-shadow: none;
    background-color: transparent;
    border: 0;
}

.affix {
    position: fixed;
}

/* Responsive utilities compatibility */
@media (max-width: 767px) {
    .hidden-xs {
        display: none !important;
    }
}

@media (min-width: 768px) and (max-width: 991px) {
    .hidden-sm {
        display: none !important;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .hidden-md {
        display: none !important;
    }
}

@media (min-width: 1200px) {
    .hidden-lg {
        display: none !important;
    }
}

/* Form horizontal compatibility */
.form-horizontal .form-group {
    margin-right: -15px;
    margin-left: -15px;
}

.form-horizontal .control-label {
    padding-top: 7px;
    margin-bottom: 0;
    text-align: right;
}

/* Help block compatibility */
.help-block {
    display: block;
    margin-top: 5px;
    margin-bottom: 10px;
    color: #737373;
}

.help-block.error,
.help-block.usererror {
    color: #a94442;
}

/* Form group spacing improvements */
.form-group,
.mb-3 {
    margin-bottom: 1rem !important;
}

.form-group:last-child,
.mb-3:last-child {
    margin-bottom: 0 !important;
}

/* Control label spacing */
.control-label {
    margin-bottom: 0.5rem;
    display: block;
    font-weight: 500;
}

/* Controls container spacing */
.controls {
    margin-bottom: 0.25rem;
}

.controls:last-child {
    margin-bottom: 0;
}

/* Ensure proper spacing in intake forms */
.newintake .form-group,
.newintake .mb-3 {
    margin-bottom: 1.25rem;
}

.newintake .form-group:last-of-type,
.newintake .mb-3:last-of-type {
    margin-bottom: 1rem;
}

/* Ensure Bootstrap 5 components work with custom styling */
.modal-header .close {
    margin-top: -2px;
}

.modal-footer {
    text-align: right;
}

.modal-footer .btn + .btn {
    margin-bottom: 0;
    margin-left: 5px;
}

/* Preserve table styling */
.table > thead > tr > th,
.table > tbody > tr > th,
.table > tfoot > tr > th,
.table > thead > tr > td,
.table > tbody > tr > td,
.table > tfoot > tr > td {
    padding: 8px;
    line-height: 1.42857143;
    vertical-align: top;
    border-top: 1px solid #ddd;
}

.table > thead > tr > th {
    vertical-align: bottom;
    border-bottom: 2px solid #ddd;
}

/* Preserve form styles */
.form-control {
    display: block;
    width: 100%;
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
}

.form-control:focus {
    border-color: #66afe9;
    outline: 0;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);
}

/* Invalid state compatibility */
.form-control.is-invalid,
.was-validated .form-control:invalid {
    border-color: #a94442;
}

.form-control.is-invalid:focus,
.was-validated .form-control:invalid:focus {
    border-color: #843534;
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px #ce8483;
}

