html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

.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;
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 60px;
}

.ocr-scan-container {
    position: relative;
    width: 200px;
    height: 200px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 0 8px rgba(0, 255, 0, 0.4);
}

.ocr-scan-container-remove-button {
    position: absolute;
    right: 5px;
    top: 5px;
}

.ocr-scan-container img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 8px;
}

.ocr-scanner-line {
    position: absolute;
    top: -20%;
    left: 0;
    width: 100%;
    height: 20%;
    background: linear-gradient(
            to bottom,
            rgba(0, 255, 0, 0) 0%,
            rgba(0, 255, 0, 0.7) 50%,
            rgba(0, 255, 0, 0) 100%
    );
    animation: ocr-scan-animation 2.0s linear infinite;
    pointer-events: none;
}

@keyframes ocr-scan-animation {
    0% {
        top: -20%;
    }
    100% {
        top: 100%;
    }
}

.flash-field {
    animation: flash-bg 1s ease-in-out;
}

@keyframes quick-pick-pulse-frames {
    0% {
        background-color: rgb(255, 255, 0.5);
        outline: solid 3px cornflowerblue;
        outline-offset: 1px;
        box-shadow: 0 0 0 0 rgba(100, 149, 237, 0.3);
        opacity: 1;
    }
    40% {
        /*outline-offset: 6px;*/
        /*box-shadow: 0 0 0 8px rgba(100,149,237, 0.15);*/
        opacity: 0.92;
    }
    70% {
        /*outline-offset: 10px;*/
        /*box-shadow: 0 0 0 16px rgba(100,149,237, 0.08);*/
        opacity: 0.86;
    }
    100% {
        outline: solid 3px cornflowerblue;
        outline-offset: 5px;
        box-shadow: 0 0 0 10px rgba(100, 149, 237, 0.04);
        opacity: 0.8;
    }
}

@keyframes flash-bg {
    0% {
        background-color: yellow;
    }
    100% {
        background-color: transparent;
    }
}

@keyframes scanning-blur-anim {
    0% {
        filter: blur(0px) brightness(1.0);
    }
    50% {
        filter: blur(2px) brightness(0.7);
    }
    100% {
        filter: blur(0px) brightness(1.0);
    }
}

.scanning-blur-animation {
    animation: scanning-blur-anim 2s ease-in-out infinite alternate;
}

.animated-bg {
    background: linear-gradient(-45deg, #dbeafe, #e0f2fe, #f0fdf4, #eef2ff);
    background-size: 400% 400%;
    animation: gradient-flow 15s ease infinite;
}

@keyframes animate-away-left {
    0% {

    }
    100% {
        transform: translateX(-100vw);
    }
}

@keyframes animate-in-from-left {
    0% {
        transform: translateX(100vw);
    }
    100% {
        transform: translateX(0);
    }
}

.animate-in-from-left-class {
    animation: animate-in-from-left 500ms ease-in-out forwards;
}

.animate-away-left-class {
    animation: animate-away-left 500ms ease-in-out forwards;
}

@keyframes opacity-hide-kf {
    0% {
        opacity: 1;
    }
    100% {
        opacity: 0;
    }
}

@keyframes opacity-show-kf {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.opacity-show-anim {
    animation: opacity-show-kf 100ms ease-in forwards;
}

.opacity-hide-anim {
    animation: opacity-hide-kf 100ms ease-in forwards;
}

@keyframes ping-keyframes {
    0% {
        outline: solid 1px cornflowerblue;
        outline-offset: 30px;
    }
    100% {
        outline-offset: 0px;
    }
}

.ping-animation {
    animation: ping-keyframes infinite 1.3s;
}

@keyframes gradient-flow {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

.custom-box-shadow {
    /*filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.2));*/
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.5) !important;
}

.scrollbar-force-invisible {
    overflow-y: hidden !important;
}

/*tbody tr:nth-child(even) {*/
/*    background-color: #f9fafb;*/
/*}*/

/*tbody tr:nth-child(odd) {*/
/*    background-color: #e5e7eb;*/
/*}*/

::-webkit-scrollbar {
    width: 16px;
    height: 16px; /* For horizontal bars */
    background: #f3f4f6;
    border-radius: 10px;
}

::-webkit-scrollbar-track {
    background: #e5e7eb; /* Tailwind gray-200: light, visible bar */
    border-radius: 10px;
    margin: 2px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(120deg, #008393 0%, #4fd1c5 100%);
    border-radius: 10px;
    border: 4px solid #e5e7eb; /* Matches track, for thumb-in-bar look */
    min-height: 36px;
    transition: background 0.2s;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(120deg, #005b72 0%, #06b6d4 100%);
}

::-webkit-scrollbar-corner {
    background: #f3f4f6;
}

/*
TODO not working well for select
*/

/*border-image-source: linear-gradient(to left, #743ad5, #d53a9d);*/

/*
Styles for the context menu
 */

.context-fade-enter {
    opacity: 0;
    transform: scale(0.98);
}

.context-fade-enter-active {
    opacity: 1;
    transform: scale(1);
    transition: opacity 150ms ease-out, transform 150ms ease-out;
}

.context-fade-exit {
    opacity: 1;
    transform: scale(1);
}

.context-fade-exit-active {
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 150ms ease-in, transform 150ms ease-in;
}

.noselect {
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

#create-record-loading-overlay {
    /*position: absolute;*/
    /*left: 0;*/
    /*right: 0;*/
    /*top: 0;*/
    /*bottom: 0;*/
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(1px);
    z-index: 5;
    /*z-index: 4;*/
}

#doctor-comments:focus {
    border: solid 2px cornflowerblue;
    outline: solid 2px cornflowerblue;
}

.highlight-row {
    background: linear-gradient(
            90deg,
            rgb(219 234 254) 0%,
            rgb(219 234 254 / 90%) 40%,
            rgb(219 234 254 / 100%) 60%,
            rgb(219 234 254) 100%
    );
    background-size: 200% 100%;
    border-radius: 0.5rem;
    transition: background-color 0.4s ease;
}

.hidden-element {
    display: none !important;
}

.record-thumbnail-image {
    transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
    border-radius: 6px;
}

.record-thumbnail-image:hover {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    filter: brightness(1.05) contrast(1.05);
}

#view-records-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%) !important;
    border-bottom: 1px solid #e5e7eb !important;
    box-shadow: 0 1px 0 rgba(0,0,0,0.03);
}

#view-records-table tbody tr:hover {
    background-color: rgba(2,132,199,0.18) !important;
    box-shadow:
            inset 0 3px 6px rgba(0,0,0,0.35),
            inset 0 -2px 4px rgba(255,255,255,0.15),
            inset 0 0 6px rgba(0,0,0,0.25),
            0 1px 2px rgba(2,132,199,0.2);
    transition: all 120ms ease-in-out;
    cursor: pointer;
}

#view-records-table tbody tr:hover td:first-child {
    box-shadow: inset 4px 0 0 0 rgba(27,121,141,0.9);
}

