/*
 * App chrome: header, footer, Menu sheet and the role ring on profile photos.
 * Loaded after site.css on every page that uses app\assets\AssetBundle, so the
 * rules here win over the older ones in site.css.
 *
 * Tokens follow the directory home (dashboard.css): blue #0d6efd anchor, glass
 * surfaces, slate neutrals.
 */

/* ---- role ring on profile photos (app\widgets\ProfilePhoto) ----------------------------------
 * A white gap, then a ring whose colour is the person's role:
 *   area blue, region red, backkeeper gold, master black, head member green, anyone else grey.
 * Larger photos raise --ring-w. */
.role-ring {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 0 0 var(--ring-w, 3px) var(--ring, #cbd5e1);
    background: #fff;
}
.role-ring.is-area, .role-frame.is-area { --ring: #0d6efd; }
.role-ring.is-region, .role-frame.is-region { --ring: #dc3545; }
.role-ring.is-backkeeper, .role-frame.is-backkeeper { --ring: #d4a017; }
.role-ring.is-master, .role-frame.is-master { --ring: #111827; }
.role-ring.is-head, .role-frame.is-head { --ring: #16a34a; }
.role-ring.is-none, .role-frame.is-none { --ring: #cbd5e1; }

/* the profile page shows a full-width banner photo, so its "ring" is a frame */
.role-frame { border: 6px solid var(--ring, #cbd5e1); }

/* legend on the profile page */
.ring-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    justify-content: center;
    margin: 0.75rem 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.75rem;
    color: #64748b;
}
.ring-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }
.ring-legend li.is-own { color: #0f172a; font-weight: 700; }
.ring-legend i.swatch { width: 12px; height: 12px; border-radius: 50%; background: var(--ring); display: inline-block; }
.ring-legend .is-area { --ring: #0d6efd; }
.ring-legend .is-region { --ring: #dc3545; }
.ring-legend .is-backkeeper { --ring: #d4a017; }
.ring-legend .is-master { --ring: #111827; }
.ring-legend .is-head { --ring: #16a34a; }

/* ---- header (app/views/partials/header.php) --------------------------------------------------- */
.navbar.navbar-main {
    min-height: 60px;
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
    background: rgba(255, 255, 255, 0.84) !important;
    backdrop-filter: blur(14px) saturate(180%);
    -webkit-backdrop-filter: blur(14px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 6px 18px rgba(31, 38, 135, 0.08) !important;
}
.chrome-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 60px;
}
.chrome-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1 1 auto;
    min-width: 0;
    color: #0f172a;
    text-decoration: none;
}
.chrome-brand:hover { color: #0f172a; text-decoration: none; }
.chrome-logo {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
}
.chrome-brand-text { min-width: 0; line-height: 1.15; }
.chrome-brand-text b {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chrome-brand-text small { display: block; font-size: 0.68rem; font-weight: 500; color: #64748b; }

.lang-switch {
    flex: 0 0 auto;
    display: flex;
    padding: 3px;
    border-radius: 99px;
    background: rgba(15, 23, 42, 0.06);
}
.lang-pill {
    padding: 0.32rem 0.7rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    color: #64748b;
    text-decoration: none;
}
.lang-pill:hover { color: #0f172a; text-decoration: none; }
.lang-pill.is-on {
    background: #fff;
    color: #0d6efd;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.chrome-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 0.4rem; }
.chrome-actions .notif-bell-wrap { margin-right: 0; }
.chrome-actions .notif-bell-toggle {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.chrome-profile { display: inline-flex; align-items: center; margin: 0 4px 0 6px; text-decoration: none; }
.chrome-profile img { width: 40px; height: 40px; }

@media (max-width: 359px) {
    .chrome-brand-text small { display: none; }
    .lang-pill { padding: 0.3rem 0.55rem; }
}

/* ---- shared with the directory home: tone chips and the bottom sheet ---------------------------- */

/* The sheet and its lists live outside #dir-dashboard (footer Menu, report Add-filter sheet), so the
   tokens the shared rules use are defined here as well as on the dashboard. */
.dd-sheet {
    --dd-ink: #0f172a;
    --dd-mut: #64748b;
    --dd-line: rgba(15, 23, 42, 0.08);
    --dd-blue: #0d6efd;
    --dd-sky: #4d94ff;
}
.dd-list-go { color: #a3aec2; font-size: 0.7rem; }
/* ---- tone chips ------------------------------------------------------ */
.dd-chip-icon {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.dd-chip-icon.is-blue { background: rgba(13, 110, 253, 0.11); color: #0d6efd; }
.dd-chip-icon.is-teal { background: rgba(15, 157, 138, 0.12); color: #0f9d8a; }
.dd-chip-icon.is-amber { background: rgba(232, 137, 12, 0.13); color: #e8890c; }
.dd-chip-icon.is-indigo { background: rgba(79, 70, 229, 0.11); color: #4f46e5; }
.dd-chip-icon.is-rose { background: rgba(224, 69, 123, 0.11); color: #e0457b; }
.dd-chip-icon.is-slate { background: rgba(15, 23, 42, 0.07); color: var(--dd-ink); }

/* ---- Others bottom sheet ------------------------------------------------------------ */
.dd-sheet .modal-dialog {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    max-width: none;
    transform: translateY(100%);
    transition: transform 0.25s ease-out;
}
.dd-sheet.show .modal-dialog { transform: none; }
.dd-sheet .modal-content {
    border: 0;
    border-radius: 28px 28px 0 0;
    background: #f8faff;
    max-height: 85vh;
    padding: 0.6rem 1rem calc(1.2rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -14px 40px rgba(0, 0, 0, 0.25);
}
.dd-sheet-grab { width: 42px; height: 5px; border-radius: 5px; background: rgba(15, 23, 42, 0.18); margin: 0 auto 0.8rem; }
.dd-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.dd-sheet-head h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.dd-sheet-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--dd-ink);
}
.dd-sheet-body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dd-group-title {
    margin: 0.9rem 0.15rem 0.5rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--dd-mut);
    text-transform: uppercase;
    letter-spacing: 0.7px;
}
.dd-list { background: #fff; border: 1px solid var(--dd-line); border-radius: 18px; overflow: hidden; }
.dd-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.8rem;
    min-height: 52px;
    border-bottom: 1px solid var(--dd-line);
    color: var(--dd-ink);
    font-size: 0.88rem;
    font-weight: 600;
    text-decoration: none;
}
.dd-list-item:last-child { border-bottom: 0; }
.dd-list-item:hover { text-decoration: none; background: rgba(13, 110, 253, 0.04); color: var(--dd-ink); }
.dd-list-item .dd-chip-icon { width: 34px; height: 34px; border-radius: 11px; font-size: 0.85rem; }
.dd-list-label { flex: 1; min-width: 0; }


@media (min-width: 768px) {
    .dd-sheet .modal-dialog {
        left: 50%;
        right: auto;
        width: 520px;
        margin-left: -260px;
    }
}

/* ---- footer (app\widgets\BottomNav) ---------------------------------------------------------------- */
.mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1030;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    min-height: 68px;
    box-sizing: content-box;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 -8px 24px rgba(31, 38, 135, 0.1);
}
.mobile-bottom-nav .fb {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #7a8699;
    font-size: 0.66rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.mobile-bottom-nav .fb:hover { color: #7a8699; text-decoration: none; }
.mobile-bottom-nav .fb i {
    width: 48px;
    height: 30px;
    border-radius: 99px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
}
.mobile-bottom-nav .fb span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-bottom-nav .fb.is-on { color: #0d6efd; }
.mobile-bottom-nav .fb.is-on i { background: rgba(13, 110, 253, 0.11); }

/* the raised + Add button */
.mobile-bottom-nav .fb.fab { flex: 0 0 78px; color: #0d6efd; font-weight: 700; }
.mobile-bottom-nav .fb.fab:hover { color: #0d6efd; }
.mobile-bottom-nav .fb.fab i {
    width: 58px;
    height: 58px;
    margin-top: -30px;
    border-radius: 20px;
    background: linear-gradient(135deg, #0d6efd, #4d94ff);
    color: #fff;
    font-size: 1.4rem;
    border: 4px solid #f4f7fd;
    box-shadow: 0 12px 24px rgba(13, 110, 253, 0.5);
}
.mobile-bottom-nav .fb.fab.is-on i { background: linear-gradient(135deg, #0a58ca, #0d6efd); }

/* the Menu sheet slides over the bar like any bottom sheet */
.dd-list-form { margin: 0; }
/* only the logout <button> needs resetting; links keep their divider */
button.dd-list-item { background: transparent; border: 0; width: 100%; text-align: left; }
.dd-list-item.is-danger { color: #dc3545; }
@media (min-width: 768px) {
    .mobile-bottom-nav { left: 50%; right: auto; width: 560px; margin-left: -280px; border-radius: 22px 22px 0 0; }
}

/* ---- Menu panels (app\widgets\BottomNav, app/assets/js/menu-sheet.js) ------------------------------ */
.dd-sheet .modal-content { min-height: 0; }
.dd-sheet-body { min-height: 0; }
.dd-sheet .menu-panel[hidden] { display: none; }
.dd-sheet .menu-panel { animation: menuPanelIn 0.2s ease-out; }
@keyframes menuPanelIn {
    from { opacity: 0; transform: translateX(14px); }
    to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
    .dd-sheet .menu-panel { animation: none; }
    .dd-sheet .modal-dialog { transition: none; }
}
button.dd-list-item {
    width: 100%;
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--dd-line);
    text-align: left;
    font-family: inherit;
    cursor: pointer;
}
button.dd-list-item:last-child { border-bottom: 0; }
.dd-list-item { min-height: 56px; }
.dd-list-item small { display: block; margin-top: 1px; font-size: 0.72rem; font-weight: 400; color: var(--dd-mut); line-height: 1.3; }
.menu-badge {
    flex: 0 0 auto;
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 11px;
    background: #e0457b;
    color: #fff;
    font-size: 0.7rem;
    font-style: normal;
    font-weight: 700;
    text-align: center;
}
.menu-panel-head { display: flex; align-items: center; gap: 0.7rem; margin: 0.2rem 0 0.7rem; }
.menu-panel-head h4 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.menu-crumb { margin: 0; font-size: 0.72rem; color: var(--dd-mut); }
.menu-back {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 14px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}
