/* Alira Health Power BI Portal - layout on top of the superhero theme. */

:root {
    --ah-navy: #12284c;
    --ah-blue: #0072ce;
    --ah-orange: #f07f13;
    --ah-danger: #b90a0a;
    --ah-surface: #ffffff;
    --ah-text: #121111;
    --nav-height: 72px;
}

/* Bootstrap's reboot previously supplied these. Kept explicitly now that the
   Bootswatch theme is gone. */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    /* A system stack: no webfont download, no third-party request, and it
       renders natively on every platform. Segoe UI on Windows, where these
       users are. If brand fidelity matters more, self-host the font files
       rather than reintroducing fonts.googleapis.com. */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    background: var(--ah-surface);
    color: var(--ah-text);
    display: flex;
    flex-direction: column;
}

/* ------------------------------------------------------------------ nav --- */

.navbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: var(--nav-height);
    padding: 0.5rem 1.25rem;
    background: var(--ah-surface);
    border-bottom: 1px solid #e3e6ea;
}

/* Was the only class inherited from the Bootswatch theme. */
.navbar-brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
}

.brand-logo {
    width: 200px;
    max-width: 45vw;
    display: block;
}

.navbar-pickers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    color: var(--ah-text);
}

.welcome {
    white-space: nowrap;
}

.select-list {
    min-width: 200px;
    max-width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid #c7ccd1;
    border-radius: 4px;
    background: #fff;
    color: var(--ah-text);
    font-size: 0.95rem;
}

.select-list:disabled {
    background: #f1f3f5;
    color: #8a9199;
    cursor: not-allowed;
}

.btn {
    padding: 0.45rem 1.1rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    cursor: pointer;
}

.btn-primary {
    background: var(--ah-blue);
    color: #fff;
}

.btn-primary:disabled {
    background: #b9c2cb;
    cursor: not-allowed;
}

.btn-secondary {
    background: #fff;
    color: var(--ah-blue);
    border: 1px solid var(--ah-blue);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--ah-blue);
    color: #fff;
}

.btn-secondary:disabled {
    background: #f1f3f5;
    color: #8a9199;
    border-color: #c7ccd1;
    cursor: not-allowed;
}

/* Brief confirmation after copying; reverts on a timer. */
.btn-secondary.copied {
    background: #e8f5ec;
    border-color: #2e7d4f;
    color: #2e7d4f;
}

/* Icons are inline SVG; currentColor lets CSS drive their colour. */

.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--ah-text);
    padding: 0.35rem;
    border-radius: 4px;
    line-height: 1;
    text-decoration: none;
}

.icon-button:hover,
.icon-button:focus-visible {
    background: #eef1f4;
}

.icon-button svg {
    width: 22px;
    height: 22px;
    display: block;
}

/* Sign out: icon plus a visible label. An unlabelled power symbol is
   ambiguous, and this is the one control a user must be able to find. */
.signout {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid #e6c6c6;
    border-radius: 4px;
    color: var(--ah-danger);
    background: #fdf6f6;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.signout:hover,
.signout:focus-visible {
    background: var(--ah-danger);
    border-color: var(--ah-danger);
    color: #fff;
}

.signout svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* -------------------------------------------------------------- content --- */

.content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 0.75rem;
}

.report-wrapper {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}

.report-container {
    flex: 1 1 auto;
    min-height: 70vh;
}

/* Power BI injects an iframe; strip its default border. */
.report-container iframe {
    border: none;
}

.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    height: 64px;
    margin: -32px 0 0 -32px;
    z-index: 2;
}

.error-container {
    margin: 0 0 0.75rem;
    padding: 0.85rem 1rem;
    border: 1px solid #f5c2c2;
    border-left: 4px solid var(--ah-danger);
    border-radius: 4px;
    background: #fdf3f3;
    color: #6b1111;
}

/* ----------------------------------------------- landing / logged out ----- */

.overlay {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.signin-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
    text-align: center;
    max-width: 460px;
}

.signin-container img {
    width: 260px;
    max-width: 70vw;
}

.signin-container h2 {
    margin: 0;
    font-size: 1.25rem;
}

.signin-container .detail {
    margin: 0;
    color: #55606b;
}

.sign-in {
    display: inline-block;
    padding: 0.6rem 2rem;
    border: none;
    border-radius: 4px;
    background: var(--ah-orange);
    color: #fff;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
}

@media (max-width: 820px) {
    .navbar-pickers { width: 100%; }
    .select-list { min-width: 0; flex: 1 1 140px; }
    .welcome { display: none; }
    /* Keep the icon, drop the word - the control stays reachable. */
    .signout-label { display: none; }
    .signout { padding: 0.4rem; }
}
