/* Site-wide styles shared by every layout (app-shell polish, progress bar, toasts). Linked from resources/views/partials/head-assets.blade.php; the theme colours stay inline there because they come from Settings. */

/* ==================================================================
   Native-app-shell polish — reaches every page via head-assets.
   Additive only: nothing here removes or hides existing functionality,
   it only restyles how it presents on phones (<991.98px / <767.98px).
   ================================================================== */

/* Soft fade-in on load instead of a hard flash — the cheapest approximation
   of a native screen transition without a JS framework in this project. */
@keyframes app-fade-in{from{opacity:0}to{opacity:1}}
body{animation:app-fade-in .18s ease both;}
@media (prefers-reduced-motion:reduce){ body{animation:none;} }

/* Comfortable tap targets on phones/tablets. Deliberately excludes .btn-sm —
   that size is used site-wide for dense table-row actions (View/Edit/Delete
   icons), and bloating those would fight the "compact" half of this request. */
@media (max-width:991.98px){
    .btn:not(.btn-sm){min-height:44px;}
}

/* Modals as bottom sheets on phones — the native pattern for confirmations
   and quick edit forms. EXCLUDED: #bannerModal, the public image-lightbox
   viewer, which has its own centered zoom/pan/swipe math that a bottom-sheet
   would fight (verified by reading public/partials/image-lightbox.blade.php). */
@media (max-width:767.98px){
    .modal:not(#bannerModal) .modal-dialog{
        display:flex; align-items:flex-end; min-height:100%; margin:0 auto; max-width:100%;
    }
    .modal:not(#bannerModal) .modal-content{
        width:100%; border-radius:1rem 1rem 0 0; border:0;
        max-height:90dvh; overflow-y:auto;
        padding-bottom:env(safe-area-inset-bottom);
    }
    /* Override Bootstrap's own open-transition offset (translateY(-50px)→0)
       so the sheet slides UP from the bottom instead of dropping from the top —
       same property Bootstrap already animates, just a different starting value. */
    .modal.fade:not(#bannerModal) .modal-dialog{transition:transform .25s ease-out; transform:translateY(32px);}
    .modal.show:not(#bannerModal) .modal-dialog{transform:translateY(0);}
}

/* Slim top-of-viewport loading bar — the cheapest native "something is
   happening" feedback available without a real SPA/route-transition system. */
#app-progress{position:fixed;top:0;left:0;height:3px;width:0;background:var(--school-primary,#0d6efd);
    z-index:2000;transition:width .3s ease,opacity .3s ease;opacity:0;pointer-events:none;}
#app-progress.on{opacity:1;}
/* The phone-toast bottom-center container clears the fixed bottom nav
   (--app-bottombar-h is 0 until the nav partials define it, so this is a
   no-op on pages/phases that don't have one yet). */
.app-toast-bottom{margin-bottom:calc(var(--app-bottombar-h, 0px) + env(safe-area-inset-bottom));}
