/* ============================================================
   Hotel Brown Palace — Admin / inline-editing UI
   Loaded on every editable page. Nothing here shows to a
   logged-out visitor except the (optional) login modal.
   ============================================================ */

:root {
    --hbp-admin-bar: 44px;
    --hbp-accent: #c9a24b;        /* warm gold, matches the hotel feel */
    --hbp-accent-dark: #a9842f;
    --hbp-ink: #1d2733;
    --hbp-ok: #2e9e6b;
    --hbp-err: #d9534f;
}

/* ---- Admin bar ---------------------------------------------------------- */
.hbp-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--hbp-admin-bar);
    background: linear-gradient(90deg, var(--hbp-ink) 0%, #2c3a4b 100%);
    color: #fff;
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 18px;
    font-family: 'Lato', 'Raleway', sans-serif;
    font-size: 13px;
    letter-spacing: .3px;
    box-shadow: 0 2px 14px rgba(0,0,0,.28);
    transform: translateY(-100%);
    transition: transform .35s cubic-bezier(.2,.7,.3,1);
}
.hbp-bar.is-visible { transform: translateY(0); }
body.hbp-admin { padding-top: var(--hbp-admin-bar); }
body.hbp-admin header.fixed.sticky,
body.hbp-admin header.fixed { margin-top: 0; }

