:root {
    --nav-top: 60px;
}

.datepicker-backdrop, 
.timepicker-modal,
.timepicker-wrapper {
    z-index: 6200 !important;
}

.datepicker-modal-container,
.timepicker-container,
.select-dropdown-container {
    z-index: 6201 !important;
}

* {
    --mdb-form-outline-select-label-color: #64B5F6 !important;
    --mdb-primary: #64B5F6 !important;
    --mdb-primary-rgb: 25, 118, 210 !important; /* Needed for some alpha variants */
    --mdb-secondary: #64B5F6 !important; /* Optional: if you want to also override secondary */
    --mdb-accent: #64B5F6 !important;
    --mdb-primary-hover: #2196F3 !important;
    --mdb-primary-focus: #1E88E5 !important;
    --mdb-form-outline-select-notch-border-color:#64B5F6 !important;
}

.table-responsive .table tbody td {
    font-weight: 300;
}

.text-spl-green {
    --mdb-text-opacity: 1;
    color: #4CAF50 !important;
}

.chart-mdb text {
    fill: var(--mdb-body-color) !important;
    
}

.apexcharts-menu.apexcharts-menu-open {
    border: none !important;
    color: var(--mdb-body-color) !important;
    background-color: var(--mdb-surface-bg);
}

.apexcharts-menu.apexcharts-menu-open div:hover {
    background-color: #616161 !important;
}

.basky-icon {
    min-width: 18px;
    text-align: center;
}

#basky-main-system {
    padding-top: var(--nav-top);
}

#main-sidenav {
    max-width: 300px !important; 
    width: 90% !important;
}

#main-sidenav .sidenav-link {
    padding: 8px 14px;
    height: 2.8em;
}

.sidenav .ps__rail-x, 
.sidenav .ps__rail-y {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.sidenav-menu {
    overflow-y: auto !important;
    -ms-overflow-style: none !important;
    scrollbar-width: none !important;
}

.sidenav-menu::-webkit-scrollbar {
    display: none !important;
}

.toast-slide-in {
    animation: toastIn 0.5s ease forwards;
}

.toast-slide-out {
    animation: toastOut 0.5s ease forwards;
}

@keyframes toastIn {
    0% {
        opacity: 0;
        transform: translateX(100%);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100%);
    }
}

.form-check-input.chk-fix::after {
    margin-left: 0.32rem !important;
    background-color: transparent !important;
}

.sidenav-backdrop {
    background-color: #00000090 !important;
}

.toast-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 20px;
    height: 20px;
    padding: 0;
    opacity: 0.8;
    z-index: 10;
    border: none;
    background: transparent;
    cursor: pointer;
}

.toast-close:hover {
    opacity: 1;
}

.toast-content {
    padding-right: 32px;
}

.toast-title {
    font-weight: 600;
    font-size: 18px;
    display: flex;
    flex-direction: row;
    gap: 6px;
}

.toast-body {
    padding: 2px 0px 0px 8px !important;
    font-size: 12.5px;
}

.toast-timer {
    width: 16px;
    height: 16px;
    margin: -1px 0px 0px 4px;
}

#toastContainer {
    pointer-events: none;
}

.toast-timer svg {
    transform: rotate(-90deg);
}

.toast-icon {
    bottom: -2px;
    left: 30px;
    font-size: 16px;
    opacity: 0.85;
    color: #fff;
    pointer-events: none;
}

.profile-cover {
    height: 26vh;
    display: flex;
    background-size: cover !important;
    background-position: center center;
    background: url(/files/system/cover.jpg);
    flex-direction: row;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 42px;
}

.border-sel {
    border: 2px solid #198754 !important; /* Bootstrap success green */
}

.media-hover:not(.border-sel):hover {
    border: 2px solid #bdbdbd80 !important; /* Material Grey 400 */
    cursor: pointer;
}

.basky-app-unread td {
    background-color: #4CAF5030 !important;
}

#fileModal .modal-dialog {
    margin: 0;
    height: 100%;
}

.modal-fullscreen #fileModalContent {
    max-height: none !important;
}

/* Remove the restrictive max-height that's breaking the scroll logic */
#media-grid,
#media-list {
    overflow: visible !important; /* Let the modal-body handle the scroll */
    max-height: none !important;
}

/* Ensure modal body is the only scrollable area */
.modal-body {
    flex: 1 1 auto;
    overflow-y: auto;
}

.modal-footer {
    padding: 1rem;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.status { font-size: 1.2rem; margin-bottom: 1rem; }
i { margin-right: 6px; }
.ldr-overlay-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    pointer-events: all; /* Blocks clicks to elements behind it */
}

.showin {
    animation: fadeIn 0.3s forwards;
}

.showout {
    animation: fadeOut 0.3s forwards;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; } }

/* Your existing .loader CSS goes here */
#loader-backdrop { background-color: #21212100; z-index: 8000; width: 100vw; height: 100vh; position: fixed; transition: all 0.35s ease-in-out; }
#loader-backdrop.showin { background-color: #212121FF; opacity: 1; }
#loader-backdrop.showout { background-color: #21212100; opacity: 0; }
#loader-op-backdrop { background-color: #21212100; z-index: 8000; width: 100vw; height: 100vh; position: fixed; transition: all 0.35s ease-in-out; }
#loader-op-backdrop.showin { background-color: #212121A0; opacity: 1; }
#loader-op-backdrop.showout { background-color: #212121A0; opacity: 0; }
#loader-backdrop .loader, #loader-op-backdrop .loader { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.loader {
    width: 47px;
    height: 47px;
    position: relative;
}
.loader:before,
.loader:after {
    content:"";
    display: block;
    border: 24px solid;
    border-color: transparent transparent #fff  #fff;
    position: absolute;
    left: 0;
    top: 0;
    animation: mvx 1.2s infinite ease-in;
}
.loader:before {
    border-color:#fff  #fff transparent transparent;
    animation-name:mvrx;
}
@keyframes mvx {
    0% , 10%  {transform: translate(0 , 0) rotate(0deg)}
    30% {transform: translate(-50% , -50%) rotate(0deg)}
    50% {transform: translate(-50% , -50%) rotate(180deg)}
    75% , 100% {transform: translate(0, 0) rotate(180deg)}
}
@keyframes mvrx {
    0% , 10%  {transform: translate(0 , 0) rotate(0deg)}
    30% {transform: translate(50% , 50%) rotate(0deg)}
    50% {transform: translate(50% , 50%) rotate(180deg)}
    75% , 100% {transform: translate(0, 0) rotate(180deg)}
}

/* Light mode */
/* Light mode */
html:not([data-mdb-theme="dark"]) .sidenav-link.active {
    background: linear-gradient(to right, #9E9E9E40 50%, transparent 100%);
    border-radius: 4px;
    color: #000;
}

/* Dark mode */
html[data-mdb-theme="dark"] .sidenav-link.active {
    background: linear-gradient(to right, #21212140 50%, transparent 100%);
    border-radius: 4px;
    color: #fff;
}

.basky-drop .fas {
    font-size: 22px;
}

@media (max-width: 768px) {
    .profile-cover {
        height: 16vh;
    }
    
    #media-grid,
    #media-list {
        overflow: auto !important;
        max-height: 38vh;
    }

    #media-list .media-item {
        width: 64px !important;
        height: 64px !important;
    }
    
    .modal-body {
        max-height: calc(100vh - 150px); /* Adjust based on header/footer height */
    }

    .media-hover:hover {
        border: 2.25px solid #14a44d !important;
    }
}