/* Fonts

/* ------------------------------------------------------------------
   POPPINS (UI + buttons, links, Detail, Instruction, Copyright)
------------------------------------------------------------------ */
@font-face {
    font-family: 'Poppins';
    src: url('/fonts/Poppins-400-LatinExt.woff2') format('woff2');
    /* src: url('/fonts/poppins-v23-latin-regular.woff2') format('woff2'); */
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ------------------------------------------------------------------
   CINZEL (Titles / Headings)
------------------------------------------------------------------ */
@font-face {
    font-family: 'Cinzel';
    /* src: url('/fonts/Cinzel-400-LatinExt.woff2') format('woff2'); */
    src: url('/fonts/cinzel-v25-latin-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ------------------------------------------------------------------
   EB GARAMOND (Reading / Body Text)
------------------------------------------------------------------ */
@font-face {
    font-family: 'EB Garamond';
    src: url('/fonts/EBGaramond-400-Regular-LatinExt.woff2') format('woff2');
    /* src: url('/fonts/eb-garamond-v31-latin-regular.woff2') format('woff2'); */
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ------------------------------------------------------------
   NOTO SERIF  GREEK MAIN
------------------------------------------------------------ */
@font-face {
    font-family: 'Noto Serif Greek';
    src: url('/fonts/NotoSerif-Greek.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0370-03FF;
}

/* ------------------------------------------------------------
   NOTO SERIF  GREEK EXTENDED (Polytonic / Historical)
------------------------------------------------------------ */
@font-face {
    font-family: 'Noto Serif Greek';
    src: url('/fonts/NotoSerif-GreekExt.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+1F00-1FFF;
}

/* ------------------------------------------------------------
   NOTO SERIF  CYRILLIC (Russian)
------------------------------------------------------------ */
@font-face {
    font-family: 'Noto Serif Cyrillic';
    src: url('/fonts/NotoSerif-Cyrillic.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

/* ------------------------------------------------------------
   NOTO SERIF  CYRILLIC EXT (Serbian, Ukrainian, Extended)
------------------------------------------------------------ */
@font-face {
    font-family: 'Noto Serif Cyrillic';
    src: url('/fonts/NotoSerif-CyrillicExt.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0460-052F;
}

:root {
    --ui-font: 'Poppins', 'Noto Serif Greek', 'Noto Serif Cyrillic', 'Noto Serif SC', 'Noto Serif TC', 'M PLUS 1p', sans-serif;
    --title-font: 'Cinzel', 'Noto Serif Greek', 'Noto Serif Cyrillic', 'Noto Serif SC', 'Noto Serif TC', 'M PLUS 1p', serif;
    --body-font: 'EB Garamond', 'Noto Serif Greek', 'Noto Serif Cyrillic', 'Noto Serif SC', 'Noto Serif TC', 'M PLUS 1p', serif;
}

/* Global Styles */
html, body {
    font-family: var(--body-font); /* Cinzel, serif; */
    margin: 0; /* < important */
    padding: 0; /* optional but tidy */
    height: 100%;
    width: 100%;
    box-sizing: border-box;
    touch-action: manipulation; /* Prevents double-tap zoom */
    overscroll-behavior: none; /* Prevents bounce scrolling */
}

p {
    font-family: var(--body-font); /* 'EB Garamond', Times, serif; */
    text-align: justify;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--title-font);
}

    h1:focus {
        outline: none;
    }

a {
}


    /* Unified override for link-style buttons (Bootstrap + custom) */
    button .btn.btn-link, a.btn.btn-link, .btn-link {
        font-family: var(--ui-font);
        color: #4c2878; /* brand purple */
        text-decoration: none !important;
        font-weight: 500;
        padding: 0;
        margin: 0;
        background: none;
        border: none;
        transition: color 0.25s ease-in-out;
    }

        button.btn.btn-link:hover,
        a.btn.btn-link:hover,
        .btn-link:hover,
        button.btn.btn-link:focus,
        a.btn.btn-link:focus,
        .btn-link:focus,
        button.btn.btn-link:active,
        a.btn.btn-link:active,
        .btn-link:active {
            color: #6b3aa6; /* optional hover tint */
            text-decoration: none !important;
            outline: none;
            box-shadow: none;
        }



/* Title Container */
.title-container {
    text-align: center;
    margin-top: 0.25rem; /* Space below header */
    width: 100%;
}


/* Buttons */
.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
    font-family: var(--ui-font);
    margin-bottom: 1rem;
}

    .btn-primary.custom-button {
        background-color: #8b0000; /* Override with custom dark red */
        border-color: #8b0000;
    }

        .btn-primary.custom-button:hover {
            background-color: #a10000; /* Override hover */
            border-color: #a10000;
        }

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}


/* Audio Buttons */
.controls-container {
    width: 400px;
    max-width: 100%; /* Constrains button row width for better spacing */
    margin: 0 auto; /* Center the container */
}

.audio-btn {
    width: 48px;
    height: 48px;
    background-color: #4c2878;
    border: none;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .audio-btn:hover {
        background-color: #6b3aa6;
    }

    .audio-btn svg {
        width: 24px;
        height: 24px;
        fill: white;
    }

.audio-btn-large {
    width: 72px;
    height: 72px;
    background-color: #4c2878;
    border: none;
    border-radius: 8px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

    .audio-btn-large:hover {
        background-color: #6b3aa6;
    }

    .audio-btn-large svg {
        width: 36px;
        height: 36px;
        fill: white;
    }


/* Progress Bar */
.container {
    width: 100%;
    max-width: 100%; /* Allow full width within content-container */
    padding: 0 15px; /* Bootstrap default padding */
}

.progress-container {
    width: 100%;
    margin: 0 auto; /* Center the container */
    max-width: 70vw; /* Expand to container width */
    height: 30px;
    background: rgba(0,0,0,0.15);
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
}

    .progress-container .progress-bar {
        height: 100%;
        background: linear-gradient(90deg, #4c2878, #6b3aa6);
        width: 0%;
        transition: width 0.1s linear;
    }

.time-display {
    font-variant-numeric: tabular-nums;
    padding-top: 10px;
}


/* Layout */
.page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
    background: #fcfbf4;
    padding-bottom: env(safe-area-inset-bottom, 0);
}

main {
    flex: 1 0 auto; /* Allow main to grow but not shrink below content */
    padding-bottom: 70px; /* Updated to match new footer height */
    box-sizing: border-box;
    overflow-y: auto; /* Enable scrolling within main */
    /* Added to ensure content container can scroll */
    position: relative;
}

.content-container {
    width: 100%;
    max-width: 90vw; /* Allow expansion up to 90% of viewport */
    margin: 0 auto;
    flex: 1; /* fill vertical space between header and footer */
    flex-direction: column;
    /* justify-content: flex-start; /* Content starts higher */
    align-items: center; /* Horizontal centering */
    box-sizing: border-box;
    padding: 0 0.5rem; /* General padding */
    padding-top: 0.5rem; /* Removed env(safe-area-inset-top) to avoid double-counting */
}

    /* Target the Read, About, Messages, Book & Terms pages */
    .content-container.read,
    .content-container.about,
    .content-container.messages,
    .content-container.book,
    .content-container.terms {
        /* justify-content: flex-start; */
        text-align: start;
        padding-top: 1rem;
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
        box-sizing: border-box;
    }


    /* Target the Listen page */
    .content-container.listen {
        justify-content: center; /* Center content vertically for Listen page */
        min-height: calc(100vh - env(safe-area-inset-top, 0) - 64px - 70px);
        display: flex; /* Ensure flex context for centering */
    }

/* ---------- LISTEN PAGE FADE-IN ---------- */
.listen-fade-wrapper {
    opacity: 0; /* start invisible */
    transition: opacity 0s ease-in-out;
}

    .listen-fade-wrapper.fade-in {
        transition: opacity var(--fade-duration, 5s) ease-in-out;
    }

    .listen-fade-wrapper.visible {
        opacity: 1;
    }

/* Target the content on the Read page */
.content-container.read {
    justify-content: center;
    min-height: calc(100vh - env(safe-area-inset-top, 0) - 64px - 70px);
    display: flex;
    padding: 0 0.5rem;
}

    .content-container.read p {
        font-family: var(--body-font); /* 'EB Garamond', Times, serif; Match font with ul */
        margin: 0 0 1rem 0; /* Remove default top/bottom margins, keep bottom spacing */
    }

    .content-container.read ul {
        font-family: var(--body-font); /* 'EB Garamond', Times, serif; /* Apply Garamond font */
        list-style-type: disc; /* Ensure bullet points */
        margin-left: 0; /* Remove left margin */
        padding-left: 1.0rem; /* Remove left padding */
        padding-top: 0.5rem; /* padding from insructions above */
    }

        .content-container.read ul li {
            font-size: 1.1rem;
            line-height: 1.7;
            margin-bottom: 0.75rem;
        }

            .content-container.read ul li::marker {
                font-size: 0.85em; /* Slightly smaller bullet point */
            }


/* Target the content on the Messages page */
.content-container.messages {
    justify-content: flex-start;
    padding-top: 1rem;
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box;
}

    .content-container.messages ul {
        margin-left: 0; /* Remove browser default margin */
        padding-left: 0.5rem; /* Add subtle padding for bullets */
        list-style-position: outside; /* Keep bullets aligned cleanly */
        font-family: var(--body-font); /* 'EB Garamond', serif; */
    }

    .content-container.messages li {
        text-align: left; /* Ensure text aligns to left edge */
        line-height: 1.6; /* Comfortable reading */
        margin-bottom: 0.75rem; /* Add space between list items */
    }

.content {
    padding-top: 1rem;
    flex-grow: 1;
    min-height: 0;
}


/* Target the content on the Book page */
.content-container.book {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: calc(100vh - 64px - 70px - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    box-sizing: border-box;
    padding: 1rem 1rem calc(70px + 1rem + env(safe-area-inset-bottom, 0)); /* Adds safe footer spacing */
    text-align: center;
    overflow-y: auto; /* Allows content to scroll if too tall */
}

/* Book description above image */
.book-body {
    max-width: 90vw;
    margin: 0 auto 0.75rem auto;
    flex-shrink: 0;
}

/* Flexible area that centers image vertically + horizontally */
.book-image-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    overflow: hidden;
}

/* Actual image */
.book-image {
    width: auto;
    height: auto;
    max-width: 85vw;
    max-height: calc(100vh - 64px - 70px - 180px - 1.5rem - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    /* 180px  header + title + text margin */
    object-fit: contain;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

/* Slight tweak for very small screens */
@media (max-height: 700px) {
    .book-image {
        max-height: calc(100vh - 64px - 70px - 200px);
    }
}


/* === Unified and refined body text styling for About, Messages, and Read pages === */
.content-container.terms .content,
.content-container.about .content,
.content-container.messages .content,
.content-container.read .content {
    font-family: var(--body-font); /* 'EB Garamond', Times, serif; */
    font-size: 1.18rem; /* comfortable body size */
    line-height: 1.5; /* smooth vertical spacing */
    letter-spacing: 0.01em;
    color: #222; /* softer contrast */
}

    /* Paragraphs */
    .content-container.terms .content p,
    .content-container.about .content p,
    .content-container.messages .content p,
    .content-container.read .content p {
        font-size: 1.2rem;
        margin-bottom: 1.1rem;
        text-align: justify;
    }

    .content-container.terms .content p {
        text-align: start;
    }


/* About Page, App Information */
.content-container.about .appVersion {
    font-size: 75%;
}

.content-container.about .lastUpdate {
    font-size: 65%;
}

.content-container.about .cid {
    font-size: 60%;
}


/* Lists (Messages & Read only) */
.content-container.messages ul li,
.content-container.read ul li {
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 0.75rem;
}

    .content-container.messages ul li::marker,
    .content-container.read ul li::marker {
        font-size: 0.85em;
        color: #4c2878; /* brand purple bullets */
    }


/* Header */
.header-bar {
    position: sticky;
    top: 0;
    z-index: 3100;
    min-height: 64px; /* Minimum height, allows growth */
    background: #fcfbf4;
    color: #4c2878;
    padding-top: calc(env(safe-area-inset-top, 0) + 0.5rem); /* Handles safe area inset */
    box-sizing: border-box;
    margin: 0; /* Ensure no margin pushes it down */
}

.header-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    box-sizing: border-box;
}

.left-icon, .right-placeholder {
    width: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.brand-inner {
    display: flex;
    flex-direction: column; /* Stack logo and text vertically */
    align-items: center; /* Center the content horizontally */
    justify-content: center;
    gap: 0.975rem; /* Increased from 0.75rem by 30% (0.75 * 1.3) */
}

    .brand-inner img {
        height: 42px; /* Increased from 32px by 30% */
        width: auto;
        object-fit: contain;
    }

    .brand-inner h3 {
        margin: 0;
        font-family: var(--title-font);
        font-weight: 600;
        font-size: 1.25rem;
        color: #4c2878;
        white-space: normal; /* Allow text to wrap to next line */
        text-align: center; /* Center the text */
    }



/* Footer */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background: rgba(252, 251, 244, 0.9);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: flex-start; /* start icons slightly lower via margin */
    color: #4c2878;
    font-size: 0.9rem;
    z-index: 2000;
    padding-bottom: env(safe-area-inset-bottom, 0px); /* small push down */
    box-sizing: border-box;
}

.footer-content {
    width: 100%;
    max-width: 1200px;
    display: flex;
    justify-content: center; /* Centers a single item*/ /*space-between; /* Centers with equal spacing */
    align-items: center; /* Vertical centering */
    padding: 0 60px 4px 60px;
    font-family: var(--ui-font);
    font-size: 0.9rem;
    color: #4c2878;
}

    .footer-content span, .footer-content a {
        color: #4c2878;
        text-decoration: none;
    }

        .footer-content a:hover {
            text-decoration: underline;
        }

.footer-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    width: 100%;
    max-width: 85vw;
    height: 100%;
    min-height: 70px;
    padding-bottom: 10px;
    box-sizing: border-box;
}

.footer-icon {
    background: none;
    border: none;
    color: #4c2878;
    font-size: 1.75rem;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 0.25rem;
    display: flex;
    align-items: center; /* Center icon content vertically */
    justify-content: center; /* Center icon content horizontally */
    margin-top: 8px; /* ? final push down for visual balance */
}

    .footer-icon.active,
    .footer-icon:hover {
        color: #a10000; /* highlight color for active/hover state */
    }


/* Navigation */
.sidepane {
    position: fixed;
    top: calc(64px + env(safe-area-inset-top, 0)); /* Adjust for status bar */
    left: 0;
    /* Full height minus header, footer, and safe areas */
    height: calc(100vh - 64px - 70px - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    width: 280px; /* 240px; */
    background: #A489C4; /* color bob originally selected, app puirple color is -> #4c2878 */
    background: #8273a9; /* 2025.10.13 - nic selected from CTR book as alrternative to opacity above */
    background: rgba(76, 40, 120, 0.8); /* 2025.10.13 - nic selected this with opacity 70% */
    color: #fff;
    transform: translateX(-100%);
    transition: transform .25s ease-in-out;
    z-index: 3000 !important;
    overflow-y: auto;
    /* Base padding - safe area handled by top positioning */
    padding-top: 2.0rem; /* Desktop/small phones */
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 1rem;
    box-sizing: border-box;
}

    .sidepane.open {
        transform: translateX(0); /* slides over content */
    }



.backdrop {
    position: fixed;
    /* top: 64px; /* start right below the header */
    top: calc(64px + env(safe-area-inset-top, 0));
    left: 0;
    width: 100%;
    /* height: calc(100vh - 64px); */
    /* height: calc(100vh - 64px - 70px); /* Updated to match footer height */
    height: calc(100vh - 64px - 70px - env(safe-area-inset-top, 0) - env(safe-area-inset-bottom, 0));
    background: rgba(0,0,0,.4);
    z-index: 2000;
}

/* Nav links on Footer  */
.nav-link {
    color: white;
}

    .nav-link:hover {
        color: #ccc;
    }

    .nav-link i.bi {
        font-size: 1.25rem; /* make icons larger */
        line-height: 1; /* keeps them centered */
        display: inline-block; /* consistent sizing */
        vertical-align: middle; /* align with text */
        margin-right: 0.5rem; /* space between icon and text */
    }

    .nav-link.active {
        color: #ff4444 !important; /* red text */
        font-weight: bold;
    }

        .nav-link.active i.bi {
            color: #ff4444 !important; /* red icon */
        }

/* Nav links on Side Nav Pane */
.nav-item .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem; /* vertical + horizontal padding */
    border-radius: 4px; /* rounded background */
    font-size: 1rem;
    color: white;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .nav-item .nav-link:hover {
        background-color: rgba(76, 40, 120, 0.2); /* purple tint */
        color: #fff; /* keep text white */
    }

        .nav-item .nav-link:hover i.bi {
            color: #fff !important;
        }

    .nav-item .nav-link.active {
        /*  background-color: rgba(76, 40, 120, 0.3); /* deeper tint for active */
        color: #4A4A4A !important; /* red text */
        color: black !important; /* black text */
        color: darkgrey !important; /* darkgrey text */
        font-weight: bold;
    }

        .nav-item .nav-link.active i.bi {
            color: #4A4A4A !important; /* red text */
            color: black !important; /* black text */
            color: darkgrey !important; /* darkgrey text */
        }

.icon-btn {
    border: none;
    background: transparent;
    font-size: 1.75rem;
    cursor: pointer;
    color: #4c2878; /* Purple icons */
}

    .icon-btn i.bi {
        font-size: 1.75rem;
        color: #4c2878; /* Force Bootstrap icons purple */
    }

    .icon-btn:hover i.bi {
        color: #6b3aa6; /* optional lighter hover shade */
    }

/* NavMenu Reload Badge */
.update-container {
    position: relative;
}

.update-badge {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent; /* transparent background */
    padding: 0;
    margin: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.update-badge-icon {
    font-size: 1.1rem;
    color: #ffffff; /* white recycle icon */
    opacity: 0.95;
}



/* Icon colors by context */

/* Default (sidebar, header) */
.bi {
    color: white;
}

/* Footer-specific override */
.footer .bi {
    color: #4c2878; /* Purple for visible contrast */
}

.footer .footer-icon.active .bi,
.footer .footer-icon:hover .bi {
    color: #a10000; /* Red when active/hover */
}


/* Full splash screen container */
#splash-screen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: #fcfbf4;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 100000;
    transition: opacity 0.6s ease-out, visibility 0s linear 0.6s;
}

    #splash-screen.fade-out {
        /* Replacement Section Below - 2025.10.13 */
        opacity: 0;
        visibility: hidden;
    }

    #splash-screen img {
        opacity: 1;
    }


/* Main splash image  centered */
.splash-main {
    width: 100vw; /* fill full screen width */
    height: auto; /* maintain aspect ratio */
    max-height: 100vh;
    object-fit: contain;
    object-position: center center;
    display: block;
    transition: opacity 0.35s ease-in;
    transform: translateY(-5vh); /* ? move image up ~10% of viewport height */
}


/* Stamp image  pinned bottom-right corner */
.splash-stamp {
    position: absolute;
    right: 0; /* offset slightly off-screen */
    bottom: 0; /* offset slightly off-screen */

    width: min(25vw, 250px);
    height: auto;
    object-fit: contain;
    pointer-events: none; /* prevent interaction */

    will-change: transform;
    transform: translateZ(0);
}

/* Tree (background)  now grows to fill most of screen */
.splash-background {
    width: clamp(850px, 120vw, 1800px);
    max-height: 85vh;
    height: auto;
    object-fit: contain;
    display: block;
    opacity: 0;
    /* transition: opacity 0.4s ease-in; */
}

    .splash-logo.loaded,
    .splash-background.loaded {
        opacity: 1;
    }

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    #splash-screen {
        /* Extra padding for iOS safe areas         
        padding-top: max(env(safe-area-inset-top), 20px);
        padding-bottom: max(env(safe-area-inset-bottom), 20px);
        */

        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }

    .splash-content {
        /* Ensure iOS doesn't add extra spacing */
        margin: 0 !important;
        padding: 1rem;
    }
}


/*
 * Splash Loading and App Upgrade Overlay
 */

/* Splash UI overlay */
#splash-ui {
    position: absolute;
    bottom: 12vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    z-index: 100001;
    pointer-events: none;
}

/* Spinner */
.splash-spinner {
    width: 42px;
    height: 42px;
    border: 4px solid rgba(76, 40, 120, 0.25);
    border-top-color: #4c2878;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Update banner */
.splash-update-banner {
    font-family: var(--ui-font);
    font-size: 0.95rem;
    color: #4c2878;
    background: rgba(252, 251, 244, 0.9);
    border: 1px solid rgba(76, 40, 120, 0.35);
    border-radius: 12px;
    padding: 8px 14px;
    z-index: 100002;
}

/* Utility */
.hidden {
    display: none;
}





/* QR Code Image */
.qrcode-image {
    max-width: 75vw; /* Ensures image fits within 60% of viewport width */
    max-height: 75vh; /* Ensures image fits within 60% of viewport height */
    width: auto;
    height: auto;
    object-fit: contain; /* Preserves aspect ratio */
    padding: 20%; /* 20% padding on all sides */
    display: block;
    margin: 0 auto; /* Centers image horizontally */
}

/* Error and Loading */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    width: 100%;
    background: #fff;
    font-family: var(--ui-font);
}

.loading-progress-text {
    margin-bottom: 10px;
    font-size: 14px;
    font-weight: bold;
    color: #4c2878; /* purple text */
}

.loading-progress-bar {
    width: 70%;
    max-width: 600px;
    height: 14px;
    background: #ddd;
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.2);
}

.loading-progress-bar-fill {
    height: 100%;
    width: 0%; /* starts empty */
    background-color: #4c2878; /* your purple color */
    transition: width 0.3s ease;
}

/* Loading.razor Page*/
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column; /* Stack images vertically */
    justify-content: center;
    align-items: center;
    background-color: #fff; /* Match your apps background */
    z-index: 9999; /* Above all content */
    transition: opacity 0.6s ease-out; /* For fade-out effect */
}

    .loading-container.fade-out {
        opacity: 0;
        pointer-events: none; /* Prevent interaction during fade-out */
    }

.loading-background-image {
    max-width: 80%;
    max-height: 60%; /* Reserve space for logo */
    object-fit: contain;
}

.loading-logo-image {
    max-width: 50%; /* Adjust size for better visibility */
    max-height: 20%; /* Ensure logo fits */
    object-fit: contain;
    margin-top: 1rem; /* Space between background and logo */
}

.pre-blazor-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100%;
    background-color: #fff;
}

.pre-blazor-loading-image {
    max-width: 50%;
    max-height: 50%;
    object-fit: contain;
}


/* Form and Validation */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* =========================================
   Clean layout for iOS & Android instructions
   ========================================= */
.install-instructions {
    width: 100%;
    max-width: 1400px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0.5rem; /* Reduced from 1rem to minimize compression */
    margin: 0 auto;
    color: #333;
    font-family: var(--body-font); /* 'EB Garamond', serif; */
    text-align: center; /* Force centering of text */
    box-sizing: border-box; /* Ensure padding doesnt add to width */
    text-align: center;
}

.content-container.install-selector {
    /* max-width: 1600px; /* Wider to accommodate instructions */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 2rem 0.25rem;
}

@media (max-width: 1024px) {
    .install-instructions {
        max-width: 100%; /* Slightly less than full width for tablets */
        padding: 0 0.25rem;
    }
}

@media (max-width: 768px) {
    .install-instructions {
        max-width: 100%;
        padding: 0 0.25rem;
    }
}

/* Remove outlines from buttons if any appear */
.install-instructions button {
    background: none;
    border: none;
    box-shadow: none;
    padding: 0;
    color: #4c2878;
}

/* List formatting (numbers inline, clean look) */
.install-instructions .install-list.numbered-inline {
    list-style: decimal;
    margin: 0 auto;
    padding-left: 1.25rem; /* slightly less padding */
    font-family: var(--body-font); /* 'EB Garamond', serif; */
    font-size: 1.05rem;
    line-height: 1.7;
    color: #333;
    display: inline-block; /* Allows the list to center within the container */
}

    .install-instructions .install-list.numbered-inline li {
        margin-bottom: 0.75rem;
        text-align: left !important; /* Use !important to override any inherited justify */
    }

        /* number style */
        .install-instructions .install-list.numbered-inline li::marker {
            color: #4c2878; /* brand purple */
            font-family: var(--title-font);
            font-weight: 600;
            font-size: 1.1rem;
        }

/* ensure icons appear properly */
.install-instructions .bi,
.install-instructions .icon-black {
    color: black !important;
    vertical-align: middle;
}

/* Instructions title */
.install-instructions p {
    margin-bottom: 0.75rem;
    font-family: var(--title-font);
    color: #4c2878;
    text-align: center;
    /* max-width: 1000px; */
}


/* Install for IOS & Android - Added 2025.10.09 */
.install-selector {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.instruction-text {
    font-family: var(--body-font); /* 'EB Garamond', serif; */
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    /* max-width: 1000px; */
    color: #333;
}

.platform-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.platform-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 150px;
    height: 120px;
    border: none;
    border-radius: 16px;
    font-family: var(--title-font);
    font-size: 1rem;
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

    .platform-btn i {
        font-family: var(--ui-font);
        font-size: 2.5rem;
        margin-bottom: 0.5rem;
    }

    .platform-btn.ios {
        background-color: #1D1D1F; /* dark mode ios */
    }

    .platform-btn.android {
        background-color: #3DDC84; /* android green */
    }

    .platform-btn:hover {
        transform: translateY(-4px);
        box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    }


/* === QR Code Missing or Invalid Pages === */
.content-container.qrcode-missing,
.content-container.qrcode-invalid {
    display: block !important; /* override flex from base content-container */
    background-color: #fcfbf4;
    text-align: center;
    padding: 1rem 1rem 2rem 1rem; /* safe padding top/bottom + edges */
    box-sizing: border-box;
    min-height: calc(100vh - 64px - 70px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
}

.qrcode-missing-image,
.qrcode-invalid-image {
    display: block;
    margin: 0 auto;
    width: 100%;
    max-width: min(520px, 90vw); /* Never wider than 520px or 90% of viewport */
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    padding: 0.5rem;
    box-sizing: border-box;
    animation: fadeInZoom 0.6s ease-out both;
}

/* Optional: give a subtle entrance animation (for elegance) */
@keyframes fadeInZoom {
    from {
        opacity: 0;
        transform: scale(0.96);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.qrcode-missing-image,
.qrcode-invalid-image {
    animation: fadeInZoom 0.6s ease-out both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* === Download progress bar on Welcome Page - TESTING, REMOVE FOR PRODUCTION === */
.download-progress-container {
    position: relative;
    width: 80%;
    max-width: 320px;
    height: 6px;
    background-color: #ddd;
    border-radius: 3px;
    margin: 0.8rem auto 0.4rem auto;
    overflow: hidden;
}

.download-progress-bar {
    height: 100%;
    background-color: #c00; /* rich red accent */
    width: 0%;
    border-radius: 3px;
    transition: width 0.25s ease-in-out;
}

.download-status-text {
    text-align: center;
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 0.5rem;
}

/* === QR Code Invalid Fullscreen Centered Page === */
.fullscreen-center {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: #fcfbf4;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin: 0;
    padding: 0;
    z-index: 5000;
}

    .fullscreen-center img {
        max-width: min(520px, 90vw);
        max-height: 90vh;
        object-fit: contain;
        display: block;
        animation: fadeInZoom 0.6s ease-out both;
    }


/* Welcome Page Nav Link Formatting*/
.inline-link {
    display: inline;
    text-decoration: underline;
    white-space: nowrap;
    /* color: #4c2878;  your brand purple */
}

    .inline-link:hover {
        text-decoration: none;
    }

    .inline-link::before {
        content: "";
    }

    .inline-link::after {
        content: "";
    }

/* ===============================================
   OFFLINE PAGE STYLES
   (placed at end of app.css so it overrides global)
   =============================================== */
body.offline-page {
    background-color: #fcfbf4;
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

    /* Reuse splash layout from main app */
    body.offline-page #splash-screen {
        position: fixed;
        inset: 0;
        display: flex;
        justify-content: center;
        align-items: center;
        background-color: #fcfbf4;
        z-index: 100000;
    }

    /* Splash images reused */
    body.offline-page .splash-main {
        width: 100vw;
        height: auto;
        max-height: 100vh;
        object-fit: contain;
        object-position: center center;
        opacity: 1;
        transform: translateY(-5vh);
    }

    body.offline-page .splash-stamp {
        position: absolute;
        right: 0;
        bottom: 0;
        width: 25vw;
        max-width: 250px;
        height: auto;
        object-fit: contain;
        opacity: 1;
        pointer-events: none;
    }

/* Rounded, auto-sizing banner */
.offline-banner {
    position: fixed;
    top: env(safe-area-inset-top, 200px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    border-radius: 14px;
    padding: 10px 18px;
    border: 1px solid #6f42c1;
    z-index: 99999;
    text-align: center;
    font-family: var(--ui-font);
    font-size: 0.95rem;
    box-shadow: 0 0 12px rgba(111, 66, 193, 0.4);
    animation: fadeInDown 0.5s ease-out;
    max-width: 90%;
}

    .offline-banner svg {
        width: 60px;
        height: 60px;
        fill: #6f42c1;
        opacity: 0.85;
        margin-bottom: 0.5rem;
    }

/* Simple fade-in animation for elements */
.fade-in {
    animation: fadeIn 0.8s ease-in forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}
