/* Custom styles for Knip */

/* Shimmer animation for loading states */
@keyframes shimmer {
    0% {
        background-position: 150% 0;
    }

    100% {
        background-position: -50% 0;
    }
}

.shimmer-border {
    position: absolute;
    inset: -3px;
    border-radius: 0.6rem;
    padding: 3px;
    background: linear-gradient(90deg, transparent 20%, var(--shimmer-color, #e5e7eb) 50%, transparent 80%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite linear;
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 50;
}

.shimmer-bg-soft {
    background: linear-gradient(120deg, #f8fafc 30%, #e0f2fe 50%, #f8fafc 70%);
    background-size: 200% 100%;
    animation: shimmer 4s infinite linear;
}

.shimmer-border-animated {
    position: relative;
    /* No border or background clip needed on parent, handled by ::after */
}

.shimmer-border-animated::after {
    content: "";
    position: absolute;
    inset: -2px;
    /* Slight overlap to cover existing border */
    border-radius: inherit;
    padding: 2px;
    background: linear-gradient(120deg, transparent 10%, var(--shimmer-color, #60a5fa) 50%, transparent 90%);
    background-size: 200% 100%;
    animation: shimmer 3s infinite linear;

    /* Create the border cut-out */
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
    z-index: 10;
}

-webkit-mask-composite: xor;
mask-composite: exclude;
mask: linear-gradient(#fff 0 0) content-box,
linear-gradient(#fff 0 0);

pointer-events: none;
/* Allow clicks through */
z-index: 10;
}

/* Prevent text selection on bill items for double-tap claiming */
.bill-item {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* =============================================================================
   Button Components
   ============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 2rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.btn-primary {
    background-color: #111827;
    color: white;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-primary:hover {
    background-color: #1f2937;
}

.btn-secondary {
    background-color: white;
    color: #374151;
    border: 1px solid #d1d5db;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.btn-secondary:hover {
    background-color: #f9fafb;
}

/* =============================================================================
   Card Components
   ============================================================================= */

.card {
    background-color: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
}

.card-body {
    padding: 1.5rem;
}

/* =============================================================================
   Flash Animation for "Select Name First" Feedback
   ============================================================================= */

.flash-red {
    background-color: #fef2f2 !important;
    /* red-50 */
    border-color: #ef4444 !important;
    /* red-500 */
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.3) !important;
}

@media (prefers-color-scheme: dark) {
    .flash-red {
        background-color: #450a0a !important;
        /* red-950 */
        border-color: #f87171 !important;
        /* red-400 */
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.5) !important;
    }
}