.admin-section-shadow {
    box-shadow: 0 2px 5px #00000029,0 2px 10px #0000001f;
}
.scroll-thin {
    scrollbar-width: thin;
}

/* Chrome, Safari, Edge, Opera */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Firefox */
input[type=number] {
    -moz-appearance: textfield;
}

.pulse-once {
    animation: pulseOnce 1s;
}
@keyframes pulseOnce {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Sim Cards */
.text-blended {
    mix-blend-mode: overlay;
    color: white;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.description-clamp {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


/* Soundwave visualization for agent audio output */
.soundwave-bar {
    width: 1rem;
    min-height: 8px;
    background: linear-gradient(180deg, oklch(var(--p)) 0%, oklch(var(--s)) 100%);
    /*background: blue;*/
    border-radius: 3px;
    transition: height 0.1s ease-out;
    will-change: height;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.1);
}

/* Optional: Add a glow effect when active */
.soundwave-bar.active {
    box-shadow: 0 0 12px oklch(var(--p) / 0.5);
}

/* Animated avatar border for active connection */
.avatar-border-active {
    border-color: oklch(var(--p));
    animation: avatarBorderPulse 2s ease-in-out infinite;
    box-shadow: 0 0 20px oklch(var(--p) / 0.6), 0 0 40px oklch(var(--p) / 0.4);
}

@keyframes avatarBorderPulse {
    0%, 100% {
        border-color: oklch(var(--p));
        box-shadow: 0 0 20px oklch(var(--p) / 0.6), 0 0 40px oklch(var(--p) / 0.4);
    }
    50% {
        border-color: oklch(var(--s));
        box-shadow: 0 0 30px oklch(var(--s) / 0.8), 0 0 60px oklch(var(--s) / 0.5), 0 0 80px oklch(var(--s) / 0.3);
    }
}

.loader {
  width: fit-content;
  /* font-size: 40px; */
  /* font-family: system-ui,sans-serif; */
  /* font-weight: bold; */
  /* text-transform: uppercase; */
  /* color: #0000; */
  color: var(--fallback-p,oklch(var(--p)/0.1));
  /* -webkit-text-stroke: 1px var(--fallback-p,oklch(var(--p)/1)); */
  /* background: 
    linear-gradient(90deg,#0000 33%,#000 0 67%,#0000 0) 
    0/300% 100% no-repeat text; */
  background: 
    linear-gradient(90deg,var(--fallback-p,oklch(var(--p)/0.1)) 33%,var(--fallback-p,oklch(var(--p)/1)) 0 67%,var(--fallback-p,oklch(var(--p)/0.1)) 0) 
    0/300% 100% no-repeat;
    -webkit-background-clip: text; /* For older WebKit browsers */
    background-clip: text;         /* Standard compliant way */
  animation: l2 1.5s linear infinite;
}
@keyframes loader-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

/* .loader:before {
  content: "Loading";
} */

@keyframes l2 {
  0%{background-position: 100%}
}


/* Base structural hiding - Tailwind handles the 'flex' when active */
#components-reconnect-modal {
    display: none;
}

/* Toggle visibility based on Blazor state */
#components-reconnect-modal.components-reconnect-show,
#components-reconnect-modal.components-reconnect-failed,
#components-reconnect-modal.components-reconnect-rejected {
    display: flex !important;
}