.hbp-bar__brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; text-transform: uppercase; font-size: 12px;
}
.hbp-bar__brand i { color: var(--hbp-accent); }
.hbp-bar__status {
    display: flex; align-items: center; gap: 7px;
    color: #c7d0da; font-size: 12px;
}
.hbp-bar__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--hbp-ok); box-shadow: 0 0 0 3px rgba(46,158,107,.25);
}
.hbp-bar__spacer { flex: 1 1 auto; }
.hbp-bar__hint { color: #9fb0c0; font-size: 12px; }
.hbp-bar__hint b { color: var(--hbp-accent); font-weight: 700; }

.hbp-btn {
    appearance: none; border: 0; cursor: pointer;
    font: inherit; font-weight: 700; letter-spacing: .4px;
    padding: 7px 14px; border-radius: 4px;
    display: inline-flex; align-items: center; gap: 7px;
    transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
}
.hbp-btn:active { transform: translateY(1px); }
.hbp-btn--gold {
    background: linear-gradient(180deg, var(--hbp-accent) 0%, var(--hbp-accent-dark) 100%);
    color: #2a2208; box-shadow: 0 4px 12px rgba(201,162,75,.35);
}
.hbp-btn--gold:hover { box-shadow: 0 6px 18px rgba(201,162,75,.5); }
.hbp-btn--ghost {
    background: rgba(255,255,255,.08); color: #fff;
    border: 1px solid rgba(255,255,255,.18);
}
.hbp-btn--ghost:hover { background: rgba(255,255,255,.16); }

/* ---- Editable element affordances (admin only) -------------------------- */
body.hbp-admin [data-edit] { position: relative; }

body.hbp-admin [data-edit="image"] {
    outline: 2px dashed transparent;
    outline-offset: 3px;
    transition: outline-color .2s ease;
}
body.hbp-admin [data-edit="image"]:hover { outline-color: var(--hbp-accent); }

/* Overlay that appears over an editable image on hover */
.hbp-img-overlay {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(180deg, rgba(29,39,51,.1), rgba(29,39,51,.55));
    opacity: 0; transition: opacity .25s ease;
    z-index: 20; pointer-events: none;
    border-radius: inherit;
}
.hbp-edit-wrap:hover .hbp-img-overlay { opacity: 1; pointer-events: auto; }
.hbp-edit-wrap { position: relative; display: block; }

.hbp-change-btn {
    pointer-events: auto;
    background: rgba(255,255,255,.96); color: var(--hbp-ink);
    border: 0; border-radius: 40px; cursor: pointer;
    font-weight: 700; font-size: 13px; letter-spacing: .3px;
    padding: 10px 18px; display: inline-flex; align-items: center; gap: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
    transform: translateY(8px) scale(.96);
    transition: transform .25s cubic-bezier(.2,.8,.2,1), background .2s ease;
}
.hbp-edit-wrap:hover .hbp-change-btn { transform: translateY(0) scale(1); }
.hbp-change-btn:hover { background: var(--hbp-accent); color: #2a2208; }
.hbp-change-btn i { font-size: 15px; }

/* Editable text (rates) */
body.hbp-admin [data-edit="text"] {
    cursor: text;
    border-radius: 3px;
    transition: box-shadow .2s ease, background .2s ease;
}
body.hbp-admin [data-edit="text"]:hover {
    box-shadow: inset 0 0 0 2px var(--hbp-accent);
    background: rgba(201,162,75,.08);
}
body.hbp-admin [data-edit="text"].hbp-editing {
    box-shadow: inset 0 0 0 2px var(--hbp-accent-dark);
    background: #fffdf6; outline: none;
}
.hbp-edit-tag {
    position: absolute; top: -10px; right: -8px;
    width: 22px; height: 22px; border-radius: 50%;
    background: var(--hbp-accent); color: #2a2208;
    font-size: 11px; display: none; align-items: center; justify-content: center;
    box-shadow: 0 3px 8px rgba(0,0,0,.25); z-index: 15;
}
body.hbp-admin [data-edit]:hover > .hbp-edit-tag { display: flex; }

/* Image is busy uploading */
.hbp-edit-wrap.is-busy .hbp-img-overlay { opacity: 1; }
.hbp-spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
    animation: hbp-spin .8s linear infinite;
}
@keyframes hbp-spin { to { transform: rotate(360deg); } }

/* ---- Toasts ------------------------------------------------------------- */
.hbp-toasts {
    position: fixed; right: 18px; bottom: 18px;
    display: flex; flex-direction: column; gap: 10px;
    z-index: 100001;
}
.hbp-toast {
    background: #fff; color: var(--hbp-ink);
    border-left: 4px solid var(--hbp-ok);
    padding: 12px 16px; border-radius: 6px; min-width: 240px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    font-size: 14px; font-family: 'Lato', sans-serif;
    display: flex; align-items: center; gap: 10px;
    animation: hbp-toast-in .3s cubic-bezier(.2,.8,.2,1);
}
.hbp-toast.is-error { border-left-color: var(--hbp-err); }
.hbp-toast i { font-size: 16px; }
.hbp-toast.is-error i { color: var(--hbp-err); }
.hbp-toast:not(.is-error) i { color: var(--hbp-ok); }
@keyframes hbp-toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ---- Login modal -------------------------------------------------------- */
.hbp-modal {
    position: fixed; inset: 0; z-index: 100002;
    display: flex; align-items: center; justify-content: center;
    background: rgba(18,24,31,.6); backdrop-filter: blur(4px);
    opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s;
}
.hbp-modal.is-open { opacity: 1; visibility: visible; }
.hbp-card {
    background: #fff; width: 360px; max-width: calc(100vw - 32px);
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.4);
    transform: translateY(14px) scale(.98);
    transition: transform .3s cubic-bezier(.2,.8,.2,1);
    font-family: 'Lato', sans-serif;
}
.hbp-modal.is-open .hbp-card { transform: none; }
.hbp-card__head {
    background: linear-gradient(135deg, var(--hbp-ink), #2c3a4b);
    color: #fff; padding: 26px 26px 22px; text-align: center;
}
.hbp-card__head i { font-size: 26px; color: var(--hbp-accent); }
.hbp-card__head h3 { margin: 10px 0 2px; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.hbp-card__head p { margin: 0; color: #a9b7c5; font-size: 13px; }
.hbp-card__body { padding: 22px 26px 26px; }
.hbp-field { margin-bottom: 14px; }
.hbp-field label {
    display: block; font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .6px; color: #6b7785; margin-bottom: 6px;
}
.hbp-field input {
    width: 100%; padding: 11px 13px; font-size: 15px;
    border: 1.5px solid #dbe1e8; border-radius: 7px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.hbp-field input:focus {
    outline: none; border-color: var(--hbp-accent);
    box-shadow: 0 0 0 3px rgba(201,162,75,.18);
}
.hbp-card .hbp-btn--gold { width: 100%; justify-content: center; padding: 12px; font-size: 15px; margin-top: 4px; }
.hbp-card__error {
    color: var(--hbp-err); font-size: 13px; margin: 2px 0 12px;
    min-height: 16px; font-weight: 600;
}
.hbp-card__close {
    position: absolute; top: 14px; right: 16px; color: #fff;
    background: rgba(255,255,255,.12); border: 0; width: 30px; height: 30px;
    border-radius: 50%; cursor: pointer; font-size: 14px;
}

/* ---- Discreet staff-login trigger -------------------------------------- */
.hbp-login-link {
    cursor: pointer; opacity: .55; transition: opacity .2s ease, color .2s ease;
}
.hbp-login-link:hover { opacity: 1; color: var(--hbp-accent) !important; }

@media (max-width: 600px) {
    .hbp-bar { gap: 10px; padding: 0 10px; font-size: 12px; }
    .hbp-bar__hint, .hbp-bar__status span { display: none; }
}
