/*! 
Custom styling for KIK Shuls
Author: Keep It Kosher
Site : https://app.keepitkosher.co
*/

.icon-disable{color: #ccc;cursor: default;}

.text-winner{
	color: #c4ab23;
}

.img-flag-sm{
  display: inline-block;
  height: 10px;
  margin-right: 5px;
  width: 15px;
}

.no-sort::after { display: none!important; }
.no-sort { pointer-events: none!important; cursor: default!important; }

.advanced-filter{margin-top: 10px;display: none;}
.tag-disabled {opacity: 0.6;}

.hidden{ display: none; }

input::placeholder {
  opacity: 0.5;
}

/* ========================================
   CONTRAST FIXES FOR BETTER ACCESSIBILITY
   ======================================== */

/* Fix black text on blue backgrounds across the CRM */
.bg-primary, .bg-primary-subtle, 
.btn-primary, .btn-primary:hover, .btn-primary:focus, .btn-primary:active,
.btn-check:checked + .btn-primary,
.btn-check:checked + .btn-outline-primary,
.alert-primary,
.card-header.bg-primary,
.page-title-box.bg-primary,
.navbar.bg-primary {
    color: white !important;
}

/* Ensure all child elements also use white text on primary backgrounds */
.bg-primary *, .bg-primary-subtle *,
.btn-primary *, .btn-primary:hover *, .btn-primary:focus *, .btn-primary:active *,
.btn-check:checked + .btn-primary *,
.btn-check:checked + .btn-outline-primary *,
.alert-primary *,
.card-header.bg-primary *,
.page-title-box.bg-primary *,
.navbar.bg-primary * {
    color: white !important;
}

/* Fix card titles and headers */
.card-header.bg-primary .card-title,
.card-header.bg-primary h1,
.card-header.bg-primary h2,
.card-header.bg-primary h3,
.card-header.bg-primary h4,
.card-header.bg-primary h5,
.card-header.bg-primary h6 {
    color: white !important;
}

/* Fix breadcrumbs on blue backgrounds */
.bg-primary .breadcrumb-item,
.bg-primary .breadcrumb-item a,
.bg-primary .breadcrumb-item::before {
    color: rgba(255, 255, 255, 0.8) !important;
}

.bg-primary .breadcrumb-item.active {
    color: white !important;
}

/* Fix table headers with primary background */
.table-primary,
.table-primary th,
.table-primary td {
    color: white !important;
}

/* Fix dropdown items on primary backgrounds */
.bg-primary .dropdown-item {
    color: white !important;
}

.bg-primary .dropdown-item:hover,
.bg-primary .dropdown-item:focus {
    color: #0d6efd !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Fix badges on primary backgrounds */
.bg-primary .badge {
    color: #0d6efd !important;
    background-color: rgba(255, 255, 255, 0.9) !important;
}

/* Fix links on primary backgrounds */
.bg-primary a:not(.btn) {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: underline;
}

.bg-primary a:not(.btn):hover {
    color: white !important;
}

/* Fix form controls on primary backgrounds */
.bg-primary .form-control,
.bg-primary .form-select {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Fix modal headers with primary background */
.modal-header.bg-primary .modal-title,
.modal-header.bg-primary .btn-close {
    color: white !important;
}

/* Fix success, warning, danger backgrounds too */
.bg-success, .bg-success-subtle,
.btn-success, .btn-success:hover, .btn-success:focus, .btn-success:active,
.btn-check:checked + .btn-success,
.btn-check:checked + .btn-outline-success {
    /* color: white !important;*/
}

.bg-warning, .bg-warning-subtle,
.btn-warning, .btn-warning:hover, .btn-warning:focus, .btn-warning:active,
.btn-check:checked + .btn-warning,
.btn-check:checked + .btn-outline-warning {
    color: #000 !important;
}

.bg-danger, .bg-danger-subtle,
.btn-danger, .btn-danger:hover, .btn-danger:focus, .btn-danger:active,
.btn-check:checked + .btn-danger,
.btn-check:checked + .btn-outline-danger {
    color: white !important;
}

/* Fix child elements for other colored backgrounds */
.bg-success *, .bg-success-subtle *,
.btn-success *, .btn-success:hover *, .btn-success:focus *, .btn-success:active *,
.btn-check:checked + .btn-success *,
.btn-check:checked + .btn-outline-success * {
    color: white !important;
}

.bg-danger *, .bg-danger-subtle *,
.btn-danger *, .btn-danger:hover *, .btn-danger:focus *, .btn-danger:active *,
.btn-check:checked + .btn-danger *,
.btn-check:checked + .btn-outline-danger * {
    color: white !important;
}

/* ========================================
   iOS / MOBILE SAFARI FIXES
   ======================================== */

/* Fix for iOS Safari momentum scrolling */
#scrollbar,
.navbar-menu,
.app-menu,
.table-responsive,
.modal-body,
.offcanvas-body {
    -webkit-overflow-scrolling: touch !important;
}

/* Prevent rubber band scrolling from interfering with menu */
.navbar-menu {
    overscroll-behavior: contain;
}

/* Fix table horizontal scrolling on iOS */
.table-responsive {
    -webkit-overflow-scrolling: touch !important;
    overflow-x: auto !important;
    overflow-y: hidden;
    /* Create a new stacking context to prevent scroll issues */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
}

/* Ensure tables inside responsive containers scroll properly */
.table-responsive table {
    /* Prevent table from collapsing */
    min-width: 100%;
}

/* Fix touch events on iOS for scrollable areas */
.table-responsive,
.navbar-menu,
#scrollbar {
    /* Allow touch events to work properly */
    touch-action: pan-x pan-y;
    -ms-touch-action: pan-x pan-y;
}

/* Prevent iOS from zooming on double-tap in scrollable areas */
.table-responsive *,
.navbar-menu * {
    touch-action: manipulation;
    -ms-touch-action: manipulation;
}

/* Fix menu getting stuck on iOS */
.app-menu {
    /* Force GPU acceleration for smoother scrolling */
    transform: translate3d(0, 0, 0);
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    perspective: 1000;
    -webkit-perspective: 1000;
}

/* Fix menu overlay issues on iOS */
@supports (-webkit-touch-callout: none) {
    /* iOS-specific fixes */

    /* Fix menu height on iOS Safari with dynamic toolbar */
    .navbar-menu {
        height: 100vh;
        height: -webkit-fill-available;
    }

    /* Fix scrollable content height */
    #scrollbar {
        max-height: calc(100vh - 70px);
        max-height: calc(-webkit-fill-available - 70px);
    }

    /* Prevent iOS Safari from hiding overflow content */
    .app-menu {
        overflow: visible;
    }
}

/* Fix modal scrolling on iOS */
.modal {
    -webkit-overflow-scrolling: touch;
}

.modal-body {
    -webkit-overflow-scrolling: touch;
    overflow-y: auto;
}

/* Prevent body scroll when menu is open on mobile */
body.menu-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Fix sticky headers on iOS */
.sticky-top,
.fixed-top {
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

/* Smooth scrolling for iOS */
html {
    -webkit-overflow-scrolling: touch;
}

/* Fix for iOS Safari address bar appearing/disappearing */
@media screen and (max-width: 767px) {
    .main-content {
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }
}
