/* Additions to the WebForms CMS styles (site.css / mobile.css are copied from system/css unchanged) */

/* Page height: site.css gives #body a fixed min-height of 1500px, so short pages (e.g. navigation) could be
   scrolled down into empty space. Fill the window instead - the viewport minus the fixed top bar
   (25px, 50px on small screens; mobile.css moves #body down by the same amount) - and leave room at the
   bottom so the fixed footer does not cover the end of long pages. */
#body {
    min-height: calc(100vh - 25px);
    padding-bottom: 60px;
}

@media only screen and (max-width: 980px) {
    #body {
        min-height: calc(100vh - 50px);
    }
}

/* site.css only styles a.button - forms now post with real buttons */
button.button {
    background-color: #5fbeaa;
    border: 0;
    border-radius: 3px;
    display: inline-block;
    color: #FFFFFF;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    padding: 8px 20px;
    text-decoration: none;
    text-transform: capitalize;
    cursor: pointer;
}

button.button:hover {
    background-color: #999999;
}

button.button:active {
    position: relative;
    top: 1px;
}

.validate {
    color: #CC0000;
}

.gridView th {
    font-weight: bold;
}

/* same as the WebForms DataGrid AlternatingItemStyle-BackColor="#DDDDDD" */
.gridView.striped tbody tr:nth-child(even) {
    background-color: #DDDDDD;
}

/* ---- Page Management (Pages/SitePages) ---- */

/* small POST forms inside grid cells (e.g. show / hide an asset) */
form.inlineForm {
    display: inline;
    margin: 0;
}

/* a submit button that looks like the grid's icon links */
button.iconButton {
    background: none;
    border: 0;
    padding: 0;
    color: #337ab7;
    cursor: pointer;
}

button.iconButton:hover {
    color: #23527c;
}

/* SEO "nn remaining" counters of the page form */
.charCount {
    color: #5fbeaa;
    font-size: 13px;
}

/* header preview of the content block form */
#headerPreview {
    border-bottom: 1px dashed #dcdcdc;
    padding-top: 6px;
}

#headerPreview .preview-heading {
    margin: 0;
}
/* drag & drop ordering (js/reorder.js) */
.dragHandle {
    cursor: move;
    color: #999;
    width: 24px;
    text-align: center;
}

.sortable-ghost {
    opacity: 0.4;
}

/* order number previewed after dragging, not saved yet */
.weightUnsaved {
    color: #CC0000;
    font-style: italic;
}

/* ---- info icon with a tooltip "bubble" (Bootstrap data-bs-toggle="tooltip") ---- */
.tokenHelp {
    color: #5fbeaa;
    cursor: help;
    margin-left: 4px;
}

/* the new token + copy icon in the token popup: no Bootstrap focus glow / outline */
.tokenField .form-control:focus,
.tokenField .btn:focus,
.tokenField .btn:focus-visible,
.tokenField .btn:active {
    box-shadow: none;
    outline: none;
}

.tokenField .form-control:focus {
    border-color: var(--bs-border-color);
}

/* the icon keeps its look while clicked (Bootstrap fills an outline button grey) */
.tokenField .btn:active,
.tokenField .btn:focus {
    background-color: transparent;
    color: var(--bs-secondary);
    border-color: var(--bs-secondary);
}

/* Site Logo page: previews of the current logo / favicon (checkerboard shows transparent parts) */
.sitePreview,
.faviconPreview {
    border: 1px solid #ddd;
    padding: 6px;
    margin-bottom: 8px;
    background: repeating-conic-gradient(#eee 0% 25%, #fff 0% 50%) 50% / 16px 16px;
}

.sitePreview {
    max-width: 320px;
    max-height: 120px;
}

.faviconPreview {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

/* ---- "please wait" overlay (js/loading.js) ---- */
.cmsLoading {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2000;
    background-color: rgba(255, 255, 255, 0.75);
}

.cmsLoadingBox {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: #FFFFFF;
    border: 1px solid #dedede;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 24px 36px;
    text-align: center;
}

.cmsLoadingBox .fa-spinner {
    font-size: 32px;
    color: #5fbeaa;
}

.cmsLoadingBox p {
    margin: 12px 0 0 0;
}

/* ---- status labels (e.g. Tenant Databases) - green ok, amber waiting, red failed ---- */
.statusLabel {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.statusLabel.ok {
    background-color: #D4EDDA;
    color: #155724;
}

.statusLabel.waiting {
    background-color: #FFF3CD;
    color: #856404;
}

.statusLabel.failed {
    background-color: #F8D7DA;
    color: #721C24;
}

/* a status label that is also a switch (e.g. asset Visible / Hidden) */
button.statusLabel {
    border: 0;
    cursor: pointer;
}

button.statusLabel:hover {
    filter: brightness(0.93);
}

/* ---- master working in a tenant's CMS ("Open CMS") - top bar in _Layout ---- */
.actingTenant {
    background-color: #FFF3CD;
    color: #333333;
    padding: 2px 8px;
    border-radius: 3px;
}

button.actingTenantBack {
    background: none;
    border: 0;
    padding: 0 0 0 6px;
    color: #337ab7;
    text-decoration: underline;
    cursor: pointer;
}

/* ---- SEO Settings (Pages/Options/Seo) ---- */
.gridView .seoFlag {
    text-align: center;
    width: 120px;
}

/* inactive pages are not on the live website */
.gridView tr.inactivePage td {
    color: #999999;
}

/* changed, not saved yet (beats the striped row colour) */
.gridView.striped tbody tr.seoChanged {
    background-color: #FFF3CD;
}
