﻿/*
core.css
Structure:
  - Root variables and global resets
  - Inputs, selects, controls
  - Buttons
  - Login layout
  - Banner + popups
  - Alerts
  - Language/profile dropdown
  - Animations + bottom info
  - Checkbox styling
  - Misc (two-factor pin)
Notes:
  - Prefer utility classes for minor spacing; avoid inline styles.
  - Add new component styles as base + modifier classes when possible.
*/
/* ===== CSS Custom Properties =====
   Global theme variables used across admin + core.
   Override in brand themes if needed. */
:root {
    --bean-height: 100vh;
    --menu-width: 30px;
    --tab-height: 0px;
    --button-toggle-active: #aaaaaa;
    --form-control-color: #2222aa;
    --form-control-toggle: #22aa22;
    --form-control-disabled: #999999;
    --form-control-disabled-back: #eeeeee;
    --search-back: #f8f8ff;
    --menu-back-color: #111133;
    --menu-select-color: #222288;
    --menu-hover-color: #222266;
    --menu-line-color: #222266;
    --button-color: #2222dd;
    --lightmenu-select-color: #f0f0f8;
    --lightmenu-hover-color: #f0f0f0;
    --input-outline-color: #999999;
}


/* ===== Touch overscroll fixes (iOS Safari et al.) ===== */
@media screen and (pointer: coarse) {
    @supports (-webkit-backdrop-filter: blur(1px)) and (overscroll-behavior-y: none)  {
        html {
            min-height: calc(100% + 1px);
            overscroll-behavior-y: none;
        }
    }
}

/* Variant for environments without overscroll-behavior support */
@media screen and (pointer: coarse) {
    @supports (-webkit-backdrop-filter: blur(1px)) and (not (overscroll-behavior-y: none))  {
        html {
            height: 100%;
            overflow: hidden;
        }
        body {
            margin: 0px;
            max-height: 100%; 
            overflow: auto;
            -webkit-overflow-scrolling: touch;
        }
      
    }
}


/* ===== Global page baseline ===== */
body {
    background-color: #f8f8f8;
    margin: 0px;
    font-size: 0.8em;
    font-family: Poppins-Medium, Helvetica, Arial, sans-serif;
    height: 100%;
    width: 100%;
    overflow: hidden;
    overscroll-behavior-y: none;
}

input:focus, textarea:focus, select:focus {
    outline: 1px solid var(--input-outline-color);
}

/* ===== Form controls (textual) =====
   Normalize look across browsers; used in both list/edit views. */
input[type=text], input[type=time], input[type=email], input[type=tel], input[type=number], input[type=month], input[type=password], input[type=date], input[type=file], textarea, input[type=datetime-local], .editBox {
    border: 1px solid #dddddd;
    font-family: Poppins-Light, Arial, sans-serif;
    -webkit-appearance: none;
    border-radius: 4px;
    overflow: hidden;
    height: 16px;
    font-size: 0.8rem;
}

/* Disabled state */
input[type=text]:disabled, input[type=time]:disabled, input[type=email]:disabled, input[type=tel]:disabled, input[type=number]:disabled, input[type=month]:disabled, input[type=password]:disabled, input[type=date]:disabled, input[type=file]:disabled, textarea:disabled, input[type=datetime-local]:disabled, select:disabled {
    color: var(--form-control-disabled);
    background-color: var(--form-control-disabled-back) !important;
}

/* Native select baseline */
select {
    border: 1px solid #dddddd;
    font-family: Poppins-Light, Arial, sans-serif;
    -webkit-appearance: menulist;
    border-radius: 4px;
    overflow: hidden;
    height: 24px;
    font-size: 0.9rem;
}

/* Legacy checkbox radius reset (overridden below by custom) */
input[type=checkbox] {
    border-radius: 0;
}

/* Default input spacing */
input {
    padding: 3px;
    margin-top: 5px;
}

/* Override height for some UAs */
select {
    height: 23px;
}

/* Textarea font */
textarea {
    font-family: Arial, sans-serif;
}

/* ===== Buttons (core) =====
   Base button system used across the app. */
input[type=button], .btn, .btn_icon {
    all: unset;
    margin-top: 5px;
    padding: 0px;
    background-color: #ffffff;
    border: 0.5px solid var(--button-color);
    color: var(--button-color);
    text-align: center;
    height: 24px;
    padding-left: 10px;
    padding-right: 10px;
    --button-font-size: 0.65rem;
    --button-icon-font-size: 24px;
    --button-icon-top-margin: 0px;
    --button-icon-left-margin: 0px;
    font-size: var(--button-font-size);
    letter-spacing: 0.02rem;
    font-weight: 600;
    width: 140px;
    text-transform: uppercase;
    font-family: Poppins-Regular, Tahoma, Geneva, Verdana, sans-serif;
    -webkit-appearance: none;
    border-radius: 4px;
    overflow: hidden;
    text-shadow: none;
}