.action-dropdown {
    /*overflow: hidden;*/
}

.action-dropdown::before {
    content: "";
    position: absolute;
    top: -8px;
    right: 16px;
    border-width: 0 8px 8px 8px;
    border-style: solid;
    border-color: transparent transparent #e5e7eb transparent; 
}
.action-dropdown::after {
    content: "";
    position: absolute;
    top: -7px;
    right: 16px;
    border-width: 0 8px 8px 8px;
    border-style: solid;
    border-color: transparent transparent #ffffff transparent; 
}

/* Smooth fade for table updates */
#view-records-table {
    transition: opacity 300ms ease;
}

/* Skeleton shimmer for loading state */
@keyframes vrf-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}
.vrf-skel {
    position: relative;
    overflow: hidden;
    background: #f1f5f9;
    border-radius: 6px;
}
.vrf-skel::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.65) 50%, transparent 100%);
    animation: vrf-shimmer 1.2s infinite;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 4px rgba(59, 130, 246, 0.25);
    }
    50% {
        box-shadow: 0 0 8px rgba(59, 130, 246, 0.35);
    }
}

.stopwatch-active {
    background-color: rgb(219 234 254);
    color: rgb(30 64 175);
    animation: pulseGlow 2.4s ease-in-out infinite;
    transition: background-color 200ms ease, box-shadow 200ms ease;
}


/*Loading window*/
@keyframes ai-overlay-fade {
    from { opacity: 0 }
    to   { opacity: 1 }
}
@keyframes ai-card-in {
    0%   { transform: translateY(10px) scale(.98); opacity: 0 }
    100% { transform: translateY(0)    scale(1);    opacity: 1 }
}
.ai-overlay-fade { animation: ai-overlay-fade .25s ease-out both }
.ai-card-in      { animation: ai-card-in .28s cubic-bezier(.22,.9,.24,1) both }

/* --- Soft pulsing background blobs (teal scheme) --- */
@keyframes ai-blob {
    0%,100% { transform: scale(1) translate3d(0,0,0); opacity: .55 }
    50%     { transform: scale(1.05) translate3d(0,2%,0); opacity: .8 }
}

/* --- Indeterminate bar: sweep to end and back --- */
/* Bar width is 28%, so it travels from left:0% to left:72% (100-28) */
@keyframes ai-bar-scan {
    0%   { left: 0% }
    100% { left: 72% }
}
.ai-bar-scan {
    width: 28%;
    animation: ai-bar-scan 2.15s ease-in-out infinite alternate;
}

/* Shimmer overlay on the track */
@keyframes ai-shimmer {
    0%   { transform: translateX(-100%) }
    100% { transform: translateX(100%) }
}
.ai-shimmer:before {
    content: "";
    position: absolute; inset: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
    transform: translateX(-100%);
    animation: ai-shimmer 1.8s linear infinite;
}

/* Subtle tokeny dots */
@keyframes ai-dots {
    0%   { transform: translateX(0)   scale(1);   opacity:.35 }
    50%  { transform: translateX(8px) scale(1.08);opacity:.8  }
    100% { transform: translateX(0)   scale(1);   opacity:.35 }
}
.ai-dot-1 { animation: ai-dots 1.2s ease-in-out infinite }
.ai-dot-2 { animation: ai-dots 1.2s .15s ease-in-out infinite }
.ai-dot-3 { animation: ai-dots 1.2s .30s ease-in-out infinite }

@keyframes ai-overlay-fade-out {
    from { opacity: 1 }
    to   { opacity: 0 }
}
.ai-overlay-out {
    animation: ai-overlay-fade-out .22s ease-out forwards;
}