/* ============================================================================
   site-modals.css - shared modal dialog styling
   Replaces the Telerik RadToolTip "modal" pattern
   (ShowEvent="FromCode" ManualClose="true" Modal="true" Position="Center").

   Part of the Telerik removal project. See .kiro/specs/telerik-removal/
   Shown/hidden from code-behind via App_Code/Helpers/ModalHelper.vb.
   Client helpers in /js/site/modal-helpers.js.

   MARKUP CONTRACT:
     <dialog id="dlgSomething" class="site-modal">
       <div class="site-modal-body">
         ... content, including asp: server controls ...
       </div>
       <div class="site-modal-actions">
         <button type="button" class="site-modal-close" data-modal-close>Close</button>
       </div>
     </dialog>

   WHY THE NATIVE <dialog> ELEMENT:
     showModal() gives focus trapping, Escape-to-close, inert background content,
     and top-layer stacking with no library and no z-index arithmetic. RadToolTip
     needed all of that hand-rolled. Browser support is universal across the
     versions this admin tool is used on (Chrome/Edge/Firefox/Safari all shipped
     it by early 2022).

   Palette matches the wholesale portal and Factory admin:
     #383a35  dark neutral / body text
     #FF6B00  brand orange accent
     Raleway  site font
   ============================================================================ */

.site-modal {
    /* Reset the UA default, then rebuild */
    padding: 0;
    border: 0;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    background-color: #ffffff;
    color: #383a35;
    font-family: 'Raleway', sans-serif;
    font-size: 13px;
    line-height: 1.5;

    /* Sizing. min() keeps it usable on small screens without a media query. */
    width: min(520px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    overflow: auto;
}

/* Wider variant for modals holding a form or a table */
.site-modal.site-modal-wide {
    width: min(860px, calc(100vw - 32px));
}

/* Dimmed backdrop. Only applies when opened with showModal(), which is what
   ModalHelper does - an open attribute alone renders inline with no backdrop. */
.site-modal::backdrop {
    background-color: rgba(0, 0, 0, 0.55);
}

/* ---------- Optional heading ------------------------------------------ */

.site-modal-title {
    margin: 0;
    padding: 14px 20px;
    background-color: #383a35;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    border-bottom: 3px solid #FF6B00;
}

/* ---------- Body ------------------------------------------------------- */

.site-modal-body {
    padding: 20px;
}

/* The RadToolTip content on the request/contact pages was a Literal holding a
   "-Name is required<br />" style list, or a success sentence. Keep that
   readable without needing per-page CSS. */
.site-modal-body p {
    margin: 0 0 10px 0;
}

.site-modal-body p:last-child {
    margin-bottom: 0;
}

/* ---------- Actions row ------------------------------------------------ */

.site-modal-actions {
    padding: 12px 20px;
    background-color: #f4f4f4;
    border-top: 1px solid #e0e0e0;
    text-align: right;
}

.site-modal-actions button,
.site-modal-actions .site-modal-close {
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    background-color: #383a35;
    border: 1px solid #383a35;
    border-radius: 3px;
    padding: 7px 18px;
    cursor: pointer;
}

.site-modal-actions button:hover,
.site-modal-actions .site-modal-close:hover {
    background-color: #FF6B00;
    border-color: #FF6B00;
}

.site-modal-actions button:focus-visible,
.site-modal-actions .site-modal-close:focus-visible {
    outline: 2px solid #FF6B00;
    outline-offset: 2px;
}

/* ---------- Corner dismiss (optional) --------------------------------- */

.site-modal-dismiss {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: 0;
    font-size: 20px;
    line-height: 1;
    color: #ffffff;
    cursor: pointer;
    padding: 2px 6px;
}

.site-modal-dismiss:hover {
    color: #FF6B00;
}

/* Only position relative when there is a title bar to anchor against */
.site-modal:has(.site-modal-title) {
    position: relative;
}

/* ---------- Print ------------------------------------------------------ */

@media print {
    .site-modal {
        display: none;
    }
}

/* ============================================================================
   .scc-updating - async postback indicator
   Used by the asp:UpdateProgress controls that replaced Telerik's
   RadAjaxLoadingPanel. Several of those declared no markup of their own and
   relied on a Telerik skin (Skin="Silk") to draw the spinner, so the visual has
   to come from site CSS now.

   Part of the Telerik removal project. See .kiro/specs/telerik-removal/
   ============================================================================ */

.scc-updating {
    display: inline-block;
    padding: 6px 14px 6px 34px;
    position: relative;

    background-color: #383a35;
    color: #ffffff;
    font-family: 'Raleway', sans-serif;
    font-size: 12px;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Spinner drawn in CSS rather than shipping another image. */
.scc-updating::before {
    content: '';
    position: absolute;
    left: 12px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #FF6B00;
    border-radius: 50%;
    animation: scc-spin 700ms linear infinite;
}

@keyframes scc-spin {
    to { transform: rotate(360deg); }
}

/* Respect a user's reduced-motion preference: keep the indicator, drop the spin. */
@media (prefers-reduced-motion: reduce) {
    .scc-updating::before {
        animation: none;
        border-top-color: rgba(255, 255, 255, 0.35);
    }
}
