﻿h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjExLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNzg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3LjgyOSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* 🌐 Global Android-like typography and smoothing */
html,
body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    color: #111827;
    background-color: #fff;
    margin: 0;
    padding: 0;

    /* 📱 MOBILE KEYBOARD LOCK: 
       By fixing the body/html, we prevent the browser from scrolling 
       the document when input is focused. Everything must be 
       handled inside our flex containers. */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    height: calc(var(--vh, 1vh) * 100);
    overflow: hidden;
    overscroll-behavior: none;
    /* 🔥 Prevent iOS pull-to-refresh/bounce */
    touch-action: none;
    /* Only allow scrolling on specific elements */
    -webkit-overflow-scrolling: touch;
}

#app {
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

/* Headings mimic Android UI hierarchy */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

/* Inputs, buttons, and form controls inherit Roboto */
input,
button,
select,
textarea {
    font-family: inherit;
}

/* Material-like button style baseline */
button {
    letter-spacing: 0.02em;
}

@media (max-width: 768px) {

    .chat-list-panel {
        width: 100%;
        position: absolute;
        z-index: 20;
        transition: transform .25s ease;
    }

    .chat-panel {
        width: 100%;
        position: absolute;
        z-index: 30;
        transition: transform .25s ease;
    }

    .chat-panel.hidden {
        transform: translateX(100%);
    }

    .chat-list-panel.hidden {
        transform: translateX(-100%);
    }
}


/* Smoother Image Viewer with Slider */
.fullscreen-viewer {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2147483647;
    overflow: hidden;
    touch-action: none;
    transition: background-color 0.3s ease;
}

.fullscreen-viewer.viewer-closing {
    pointer-events: none;
}

.viewer-track {
    display: flex;
    width: 100%;
    height: 100%;
    will-change: transform;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.viewer-track.no-transition {
    transition: none !important;
}

.viewer-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    user-select: none;
}

.viewer-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    touch-action: none;
    user-select: none;
    -webkit-user-drag: none;
    will-change: transform;
    transform-origin: center center;
}

/* 🛡️ SECURITY: Prevent long-press, selection, and dragging on media */
/* Global Media Protection */
img,
video,
audio {
    -webkit-touch-callout: none;
    /* Prevents context menu on iOS */
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
}

/* Prevent Printing */
@media print {
    body {
        display: none !important;
    }
}

.viewer-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    padding: 12px;
    color: white;
    opacity: 0.6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    backdrop-filter: blur(4px);
}

.viewer-arrow:active {
    background: rgba(0, 0, 0, 0.4);
    transform: translateY(-50%) scale(0.9);
}

.viewer-arrow.left {
    left: 16px;
}

.viewer-arrow.right {
    right: 16px;
}

@media (hover: hover) {
    .viewer-arrow:hover {
        opacity: 1;
        background: rgba(0, 0, 0, 0.4);
    }
}

.viewer-pagination {
    position: absolute;
    bottom: env(safe-area-inset-bottom, 30px);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 20;
    padding: 8px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(4px);
}

.viewer-pagination .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.viewer-pagination .dot.active {
    background: white;
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

/* Status flags */
.viewer-zooming .viewer-arrow,
.viewer-zooming .viewer-pagination {
    opacity: 0;
    pointer-events: none;
}

:root {
    --vh: 1vh;
}

.chat-root {
    width: 100%;
    height: 100%;
    flex: 1;
    /* 🔥 Grow to fill MainLayout container */
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    padding-bottom: env(safe-area-inset-bottom);
    background-color: #F7F7F7;
    touch-action: pan-y;
    /* Allow scrolling messages */
}

.main-wrapper {
    height: 100%;
    height: calc(var(--vh, 1vh) * 100);
    width: 100%;
    overflow: hidden;
    position: relative;
}

.page-scroll {
    height: 100%;
    width: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Feedback Prompt Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out forwards;
}

.no-tap-highlight {
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

/* 📜 Prominent Scrollbar for Legal Content (Ensures visibility) */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    display: block;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9;
    /* Slate 100 */
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #94a3b8;
    /* Slate 400 - Darker for better visibility */
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #64748b;
    /* Slate 500 */
}

/* Ensure content doesn't jump and gutter is visible */
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
    scrollbar-gutter: stable;
}