/* ==========================================================================
   Webhook Buttons for WooCommerce — order screen
   Buttons use the standard WP admin .button look. The dialog and toast are ours (no library).
   ========================================================================== */

.webhook-buttons-widget {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.webhook-buttons-button-card {
    display: flex;
}

.wp-core-ui .webhook-buttons-button-card .button.webhook-button {
    flex: 1;
    justify-content: center;
    text-align: center;
    white-space: normal;
}

/* Loading state — subtle pulse while a send is running */
.wp-core-ui .webhook-buttons-button-card .button.webhook-button.webhook-buttons-loading {
    animation: webhook-buttons-pulse 1.5s ease-in-out infinite;
}

@keyframes webhook-buttons-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* Dialog */
.webhook-buttons-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
}

.webhook-buttons-dialog {
    width: 100%;
    max-width: 440px;
    padding: 24px;
    background: #fff;
    border-left: 4px solid #2271b1;
    box-shadow: 0 3px 30px rgba(0, 0, 0, 0.2);
}

.webhook-buttons-dialog.is-error {
    border-left-color: #d63638;
}

.webhook-buttons-dialog__title {
    margin: 0 0 8px;
    font-size: 1.3em;
    line-height: 1.3;
}

.webhook-buttons-dialog__text {
    margin: 0 0 16px;
    color: #50575e;
}

.webhook-buttons-dialog__input {
    width: 100%;
    margin-bottom: 16px;
}

.webhook-buttons-dialog__link {
    display: inline-block;
    margin-bottom: 16px;
}

.webhook-buttons-dialog__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* Toast */
.webhook-buttons-toast {
    position: fixed;
    top: 48px;
    right: 16px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 360px;
    padding: 12px 16px;
    background: #fff;
    border-left: 4px solid #00a32a;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    transition: opacity 0.6s ease;
}

.webhook-buttons-toast.is-leaving {
    opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
    .wp-core-ui .webhook-buttons-button-card .button.webhook-button.webhook-buttons-loading {
        animation: none;
    }
    .webhook-buttons-toast {
        transition: none;
    }
}
