/**
 * Product Boxes - Front-end Admin Mode Styles
 * Only loaded when admin is logged in viewing the search page
 * Updated to match React/Tailwind design system
 */

/* Add to Box button on product cards */
.psfa-add-to-box-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--color-primary, #2563eb);
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: all 0.2s ease;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    font-family: inherit;
}

/* Show button on card hover */
.psfa-product:hover .psfa-add-to-box-btn,
.psfa-product-card:hover .psfa-add-to-box-btn,
.psfa-search-result-card:hover .psfa-add-to-box-btn {
    opacity: 1;
    transform: translateY(0);
}

.psfa-add-to-box-btn:hover {
    background: var(--color-primary-hover, #1d4ed8);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
}

.psfa-add-to-box-btn:active {
    transform: scale(0.97);
}

.psfa-add-to-box-btn:focus-visible {
    outline: 2px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}

/* Icon */
.psfa-box-icon {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
}

/* Loading state */
.psfa-add-to-box-btn.psfa-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Success state */
.psfa-add-to-box-btn.psfa-added {
    background: #16a34a;
    pointer-events: none;
}

.psfa-add-to-box-btn.psfa-added .psfa-box-icon {
    display: none;
}

.psfa-add-to-box-btn.psfa-added::before {
    content: '✓';
    font-weight: 600;
}

/* Error state */
.psfa-add-to-box-btn.psfa-error {
    background: #dc2626;
}

/* Toast notification - modern design */
.psfa-boxes-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--color-background, #ffffff);
    color: var(--color-foreground, #0f172a);
    padding: 16px 20px;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1), 0 4px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--color-border, #e2e8f0);
    animation: psfa-toast-in 0.3s ease-out;
    font-family: inherit;
}

.psfa-boxes-toast.psfa-toast-out {
    animation: psfa-toast-out 0.3s ease-out forwards;
}

@keyframes psfa-toast-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes psfa-toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

.psfa-boxes-toast-shortcode {
    background: var(--color-muted, #f1f5f9);
    padding: 6px 10px;
    border-radius: 0.375rem;
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.75rem;
    color: var(--color-foreground, #0f172a);
}

.psfa-boxes-toast-copy {
    background: var(--color-primary, #2563eb);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.15s ease;
    font-family: inherit;
}

.psfa-boxes-toast-copy:hover {
    background: var(--color-primary-hover, #1d4ed8);
}

.psfa-boxes-toast-copy.copied {
    background: #16a34a;
}

/* Ensure product cards have relative positioning for button */
.psfa-product,
.psfa-product-card,
.psfa-search-result-card {
    position: relative;
}
