/* OpoCore admin — modern look, scoped under .adminContext so it never bleeds
   into the public site (which uses site.css and mirrors the legacy design).
   All sizes in rem; admin root font-size = 0.75rem (= 12px). */

.adminContext { font-size: 0.75rem; font-family: Arial, sans-serif; direction: rtl; color: #2b2b2b; }
.adminContext .screen { padding: 2rem; max-width: 90rem; }
.adminContext a { color: #0097f1; text-decoration: none; }
.adminContext a:hover { text-decoration: underline; }
.adminContext h1 { color: #001b46; margin: 0 0 1.5rem 0; font-size: 2.2rem; }
.adminContext h2 { color: #465c74; margin: 2rem 0 1rem 0; font-size: 1.6rem; }
.adminContext h3 { color: #465c74; margin: 1.5rem 0 0.5rem 0; font-size: 1.3rem; }

/* admin landing cards */
.adminContext .adminCards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem;
}
.adminContext .adminCards input[type=button] {
    padding: 1.5rem;
    background: white;
    border: none;
    border-radius: 0.3rem;
    box-shadow: 0 0.1rem 0.4rem rgba(0,0,0,0.08);
    font-size: 1.2rem;
    cursor: pointer;
    color: #001b46;
}
.adminContext .adminCards input[type=button]:hover { background: #0097f0; color: white; }

/* login form */
.adminContext .loginForm {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem 2rem;
    max-width: 40rem;
}
.adminContext .loginForm label { display: flex; flex-direction: column; font-size: 1rem; color: #465c74; }
.adminContext .loginForm input[type=text], .adminContext .loginForm input[type=password] {
    font: inherit; padding: 0.6rem; border: 0.08rem solid #c3c8cf; border-radius: 0.3rem; background: white; margin-top: 0.3rem;
}
/* non-Hebrew fields (username, password) are typed LTR */
.adminContext .loginForm input[type=text], .adminContext .loginForm input[type=password] {
    direction: ltr; text-align: left;
}
.adminContext input[type=button].primary {
    background-color: #0097f0; color: white;
    padding: 0.8rem 2rem; border: none; cursor: pointer;
    margin-top: 1rem; border-radius: 0.3rem; font-size: 1.1rem;
    grid-column: 1 / -1; justify-self: start;
}
.adminContext input[type=button].primary:hover { background-color: #007ac3; }

/* TableMakerEx rendering */
.adminContext .table {
    background-color: #465c74;
    width: 96%;
    margin: 1rem auto;
    color: white;
    padding-top: 2rem;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}
.adminContext .table > label { margin-right: 1rem; height: 2rem; font-size: 2rem; }
.adminContext .table > svg { vertical-align: top; filter: invert(1); margin-right: 1rem; }
.adminContext table { background-color: white; border: none; width: 100%; margin-top: 2rem; color: black; cursor: default; }
.adminContext th { color: #0097f1; border-bottom: 0.08rem solid #dfe5e9; font-weight: bold; padding-right: 2.5rem; }
.adminContext td, .adminContext th { text-align: right; border-bottom: 0.08rem solid #dfe5e9; padding: 1rem; }
.adminContext .addButton {
    font-size: 2rem; font-weight: bold;
    width: 2.5rem; height: 2.5rem; border-radius: 2.5rem;
    text-align: center; border: none; margin-right: 1rem; cursor: pointer;
}
.adminContext #toolbar {
    position: absolute; top: 6.6rem;
    background-color: white;
    box-shadow: 0 0.25rem 0.75rem rgba(0,0,0,.5);
    color: #0097f1; font-size: 1.2rem; font-weight: bold;
}
.adminContext #toolbar > div { padding: 0.6rem 1.2rem; cursor: pointer; }
.adminContext #toolbar > div:hover { background-color: #a0a0a0; }

/* form popups */
.adminContext .overlay {
    position: fixed; left: 0; top: 0;
    background-color: black; opacity: 0.3;
    width: 100vw; height: 100vh;
}
.adminContext .popupPanel {
    position: fixed;
    left: calc(50% - 20rem); top: 20%; width: 40rem; font-size: 2rem; text-align: center;
    max-height: 90vh; overflow-y: auto;
    background: white; border: 0.08rem solid #e3e9ed; padding: 1%;
    z-index: 100;
}
.adminContext .popupPanel > input { display: none; }
.adminContext #popUpQuestion input { display: inline-block; }
.adminContext #popUpQuestion input[type=button] {
    background-color: #0097f0; color: white;
    padding: 1rem; border: none; cursor: pointer;
    margin: 0.2rem; border-radius: 0.3rem;
}
.adminContext .pager { font-size: 1.5rem; display: block; margin: 0.6rem auto; text-align: center; }
.adminContext .pager > span { cursor: pointer; }
.adminContext .pager > span > input { width: 4rem; text-align: center; }

/* Full-screen admin mode: the admin nav bar (.adminBar) is injected by App.AdminTable
   into every admin screen; its presence hides the public chrome and stretches the
   work area to the whole viewport. Login (no bar) keeps the public chrome. */
body:has(.adminBar) { background: #eef1f4; }
body:has(.adminBar) header,
body:has(.adminBar) aside,
body:has(.adminBar) footer { display: none; }
body:has(.adminBar) #mainDiv { max-width: none; width: 100%; padding: 0; }
body:has(.adminBar) #content { width: 100%; float: none; }

/* admin top navigation bar */
.adminContext .adminBar {
    display: flex; align-items: center; gap: 0.2rem; flex-wrap: wrap;
    background: #001b46; padding: 0.5rem 1.5rem;
}
.adminContext .adminBar .adminBarTitle {
    color: white; font-size: 1.3rem; font-weight: bold;
    margin-left: 1.5rem; cursor: pointer;
}
.adminContext .adminBar input[type=button] {
    background: transparent; color: white; border: none; cursor: pointer;
    font-size: 1.1rem; padding: 0.5rem 1rem; border-radius: 0.3rem;
}
.adminContext .adminBar input[type=button]:hover { background: #0097f0; }
.adminContext .adminBar input[type=button].toSite { margin-right: auto; }

/* HTML page editor (Monaco + live preview) */
.adminContext .editorScreen { max-width: none; }
.adminContext .editorToolbar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }
.adminContext .editorToolbar input[type=button] {
    background: white; color: #001b46;
    padding: 0.8rem 1.5rem; border: none; cursor: pointer;
    border-radius: 0.3rem; font-size: 1.1rem;
    box-shadow: 0 0.1rem 0.4rem rgba(0,0,0,0.08);
}
.adminContext .editorToolbar input[type=button]:hover { background: #0097f0; color: white; }
.adminContext .editorToolbar input[type=button].primary { background: #0097f0; color: white; margin: 0; }
.adminContext .editorToolbar input[type=button].primary:hover { background: #007ac3; }
.adminContext .editorToolbar label { font-size: 1rem; color: #465c74; }
.adminContext .editorToolbar label:last-of-type { margin-right: auto; }
.adminContext .editorToolbar select { font: inherit; padding: 0.3rem; margin-right: 0.5rem; }
.adminContext .editorToolbar .editPageNameLabel input {
    font: inherit; font-size: 1.2rem; padding: 0.5rem; margin-right: 0.5rem;
    border: 0.08rem solid #c3c8cf; border-radius: 0.3rem; width: 20rem;
}
.adminContext .editorSplit { display: flex; gap: 0.5rem; height: 78vh; }
.adminContext .editorSplit #monacoFrame { flex: 1; min-width: 0; border: 0.08rem solid #c3c8cf; }
.adminContext .editorSplit #previewFrame { display: none; }
.adminContext .editorSplit.withPreview #previewFrame {
    display: block; width: 45%; border: 0.08rem solid #c3c8cf; background: white;
}

/* The popup/overlay markup (#formDiv, .overlay, .popupPanel) is appended to <body>,
   NOT inside .adminContext — these rules are intentionally unprefixed. */
.overlay { position: fixed; left: 0; top: 0; background: black; opacity: 0.3; width: 100vw; height: 100vh; z-index: 99; }
#formDiv {
    position: fixed;
    left: 18%; top: 5%;
    width: 60%; max-height: 90vh; overflow-y: auto;
    background: white; border: 0.08rem solid #e3e9ed; padding: 1%;
    z-index: 100;
    direction: rtl;
}
#formDiv > label, #formDiv label + input { display: inline-block; height: 2rem; width: 40%; border: none; }
#formDiv label + input { border-bottom: 0.17rem solid #dae0e4; }
#formDiv > input[type=button] {
    background-color: #0097f0; color: white;
    padding: 1rem; border: none; cursor: pointer;
    margin: 0.2rem; border-radius: 0.3rem;
}
/* non-Hebrew fields in admin forms (email, URL, phone, image paths) are typed LTR */
#formDiv input[id*="Email"], #formDiv input[id*="Url"], #formDiv input[id*="Phone"],
#formDiv input[id*="Logo"], #formDiv input[id*="Image"] {
    direction: ltr; text-align: left;
}
.popupPanel {
    position: fixed; left: calc(50% - 20rem); top: 20%; width: 40rem;
    background: white; border: 1px solid #e3e9ed; padding: 1rem; z-index: 100;
    font-size: 2rem; text-align: center;
}
.popupPanel input[type=button] {
    background-color: #0097f0; color: white;
    padding: 0.5rem 1.2rem; border: none; cursor: pointer;
    border-radius: 0.3rem; font-size: 1rem; margin-top: 1rem;
}
