/* Core UI components: system messages, dialogs and the Modal script. Override them in a theme stylesheet, which loads after this one. */
/* Messages */
/* System message styling for #sysmsg to match .sysMessage */

svg.error {
    color: #b90e1f;
}

svg.success {
    color: #008000;
}

svg.info {
    color: #3094ff;
}

#sysmsg {
    font-size: 1rem;
    line-height: 1.5rem;
    margin-bottom: 1em;
    padding: 0 30px;
    color: white;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: flex-start;
    background: #bebebe;
}

#sysmsg small.margin-left-2 {
    margin-left: 0;
}

#sysmsg small.margin-left-2+sysdots {
    margin-left: -15px;
}

#sysmsg small,
#sysmsg .sysmsg-countdown,
#sysmsg sysdots {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;
}

#sysmsg .sysmsg-countdown {
    display: inline;
}

#sysmsg .sysmsg-update-wrapper,
.modal-sysmsg .sysmsg-update-wrapper {
    width: 100%;
    text-transform: none;
}

#sysmsg .sysmsg-update-title,
.modal-sysmsg .sysmsg-update-title {
    margin-bottom: 0.6em;
    font-weight: 700;
}

#sysmsg .sysmsg-update-health,
.modal-sysmsg .sysmsg-update-health {
    margin: 0.4em 0 0.9em;
    padding: 0.45em 0.6em;
    background: rgba(255, 255, 255, 0.14);
    border-radius: 4px;
}

#sysmsg .sysmsg-update-details,
.modal-sysmsg .sysmsg-update-details {
    margin-top: 0.35em;
}

#sysmsg .sysmsg-update-section,
.modal-sysmsg .sysmsg-update-section {
    margin-top: 0.8em;
    padding-top: 0.75em;
    border-top: 1px solid rgba(255, 255, 255, 0.35);
}

#sysmsg .sysmsg-update-summary,
.modal-sysmsg .sysmsg-update-summary {
    margin: 0.25em 0 0.45em;
    font-weight: 600;
}

#sysmsg .sysmsg-update-lines,
.modal-sysmsg .sysmsg-update-lines {
    margin-top: 0.3em;
}

#sysmsg.error {
    border: 2px solid #b90e1f;
    background-color: #b90e1f;
    padding: 6px 30px;
}

#sysmsg.success {
    border: 2px solid #008000;
    background-color: #008000;
    padding: 6px 30px;
}

#sysmsg.info {
    border: 2px solid #3094ff;
    background-color: #3094ff;
    padding: 6px 30px;
}

sysdots {
    margin-left: 0;
    padding: 0;
}

/* Modal system message styling */
.modal-sysmsg {
    font-size: 0.95rem;
    line-height: 1.4rem;
    margin-bottom: 1em;
    color: white;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-start;
    border-radius: 4px;
    background: #bebebe;
}

.modal-sysmsg.error {
    border: 2px solid #b90e1f;
    background-color: #b90e1f;
    padding: 10px 15px;
}

.modal-sysmsg.success {
    border: 2px solid #008000;
    background-color: #008000;
    padding: 10px 15px;
}

.modal-sysmsg.info {
    border: 2px solid #3094ff;
    background-color: #3094ff;
    padding: 10px 15px;
}


/* html dialog */
dialog[open] {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px 20px;
    padding: 2em;
}

dialog .fa-circle-xmark {
    position: absolute;
    top: 0;
    right: 0;
    cursor: pointer;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* The Modal: this pertains to the Modal javascript class object created by ngn/js/modal.js */
.modal {
    position: fixed;
    /* Stay in place */
    z-index: 1000;
    /* Sit on top */
    padding-top: 1em;
    left: 0;
    top: 0;
    width: 100%;
    /* Full width */
    height: 100%;
    /* Full height */
    overflow: auto;
    background-color: rgb(0, 0, 0);
    /* Fallback color */
    background-color: rgba(0, 0, 0, 0.4);
    /* Black w/ opacity */
    display: flex;
    /* Flexbox to center the modal content */
    align-items: center;
    /* Align on cross axis */
    justify-content: center;
    /* Align on main axis */
}

/* Modal Content/Box */
.modal-content {
    /*background-color: #fff;*/
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 100%;
    max-height: 90%;
    /* Limit the height to 90% of the viewport */
    overflow-y: auto;
    /* Enable vertical scrolling within the modal content */
    margin: 10px 20px;
    /* Ensure some margin on smaller screens */

    /*background-color: transparent;
    padding: 12%;
    border: none;
    max-width: 500px;
    width: 100%; /* Could be more or less, depending on screen size */
    /*max-height: 90%;
    position: relative;
    display: flex;
    justify-content: center;*/

}

.modal-content img,
.modal-content p {
    width: 80%;
    height: auto;
    margin: 5% auto;
}



/* The Buttons */
.modalUI {
    color: #fff;
    font-size: 20px;
    font-weight: bold;
    position: absolute;
    padding: 6px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    display: flex;
    flex-direction: row-reverse;
    gap: 8px;
    z-index: 1002;
}

/* Default position for non-image modals */
.modal>.modalUI {
    top: 1em;
    right: 1em;
}

/* Position for image modals - relative to the image wrapper */
.modal-image-wrapper>.modalUI {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    bottom: auto !important;
}

.modalUI i {
    margin: 0;
}

.modalUI i:hover,
.modalUI i:focus {
    color: #aaa;
    text-decoration: none;
    cursor: pointer;
}

/** Modal Styles **/

.modal-content.dialog,
.modal-content.prompt,
.modal-content.alert,
.modal-content.confirm,
.modal-content.html {
    background-color: #fff;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    padding: 1em;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-content.image {
    max-width: 100vw !important;
    max-height: 100vh !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden !important;
    position: relative !important;
}

.modal-content.image img {
    max-width: calc(96vw - 2em) !important;
    max-height: calc(96vh - 2em) !important;
    width: auto !important;
    height: auto !important;
    margin: 1em !important;
    display: block !important;
    object-fit: contain !important;
    box-shadow: none !important;
    background: #fff !important;
}

/* Modal image centering and sizing */
.modal-content.image {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    /*background: #fff;*/
    width: 100vw;
    height: 100vh;
    box-sizing: border-box;
    overflow: auto;
}

/* Wrapper for image and its UI controls */
.modal-image-wrapper {
    position: relative;
    display: inline-block;
    margin: 0;
    padding: 0;
}

.modal-caption {
    width: 100%;
    text-align: center;
}

.modal-content .modal-caption p {
    margin-top: 0;
}

.modal-content.html {
    display: block;
    padding: 1em;
}

/* Modal JS Class ends */
