/* ==========================================================================
   United Methodist Church LMS - local_umc interface styles.

   These rules style the one-click appearance (theme) picker and the
   progressive web app install button.  They live in the plugin rather than
   in a theme so that they keep working on every theme the user can pick -
   including Boost, Moove, Adaptable and Snap.
   ========================================================================== */

/* ------------------------------------------------------ Appearance picker -- */
.umc-video-embed { position:relative; width:100%; aspect-ratio:16/9; margin:1rem 0; background:#142f3c; border-radius:.75rem; overflow:hidden; }
.umc-video-embed iframe { position:absolute; inset:0; width:100%; height:100%; border:0; }
.umc-support-widget { position:fixed; right:1.1rem; bottom:4.8rem; z-index:1040; }
.umc-support-toggle { background:#198754; color:#fff; border:0; border-radius:2rem; padding:.7rem 1rem; font-weight:700; box-shadow:0 6px 24px #143d3c33; }
#umc-support-panel { position:absolute; right:0; bottom:calc(100% + .5rem); width:min(400px,calc(100vw - 2rem)); background:#fff; border:1px solid #dce6e3; border-radius:1rem; box-shadow:0 12px 36px #142f3c33; padding:1rem; max-height:calc(100dvh - 140px); overflow:auto; color:#23282b; }
#umc-support-panel[hidden] { display:none; }
.umc-support-heading { display:flex; justify-content:space-between; font-weight:700; margin-bottom:.75rem; }
.umc-support-close { background:transparent; border:0; font-size:1.3rem; }
#umc-support-panel iframe { width:100%; height:360px; border:0; }
.umc-chat-history { max-height:310px; overflow:auto; padding:.5rem 0; }
.umc-chat-message { background:#f1f7f4; padding:.7rem; margin-bottom:.5rem; border-radius:.5rem; overflow-wrap:anywhere; }
.umc-chat-message small { display:block; color:#53615d; }
.umc-chat-message p { margin:.4rem 0 0; }
.umc-appearance {
    position: fixed;
    right: 1.1rem;
    bottom: 1.1rem;
    z-index: 1050;
    font-family: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont,
        "Helvetica Neue", Arial, sans-serif;
}

.umc-appearance-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .62rem 1.05rem;
    border: none;
    border-radius: 999px;
    background: #14464d;
    color: #fff;
    font-weight: 700;
    font-size: .88rem;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(20, 70, 77, .3);
    transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}

.umc-appearance-toggle:hover,
.umc-appearance-toggle:focus-visible {
    transform: translateY(-2px);
    background: #126b72;
    box-shadow: 0 14px 32px rgba(20, 70, 77, .35);
    color: #fff;
}

.umc-appearance-toggle:focus-visible {
    outline: 3px solid #c9a227;
    outline-offset: 2px;
}

.umc-appearance-toggle .fa {
    color: #e2c87a;
}

.umc-appearance-toggle-text {
    white-space: nowrap;
}

.umc-appearance-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + .6rem);
    width: min(340px, calc(100vw - 2.2rem));
    max-height: min(70vh, 460px);
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2ded9;
    border-radius: .85rem;
    box-shadow: 0 18px 44px rgba(26, 26, 26, .18);
    padding: .85rem;
    text-align: left;
}

.umc-appearance-head {
    display: flex;
    flex-direction: column;
    gap: .15rem;
    padding: .1rem .2rem .6rem;
    border-bottom: 1px solid #e2ded9;
    margin-bottom: .5rem;
}

.umc-appearance-title {
    font-weight: 700;
    color: #1a1a1a;
    font-size: .95rem;
}

.umc-appearance-current {
    font-size: .78rem;
    color: #4a4f54;
}

.umc-appearance-current strong {
    color: #14464d;
}

.umc-appearance-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .35rem;
}

.umc-appearance-item {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .55rem .6rem;
    border: 1px solid #e2ded9;
    border-radius: .6rem;
    cursor: pointer;
    background: #fff;
    transition: border-color .16s ease, background-color .16s ease;
}

.umc-appearance-item:hover {
    border-color: #126b72;
    background: #f7f6f4;
}

.umc-appearance-item.is-active {
    border-color: #126b72;
    background: #f7f6f4;
}

.umc-appearance-item:focus-visible {
    outline: 3px solid #c9a227;
    outline-offset: 1px;
}

.umc-swatch {
    display: inline-flex;
    flex: 0 0 auto;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(26, 26, 26, .12);
}

.umc-swatch-colour {
    display: block;
    width: 14px;
    height: 28px;
}

.umc-appearance-text {
    display: flex;
    flex-direction: column;
    gap: .1rem;
    min-width: 0;
}

.umc-appearance-name {
    font-weight: 600;
    font-size: .87rem;
    color: #1a1a1a;
}

.umc-appearance-desc {
    font-size: .76rem;
    line-height: 1.35;
    color: #4a4f54;
}

.umc-appearance-check {
    margin-left: auto;
    color: #14464d;
    opacity: 0;
}

.umc-appearance-item.is-active .umc-appearance-check {
    opacity: 1;
}

.umc-appearance-status {
    margin: .5rem .2rem 0;
    font-size: .78rem;
    color: #4a4f54;
    min-height: 1.1em;
}

.umc-appearance.is-busy .umc-appearance-toggle {
    opacity: .65;
    pointer-events: none;
}

/* -------------------------------------------------------- PWA install ---- */
.umc-pwa-install {
    position: fixed;
    left: 1.1rem;
    bottom: 1.1rem;
    z-index: 1050;
    display: none;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    border-radius: 999px;
    background: #c9a227;
    color: #1a1a1a;
    font-weight: 700;
    font-size: .85rem;
    border: none;
    box-shadow: 0 10px 26px rgba(26, 26, 26, .28);
    font-family: "Avenir Next", "Segoe UI", -apple-system, BlinkMacSystemFont,
        "Helvetica Neue", Arial, sans-serif;
}

.umc-pwa-install.show,
.umc-pwa-install:not([hidden]) {
    display: inline-flex;
}

.umc-pwa-install-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.umc-pwa-install-btn:focus-visible {
    outline: 3px solid #1a1a1a;
    outline-offset: 2px;
    border-radius: 4px;
}

.umc-pwa-install-hint {
    font-weight: 500;
    font-size: .76rem;
    max-width: 15rem;
    display: none;
}

.umc-pwa-install-hint.is-visible {
    display: inline;
}

/* -------------------------------------------------------- Small screens -- */
@media (max-width: 576px) {
    .umc-appearance {
        right: .75rem;
        bottom: .75rem;
    }

    .umc-appearance-toggle-text {
        display: none;
    }

    .umc-pwa-install {
        left: .75rem;
        bottom: .75rem;
    }
}
