/* ============================================
   TITANS Portal - Edit Case Stylesheet
   ============================================ */

/* ============================================
   Bootstrap 5 Tab Styles & Fixes
   ============================================ */

/* Fix for Power Pages inline styles that block tab visibility */
/* Power Pages renders inline styles (display, opacity, visibility) that override Bootstrap classes */
/* We use !important to override these server-rendered inline styles */

/* Force active tabs to show - overrides inline style="display:none; opacity:0; visibility:hidden;" */
#titans-root .tab-pane.active.show {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Force inactive tabs to hide - overrides inline style="display:block; opacity:1; visibility:visible;" */
#titans-root .tab-pane:not(.active) {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* Tab styling */
#titans-root .nav-tabs .nav-link {
    cursor: pointer;
    color: #ffffff !important;
}
#titans-root .nav-tabs .nav-link.active {
    color: #ffffff !important;
    background-color: #4a7ba7 !important;
    border-color: #dee2e6 #dee2e6 transparent;
}
#titans-root .nav-tabs .nav-link:hover {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.1);
}
#titans-root .nav-tabs .nav-link.active:hover {
    color: #ffffff !important;
    background-color: #5a8bb7 !important;
}

/* ============================================
   Select2 Dropdown Customizations
   ============================================ */

/* Typology Dropdown Styling - Show All Options Without Scrolling */
.typology-dropdown {
    max-height: none !important;
    height: auto !important;
    min-width: 400px !important;
    max-width: 600px !important;
}
.typology-dropdown .select2-results {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}
.typology-dropdown .select2-results__options {
    max-height: none !important;
    overflow: visible !important;
}
.typology-dropdown .select2-results__option {
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}
.typology-dropdown .select2-results__option--highlighted {
    background-color: #337ab7 !important;
    color: white !important;
}

/* Methods Dropdown Styling - Show All Options Without Scrolling */
.methods-dropdown {
    max-height: none !important;
    height: auto !important;
    min-width: 400px !important;
    max-width: 600px !important;
}
.methods-dropdown .select2-results {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}
.methods-dropdown .select2-results__options {
    max-height: none !important;
    overflow: visible !important;
}
.methods-dropdown .select2-results__option {
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}
.methods-dropdown .select2-results__option--highlighted {
    background-color: #337ab7 !important;
    color: white !important;
}

/* Predicate Offense Dropdown Styling - Show All Options Without Scrolling */
.predicate-dropdown {
    max-height: none !important;
    height: auto !important;
    min-width: 400px !important;
    max-width: 600px !important;
}
.predicate-dropdown .select2-results {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}
.predicate-dropdown .select2-results__options {
    max-height: none !important;
    overflow: visible !important;
}
.predicate-dropdown .select2-results__option {
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}
.predicate-dropdown .select2-results__option--highlighted {
    background-color: #337ab7 !important;
    color: white !important;
}

/* 3PML Facilitator Dropdown Styling - Show All Options Without Scrolling */
.pmlfacilitator-dropdown {
    max-height: none !important;
    height: auto !important;
    min-width: 400px !important;
    max-width: 600px !important;
}
.pmlfacilitator-dropdown .select2-results {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}
.pmlfacilitator-dropdown .select2-results__options {
    max-height: none !important;
    overflow: visible !important;
}
.pmlfacilitator-dropdown .select2-results__option {
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}
.pmlfacilitator-dropdown .select2-results__option--highlighted {
    background-color: #337ab7 !important;
    color: white !important;
}

/* Keywords Dropdown Styling - Show All Options Without Scrolling */
.keywords-dropdown {
    max-height: none !important;
    height: auto !important;
    min-width: 400px !important;
    max-width: 600px !important;
}
.keywords-dropdown .select2-results {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
}
.keywords-dropdown .select2-results__options {
    max-height: none !important;
    overflow: visible !important;
}
.keywords-dropdown .select2-results__option {
    padding: 8px 12px !important;
    font-size: 14px !important;
    line-height: 1.4 !important;
}
.keywords-dropdown .select2-results__option--highlighted {
    background-color: #337ab7 !important;
    color: white !important;
}

/* ============================================
   Page Layout
   ============================================ */

/* Page background and card-like content wrapper */
body {
    background-color: #f6f7fb;
}
#titans-root > .container-fluid {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    margin-top: 20px;
    margin-bottom: 30px;
}

/* Optional: soften section dividers */
.section-divider {
    border-top: 1px solid #e6e9ef;
}

/* Optional: slightly round inputs and panels for consistency */
.form-control,
.panel,
.well,
.btn,
.select2-container .select2-selection--multiple,
.select2-container .select2-selection--single {
    border-radius: 4px;
}

/* ============================================
   Modal Styling & Fixes
   ============================================ */

.modal[aria-modal="true"] { 
    opacity: 1 !important; 
}
.modal { 
    transition: opacity 0.15s linear; 
}

/* Fix modal positioning */
.modal-dialog {
    margin: 140px auto 50px auto;
    max-width: 600px;
    z-index: 1060 !important;
    position: relative;
}

.modal-content {
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,.5);
    position: relative;
    margin-top: 20px;
}

.modal-header {
    border-bottom: 1px solid #e5e5e5;
    padding: 15px;
    position: relative;
    min-height: 60px;
}

/* Fix close button positioning and functionality */
.modal-header .close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.7;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-header .close:hover,
.modal-header .close:focus {
    opacity: 1;
    color: #000;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #e5e5e5;
    padding: 15px;
}

/* Ensure modal backdrop is visible but doesn't block modal */
.modal-backdrop {
    z-index: 1040 !important;
    pointer-events: none !important;
}

.modal-backdrop.in {
    z-index: 1040 !important;
    pointer-events: none !important;
}

/* Force modal to be visible and ensure proper stacking */
.modal {
    z-index: 1055 !important;
}

.modal.show {
    display: block !important;
}

.modal.in {
    display: block !important;
}

/* Ensure modal content is clickable */
.modal-dialog,
.modal-content,
.modal-header,
.modal-body,
.modal-footer {
    pointer-events: auto !important;
    position: relative;
}

/* Ensure buttons are clickable */
.modal button {
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* Fix Select2 dropdown z-index in modals */
.select2-container {
    z-index: 9999 !important;
}

.select2-dropdown {
    z-index: 9999 !important;
}

.select2-container--open {
    z-index: 9999 !important;
}

/* ============================================
   Form Validation Styling
   ============================================ */

.form-control.is-valid {
    border-color: #28a745;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: block;
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

.form-text {
    color: #6c757d;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