/* Icon-only button variant */
.btn_icon {
    padding-left: 1px !important;
    padding-right: 4px !important;
    --button-icon-font-size: 18px;
    --button-icon-top-margin: 2px;
    --button-icon-left-margin: 2px;
    width: 19px;
    height: 24px; 
}



.btn_icon i {
    font-size: var(--button-icon-font-size);
    margin-top: var(--button-icon-top-margin);
    margin-left: var(--button-icon-left-margin);
}

/* Hover feedback */
input[type=button]:hover:enabled, .btn:hover:enabled, .btn_icon:hover:enabled {
    background-color: #f8f8ff;
    border: 0.5px solid var(--form-control-color);
}

/* Active feedback (press) */
input[type=button]:active:enabled, .btn:active:enabled, .btn:active:enabled div, .btn_icon:active:enabled {
    --button-font-size: 0.70rem;
    --button-icon-font-size: 20px;
    --button-icon-top-margin: 1px;
    --button-icon-left-margin: 1px;
}

/* Slight nudge to center icon when active */
.btn_icon:active:enabled {
    padding-left: 0px !important;
    padding-right: 5px !important;
}

/* Disabled button state */
input[type=button]:disabled {
    border: 0.5px solid #999999;
    color: #999999;
}


/* ===== Login: Error message ===== */
#login_error {
    color: #ff0000;
    font-size: 0.7rem;
    margin-bottom: 10px;
    height: 15px;
    /* from later duplicate rule */
    padding-left: 40px;
    margin-top: 10px;
}

/* Login inputs width */
#login_area input[type=email], #login_area input[type=password], input[type=text] {
    width: 310px;
    margin-bottom: 10px;
}

/* Login action button */
#login_area input[type=button] {
    width: 298px;
    margin-top: 10px;
    margin-bottom: 5px;
}

/* Small helper link in login form */
#login_password_reset {
    margin-right: 40px;
    font-size: 0.6rem;
}


/* Login logo */
#login_logo img {
    width: 200px;
    padding: 5px;
    padding-left: 25px;
}

/* Logo wrapper spacing */
#login_logo {
    padding: 10px;
}

/* Login footer area */
#login_footer {
    margin-top: 20px;
    padding-left: 40px;
}

/* (removed duplicate #login_error; merged into the main rule above) */

/* Login method tabs (inactive + active) */
.login_tab, .login_tab_selected {
    display: inline-block;
    padding: 5px;
    background-color: #e8e8e8;
    font-weight: normal;
    cursor: default;
    margin-left: 10px;
    min-width: 60px;
    border-top: 1px solid #dddddd;
    border-left: 1px solid #dddddd;
    border-right: 1px solid #dddddd;
    color: #666666;
    font-size: 0.75rem;
    height: 14px;
    border-top-left-radius: 4px;
    border-top-right-radius: 4px;
    white-space: nowrap;
}

/* Hover to preview selection */
.login_tab:hover {
    background-color: #ffffff;
}

/* Active tab state */
.login_tab_selected {
    background-color: #ffffff;
    font-weight: bold;
    border-top: 2px solid #333333;
}

/* Login root scroll area (page height) */
#login_area {
    height: calc(var(--bean-height) - 100px);
    display: none;
    padding-top: 50px;
    overflow-y: auto;
}

/* Login card */
#login_area_prompt {
    background-color: #ffffff;
    margin: 0 auto;
    width: 400px;
    height: 450px;
    box-shadow: 5px 5px 10px #999999;
    border-radius: 10px;
}

/* Per-login-type content area */
.login_type_area {
    background-color: #ffffff;
    padding: 10px;
    display: none;
    height: 200px;
    padding-top: 0px;
    display: none;
}

/* Container for the tab strip */
#login_tabs {
    display: none;
    margin-bottom: 20px;
    border-bottom: 1px solid #dddddd;
    height: 25px;
    margin-top: 10px;
}


/* ===== Links ===== */
a {
    text-decoration: none;
    color: var(--form-control-color);
}

a:hover {
    text-decoration: underline;
}


