/*
 * e-ManuExcel — modern Bootstrap finish.
 *
 * A thin layer over AdminLTE 3 (Bootstrap 4) that gives it the look of current
 * Bootstrap 5 sites: slightly rounder corners, soft shadows and short, subtle
 * animations. It changes no colours, adds no gradients and no new components.
 *
 * Loaded on every AdminLTE page (config/adminlte.php → plugins → Theme), on the
 * sign-in pages and on the platform console. Every animation is switched off
 * for people who ask their device for reduced motion.
 */

/* ── Shape: Bootstrap 5 radii and soft shadows ──────────────────────────── */
.card,
.small-box,
.info-box,
.callout,
.alert,
.modal-content,
.dropdown-menu {
    border-radius: .5rem;
}
.card > .card-header:first-child {
    border-top-left-radius: calc(.5rem - 1px);
    border-top-right-radius: calc(.5rem - 1px);
}
.card > .card-footer:last-child {
    border-bottom-left-radius: calc(.5rem - 1px);
    border-bottom-right-radius: calc(.5rem - 1px);
}
/* Tables that run to the card's bottom edge follow its rounded corners. */
.card > .card-body:last-child,
.card > .table-responsive:last-child {
    border-bottom-left-radius: calc(.5rem - 1px);
    border-bottom-right-radius: calc(.5rem - 1px);
}
.card,
.info-box,
.small-box {
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05), 0 1px 3px rgba(0, 0, 0, .1);
}
.btn,
.form-control,
.custom-select,
.input-group-text {
    border-radius: .375rem;
}
.btn-sm,
.btn-xs {
    border-radius: .25rem;
}
.dropdown-menu {
    border: 0;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}
.main-header.navbar {
    border-bottom: 0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .06);
}

/* ── Motion ─────────────────────────────────────────────────────────────── */

/* Page content eases in on load. Only the starting state is applied before
   the animation (fill-mode: backwards), so once it ends the content has no
   transform left — modals and other fixed elements inside are unaffected. */
@keyframes emx-rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}
@keyframes emx-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes emx-grow {
    from { width: 0; }
}

.content-header,
.content-wrapper > .content,
main.container,
.login-box,
.emx-rise {
    animation: emx-rise .35s ease-out backwards;
}
.content-wrapper > .content,
main.container {
    animation-delay: .05s;
}

/* Flash messages and opened menus fade in (opacity only: dropdowns are
   positioned with transforms). */
.alert,
.callout,
.dropdown-menu.show {
    animation: emx-fade .2s ease-out backwards;
}

/* Progress bars fill up from empty. */
.progress-bar {
    animation: emx-grow .7s ease-out backwards;
}

/* Smooth hover and press feedback. */
.btn {
    transition: color .15s, background-color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:not(:disabled):not(.disabled):active {
    transform: scale(.97);
}
.table-hover tbody tr {
    transition: background-color .15s;
}
.nav-sidebar .nav-link,
.nav-tabs .nav-link,
.nav-pills .nav-link,
.page-link,
.list-group-item-action {
    transition: color .15s, background-color .15s;
}

/* Cards and tiles you can click lift slightly on hover. */
a.card,
.card-hover,
.small-box,
.info-box {
    transition: transform .2s ease, box-shadow .2s ease;
}
a.card:hover,
.card-hover:hover,
.small-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .12);
}
a.card:active {
    transform: scale(.98);
}
a.card:hover {
    text-decoration: none;
}

/* Submit buttons show a spinner while the page is saving (public/js/theme.js). */
.btn.is-loading {
    pointer-events: none;
    opacity: .8;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
    a.card:hover,
    .card-hover:hover,
    .small-box:hover {
        transform: none;
    }
}