/* The Modal Card */
.reconnect-box {
    background: #ffffff;
    padding: 2.5rem 2rem;
    border-radius: 12px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    text-align: center;
    max-width: 420px;
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.reconnect-box h5 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.reconnect-box p {
    font-size: 0.95rem;
    color: #4b5563;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Hide states by default */
.reconnect-state-show,
.reconnect-state-failed,
.reconnect-state-rejected {
    display: none;
}

/* Active State Display mapping */
#components-reconnect-modal.components-reconnect-show .reconnect-state-show { display: block; }
#components-reconnect-modal.components-reconnect-failed .reconnect-state-failed { display: block; }
#components-reconnect-modal.components-reconnect-rejected .reconnect-state-rejected { display: block; }

/* Custom Refresh Button */
.btn-refresh {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #2563eb;
    color: #ffffff;
    font-weight: 500;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    transition: all 0.2s ease-in-out;
    border: none;
    cursor: pointer;
}

.btn-refresh:hover {
    background-color: #1d4ed8;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.2);
}

/* State Graphic elements */
.icon-wrapper {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Concentric plug spinner setup */
.spinner-container {
    position: relative;
    width: 60px;
    height: 60px;
    margin: 0 auto 1.25rem auto;
}

.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2563eb;
    border-radius: 50%;
    width: 100%;
    height: 100%;
    animation: spin 1s linear infinite;
}

.spinner-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.25rem;
    color: #2563eb;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Carousel fade effect for sides */
.sides-fade {
    -webkit-mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 10%,
            black 90%,
            transparent 100%
    );
    mask-image: linear-gradient(
            to right,
            transparent 0%,
            black 10%,
            black 90%,
            transparent 100%
    );
}

/* carousel styles */
.carousel-viewport {
    overflow: hidden;
    position: relative;
}

.carousel-count-marker{
    /*color: var(--fallback-nc,oklch(var(--nc)/var(--tw-text-opacity)));*/
    /*background-color: var(--fallback-n,oklch(var(--n)/var(--tw-bg-opacity)));*/
    opacity: 0.25;
}

.carousel-count-marker:hover{
    cursor: pointer;
    opacity: 0.75;
}

.carousel-count-marker.selected{
    opacity: 0.75;
}

.carousel-item-custom {
    width: 100%;
}

.radial-size-auto{
    --size: 4rem;
}

@media (min-width: 1024px) {
    .radial-size-auto{
        --size: 7rem;
    }
}

/* Mic-test calibration phrase words.
   Visual state is driven by the data-state attribute; JS only flips the
   attribute, never adds/removes utility classes. Palette mirrors .loader so
   the active DaisyUI theme flows through. */
.config-word {
    position: relative;
    display: inline-block;
    color: oklch(var(--bc) / 0.8);
    font-weight: 500;
    font-style: italic;
    opacity: 0.8;
    /* anchor the ::after wipe to the word's own box */
    isolation: isolate;
}

.config-word[data-state="pending"] {
    /* base styles only — dim, italic, no decoration */
}

.config-word[data-state="current"] {
    color: oklch(var(--bc));
    font-weight: 600;
    opacity: 1;
    /*text-decoration: underline;*/
    /*text-underline-offset: 4px;*/
}

/* 1. Base "Said" State (Instant Final State)
   Applied to all words with data-state="said". No animation by default. */
.config-word[data-state="said"] {
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
    opacity: 1;
    background-image: linear-gradient(90deg,
    var(--fallback-p, oklch(var(--p) / 1)) 50%,
    transparent 50%);
    background-size: 200% 100%;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;

    /* Set the background position directly to the final state (0% 0) */
    background-position: 0% 0;
}

.config-word[data-state="said"]:not(:has(~ .config-word[data-state="said"])) {
    background-position: 100% 0;
    animation: configWordReveal 0.5s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.gain-phrase[data-capture-tone="success"] .config-word[data-state="pending"],
.gain-phrase[data-capture-tone="success"] .config-word[data-state="current"],
.gain-phrase[data-capture-tone="success"] .config-word[data-state="said"] {
    color: oklch(var(--su));
    -webkit-text-fill-color: currentColor;
    background-image: none;
    opacity: 1;
}

.gain-phrase[data-capture-tone="warning"] .config-word[data-state="pending"],
.gain-phrase[data-capture-tone="warning"] .config-word[data-state="current"],
.gain-phrase[data-capture-tone="warning"] .config-word[data-state="said"] {
    color: oklch(var(--wa));
    -webkit-text-fill-color: currentColor;
    background-image: none;
    opacity: 1;
}

.gain-phrase[data-capture-tone="error"] .config-word[data-state="pending"],
.gain-phrase[data-capture-tone="error"] .config-word[data-state="current"],
.gain-phrase[data-capture-tone="error"] .config-word[data-state="said"] {
    color: oklch(var(--er));
    -webkit-text-fill-color: currentColor;
    background-image: none;
    opacity: 1;
}

@keyframes configWordReveal {
    from {
        background-position: 100% 0;
    }
    to {
        background-position: 0% 0;
    }
}


.vid-options-gradient {
    --bg-gradient-color: var(--fallback-n,oklch(var(--n)/0.5));

    background: linear-gradient(
            to bottom,
            rgb(from var(--bg-gradient-color) r g b / 0) 0%,
            rgb(from var(--bg-gradient-color) r g b / 0.5) 30%
    );
}

/* ATTENTION ANIMS */
/* Required so the CSS engine knows how to smoothly transition these raw numbers */
@property --pulse-scale { syntax: '<number>'; initial-value: 1; inherits: false; }
@property --pulse-overlay { syntax: '<number>'; initial-value: 0; inherits: false; }
@property --hover-scale { syntax: '<number>'; initial-value: 1; inherits: false; }
@property --hover-overlay { syntax: '<number>'; initial-value: 1; inherits: false; }

.attention-pulse {
    display: inline-block;
    position: relative;

    /* Base hover states */
    --hover-scale: 1;
    --hover-overlay: 1; /* Acts as a multiplier */

    /*
       Scale uses whichever value is bigger: the running pulse, or the hover transition.
    */
    transform: scale(max(var(--pulse-scale), var(--hover-scale))) translateZ(0);

    backface-visibility: hidden;
    will-change: transform;
    -webkit-font-smoothing: antialiased;

    transition: --hover-scale 0.75s ease-out, --hover-overlay 0.75s ease-out;

    animation: pulse-anim 5s infinite;
}

.attention-pulse::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #ffffff;
    border-radius: inherit;
    pointer-events: none;

    /* Multiply the pulse opacity by the hover multiplier */
    opacity: calc(var(--pulse-overlay) * var(--hover-overlay));
    will-change: opacity;
}

.attention-pulse:hover {
    /* We DO NOT kill or pause the animation. We just trigger the transition. */
    --hover-scale: 1.25;

    /* Drops the overlay multiplier to 0, killing the white flash */
    --hover-overlay: 0;
}

@keyframes pulse-anim {
    0%, 80% {
        --pulse-scale: 1;
        --pulse-overlay: 0;
    }
    90% {
        --pulse-scale: 1.25;
        --pulse-overlay: 0.3;
    }
    100% {
        --pulse-scale: 1;
        --pulse-overlay: 0;
    }
}


.attention-shine {
    position: relative;
    overflow: hidden;   /* Hides the shine while it waits off-screen */
    isolation: isolate; /* Magic trick: keeps pseudo-element behind text but above base background */

    --bg-gradient-opacity: 0.5;
    --bg-gradient-color:var(--fallback-nc,oklch(var(--nc)/var(--bg-gradient-opacity)));

}

/* The Shine Layer */
.attention-shine::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1; /* Stays under text thanks to the parent's 'isolation' property */

    /* Your exact opacity mapping blueprint */
    background: linear-gradient(
            to right,
            rgb(from var(--bg-gradient-color) r g b / 0) 0%,
            rgb(from var(--bg-gradient-color) r g b / 0) 43%,
            rgb(from var(--bg-gradient-color) r g b / 0.8) 50%,
            rgb(from var(--bg-gradient-color) r g b / 0) 57%,
            rgb(from var(--bg-gradient-color) r g b / 0) 100%
    );

    /* Hardware acceleration for a stutter-free sweep */
    will-change: transform;

    /* 5-second loop running continuously on the background layer */
    animation: shine-sweep 5s infinite linear;
    /* transition --bg-gradient-color */
    transition: --bg-gradient-opacity 0.75s ease-out;
}
.attention-shine:hover {
    --bg-gradient-opacity: 0;
}

/* --- Keyframes --- */
@keyframes shine-sweep {
    /* 0% to 70%: The shine sits completely asleep, staged off-screen to the left */
    0%, 80% {
        transform: translateX(-100%);
    }
    /* 70% to 100%: In the last 30% of the time, it dashes completely to the right */
    100% {
        transform: translateX(100%);
    }
}


/* library extra styles */

@keyframes simRowFadeIn {
     from { opacity: 0; transform: translateY(4px); }
     to { opacity: 1; transform: translateY(0); }
}
.sim-row-enter {
    animation: simRowFadeIn 0.15s ease-out forwards;
}

@media (min-width: 1024px) {
    .library-grid-cols-2 {
        grid-template-columns: minmax(14rem, auto) minmax(0, 1fr);
    }

    .library-grid-cols-3 {
        grid-template-columns: minmax(14rem, auto) minmax(0, 2fr) minmax(0, 1fr);
    }

    .library-grid-cols-4 {
        grid-template-columns: minmax(14rem, auto) minmax(0, 1.8fr) minmax(0, 1fr) minmax(0, 0.9fr);
    }
}

.blink-loop{
    animation: blink linear 1s infinite;
}

@keyframes blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}