/* ===== Global banner/notice ===== */
#banner_area {
    z-index: 2000;
    display: none;
    width: 600px;
    height: 30px;
    left: calc(50% - 300px);
    box-shadow: 0px 5px 10px #999999;
    border-radius: 4px;
    background-color: #ffe400;
    position: absolute;
    top: 5px;
    margin: 0 auto;
    padding-left: 10px;
    padding-right: 10px;
}

/* Banner text (scrollable if overflow) */
#banner_text {
    margin: 7px;
    white-space: nowrap;
    height: 14px;
    width: 586px;
    margin-right: 20px;
}

/* Close affordance on banner */
#banner_close {
    all: unset;
    width: 12px;
    height: 15px;
    background-color: #a19003;
    color: #ffe400;
    padding-left: 5px;
    position: absolute;
    right: 0px;
    top: 0px;
    z-index: 1;
    cursor: default;
    font-size: 10px;
    border-top-right-radius: 4px;
    border-bottom-left-radius: 4px;
}

/* Darker on hover */
#banner_close:hover {
    background-color: #685d02;
}

/* ===== Modal backdrop (shared) ===== */
.popup_back {
    z-index: 3000;
    position: absolute;
    left: 0px;
    top: 0px;
    height: 100%;
    min-height: var(--bean-height);
    width: 100vw;
    background-color: rgba(0, 0, 0, .5);
    display: none;
}

/* Dedicated overlay area for alerts */
#alert_area {
    z-index: 5000;
}

/* Dedicated overlay area for loader */
#loader_area {
    z-index: 4000;
}
.elevated { z-index: 5000 !important; }

/* Profile/password errors */
#password_change_error, #profile_password_change_error {
    color: #ff0000;
    font-size: 0.8rem;
    height: 15px;
    margin-bottom: 10px;
}

/* Inputs inside alert modals */
.alert_box input {
    width: 300px;
    margin-bottom: 10px;
}

/* Button/select width inside alerts */
.alert_box input[type=button], .alert_box select {
    width: 288px;
}

/* Confirmation code input (monospace) */
.alert-confirm-input { margin-bottom: 10px; text-align: center; font-family: 'Courier New'; height: 40px; font-size: 30px; }
.block { display: block !important; }
.pad-top-20 { padding-top: 20px !important; }

/* Two-factor QR */
.qr-area { width: 150px; height: 150px; overflow: hidden; margin: 0 auto; display: block; }
.qr-img { width: 150px; position: relative; top: 0; left: 0; }

/* ===== Alert modal card ===== */
.alert_box {
    background-color: #ffffff;
    margin: 0 auto;
    margin-top: 100px;
    width: 330px;
    height: 145px;
    box-shadow: 5px 5px 10px #666666;
    border-radius: 10px;
}

/* Inner content padding */
#alert_content {
    width: 330px;
    padding: 10px;
}

/* Optional title bar (hidden by default) */
#alert_headline {
    width: 330px;
    height: 20px;
    overflow: auto;
    padding-top: 5px;
    background-color: var(--form-control-color);
    font-weight: bold;
    font-size: 0.85rem;
    color: #ffffff;
    text-align: center;
    border-radius: 10px 10px 0px 0px;
    display: none;
}

/* Body text area */
#alert_text {
    width: 306px;
    height: 80px;
    overflow: auto;
    margin-bottom: 10px;
    padding: 2px;
}

/* Primary action in alert */
.alert_box .alert_button_change {
    background-color: #333333;
    border: 0.5px solid #333333;
    color: #ffffff;
}

/* Hover feedback for primary */
.alert_box .alert_button_change:hover {
    background-color: #111111 !important;
    border: 0.5px solid #111111;
    color: #ffffff;
}

/* Secondary/cancel action in alert */
.alert_box .password_change_cancel {
    background-color: #eeeeee;
    border: 0.5px solid #cccccc;
    color: #333333;
}
.alert_box .password_change_cancel:hover {
    background-color: #dddddd !important;
    border: 0.5px solid #bbbbbb;
}

/* Destructive action in alert */
.alert_box .alert_button_delete {
    background-color: #ff2222;
    border: 0.5px solid #ff2222;
    color: #ffffff;
}

/* Hover feedback for destructive */
.alert_box .alert_button_delete:hover {
    background-color: #dd2222 !important;
    border: 0.5px solid #dd2222 !important;
    color: #ffffff;
}

/* ===== Loader container ===== */
.loader_box {
    margin: 0 auto;
    margin-top: 150px;
    padding: 10px;
    width: 50px;
    height: 50px;
    background-color: #ffffff;
    box-shadow: 5px 5px 10px #666666;
    border-radius: 10px;

}

/* Circular spinner */
.loader {
    margin: 0 auto;
    border: 4px solid #7777ff;
    border-radius: 50%;
    border-top: 4px solid var(--form-control-color);
    width: 30px;
    height: 30px;
    -webkit-animation: spin 2s linear infinite; /* Safari */
    animation: spin 2s linear infinite;
    margin-top: 6px;
}

/* Generic spin animation hook */
.spinner {
    margin: 0 auto;
    -webkit-animation: spin 2s linear infinite; /* Safari */
    animation: spin 2s linear infinite;
}

/* ===== Top-right menu toggles ===== */
#language_select, #profile_select, #chat_select {
    margin-right: 20px;
    display: none;
}

/* Icons for top-right toggles */
#language_select i, #profile_select i, #chat_select i {
    font-size: 20px;
    padding: 2px;
    color: #dddddd;
    cursor: default;
}

/* Hover color */
#language_select i:hover, #profile_select i:hover, #chat_select i:hover {
    color: #ffffff;
}

/* Active size bump */
#language_select i:active, #profile_select i:active, #chat_selecti:active {
    color: #ffffff;
    font-size: 22px;
    padding: 0px;
}

/* Dropdown menu panel (language/profile) */
#select_drop {
    width: 150px;
    background-color: #000000;
    z-index: 100;
    height: 100px;
    position: relative;
    top: 25px;
    left: 80px;
    display: none;
    overflow: hidden;
    overflow-y: auto;
}

/* Row inside dropdown panel */
#select_drop div {
    color: #dddddd;
    width: 140px;
    height: 22px;
    padding-left: 10px;
    padding-top: 8px;
    border-top: 1px solid #333333;
    text-decoration: none;
    text-transform: uppercase;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 0.65rem;
    cursor: default;
}

#select_drop div:hover {
    color: #ffffff;
}

/* ===== Spin keyframes (Safari) ===== */
@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
    }

    100% {
        -webkit-transform: rotate(360deg);
    }
}

/* ===== Spin keyframes ===== */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ===== Bottom info label ===== */
#bottom_item_info {
    visibility: hidden;
    margin-left: 5px;
    cursor: default;
}

#bottom_item_info:hover {
    color: #ffffff;
}

/* ===== Custom checkbox layout ===== */
.area_checklabel {
    display: grid;
    grid-template-columns: 1em auto;
    gap: 0.5em;
    margin-bottom: 10px;
}


/* ===== Custom checkbox (accessible) =====
   Replaces native appearance; integrates with --form-control-toggle. */
input[type="checkbox"] {
    /* Add if not using autoprefixer */
    -webkit-appearance: none;
    /* Remove most all native input styles */
    appearance: none;
    /* For iOS < 15 */
    background-color: var(--form-background);
    /* Not removed via appearance */
    margin: 0;
    font: inherit;
    color: currentColor;
    width: 1.15em;
    height: 1.15em;
    border: 1px solid #dddddd;
    border-radius: 4px;
    transform: translateY(-0.075em);
    display: grid;
    place-content: center;
}

input[type="checkbox"]::before {
    content: "";
    width: 0.65em;
    height: 0.65em;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
    transform: scale(0);
    transform-origin: bottom left;
    transition: 120ms transform ease-in-out;
    box-shadow: inset 1em 1em var(--form-control-toggle);
    /* Windows High Contrast Mode */
    background-color: CanvasText;
}

/* Show checkmark when checked */
input[type="checkbox"]:checked::before {
    transform: scale(1);
}

/* Focus ring */
input[type="checkbox"]:focus {
    outline: max(2px, 0.15em) solid currentColor;
    outline-offset: max(2px, 0.15em);
}

/* Disabled checkbox */
input[type="checkbox"]:disabled {
    --form-control-color: var(--form-control-disabled);
    color: var(--form-control-disabled);
    cursor: not-allowed;
}

/* Hidden scratch area used by JS for measurements/temp DOM */
#custom_area {
    width: 0px;
    height: 0px;
}

/* ===== Two-factor PIN input styling ===== */
.twoFaPin {
    height: 60px !important;
    letter-spacing: 20px !important;
    font-size: 50px !important;
    font-family: Courier New !important;
    padding-left: 10px !important;
    width: 304px !important;
}

/* ===== Cookie consent ===== */
.cookie-box { position: fixed; z-index: 20000; bottom: 50px; width: 60vw; left: 20vw; height: 80px; display: flex; min-width: 400px }
.cookie-text { display: inline-block; width: calc(100% - 230px); margin: 20px; padding-top: 4px; }
.cookie-buttons { display: inline-block; width: 150px; margin-top: 20px; }
input.cookie-accept[type=button] { width: 150px; }